This cheat sheet provides a collection of useful commands for the OSCP certification exam.
// Stealth scanning
sudo nmap -sS <target>
// Full TCP connection is made
nmap -sT <target>
// UDP scan
nmap -sU <target>
// Network sweeping
nmap -sn 192.168.100.1-253 -oG sweep.txt
grep Up sweep.txt | cut d " " -f 2
nmap -p 80 -sn 192.168.100.1-253 -oG web-sweep.txt
grep open web-sweep.txt | cut d " " -f 2
// OS scan
nmap -O <target> --osscan-guess
// Scan with NSE script
nmap --script http-headers <target>
nmap --script-help http-headers
// Port scan
Test-NetConnection -Port 445 <target>
// Port sweeping
foreach ($port in 1..1024) {if (($a=Test-Connection <target&rt; -Port $port -WarningAction SilentlyCongiue).tcp TestSucceeded -eq $true){"TCP port $port is open"}}
host <target-domain>Common query types:
host -t <query type> <target-domain>
// list.txt contains a candidate list of subdomains
for ip in $(cat list.txt); do host $ip.example.com; done
// Search by IP addr
for ip in $(seq 200 245); do host 52.10.10.$ip; done | grep -v "not found"
dnsrecon -d <target-domain> -t std
dnsrecon -d <target-domain> -D ~/list.txt -t brt
dnsenum <target-domain>
enum4linux -a <target>
smbclient -L <target> -U username
// NSE script with "vuln"Using specific CVE NSE Script
sudo nmap -sV -p 443 --script "vuln" 192.168.100.2
sudo nmap --script-updatedb
sudo nmap -sV -p 443 --script "http-vuln-cve2021-41773" 192.168.100.2
sudo nmap -p 80 -sV <target>
sudo nmap -p 80 --script=http-enum <target>
gobuster dir -u <target> -w /usr/share/wordlists/dirb/common.txt -t <# of threads>
./linpeas.sh
find / -perm -4000 2>/dev/null
netstat -tulpn