Pentesting Cheat Sheets
Searchable, copy-ready command references for authorized penetration tests and smart contract audits.
Quick, copy-ready command references for learning and for authorized, scoped security testing. Search across every sheet, filter by category, and copy any snippet with one click. These are lookup references, not ready-to-run attack payloads — each section links to the full tutorial and official docs.
Use these commands only on systems you own or are explicitly authorized to test. Keep notes and timestamps for your report.
Reconnaissance & Enumeration
First-phase commands you run against systems you own or are authorized to test, to understand what is exposed before anything else. Keep notes and timestamps for your report.
nmap -sV -sC --top-ports 1000 -oA scan_quick TARGET
nmap -p- --min-rate 2000 -oA scan_allports TARGET
nmap -p$(ports) -sV -sC -oA scan_services TARGET
nmap -sV --script "default,safe" -oN scan_nse.txt TARGET
nmap -sn 10.0.0.0/24 -oG sweep.txt
dig +short ANY example.com
dig +short MX example.com
host -t txt example.com
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
curl -sI https://example.com
Web Application Testing
References for reviewing your own web apps against the OWASP Testing Guide. Use a staging environment and a written scope.
docker run --rm -t ghcr.io/zaproxy/zaproxy zap-baseline.py -t https://staging.example.com
nuclei -u https://staging.example.com -etags intrusive,dos,fuzz -severity low,medium,high,critical
ffuf -u https://staging.example.com/FUZZ -w wordlist.txt -mc 200,204,301,302,401,403
Content-Security-Policy
Strict-Transport-Security
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin-when-cross-origin
Set-Cookie: session=...; Secure; HttpOnly; SameSite=Lax; Path=/
Linux Hardening & Audit
Read-only commands to audit a Linux host you administer: find weak configuration before an attacker does.
uname -a
cat /etc/os-release
sudo ss -tulpen
find / -xdev -type f -perm -0002 -ls 2>/dev/null
find / -xdev -perm -4000 -type f -ls 2>/dev/null
sudo -l
crontab -l
sudo ls -la /etc/cron.* /etc/cron.d
sudo lynis audit system
Containers & Cloud
Scan container images and infrastructure-as-code for vulnerabilities and misconfigurations in your pipeline.
trivy image --severity HIGH,CRITICAL --ignore-unfixed myorg/app:latest
trivy config .\ntrivy fs --scanners secret,vuln .
trivy image --format cyclonedx -o sbom.json myorg/app:latest
prowler aws --compliance cis_3.0_aws
kube-bench run --targets node
Smart Contract Security
Tooling for auditing Solidity contracts you are authorized to review. Run on a copy of the repository.
slither .
slither . --print human-summary
surya describe contracts/Token.sol
surya graph contracts/Token.sol | dot -Tpng > graph.png
myth analyze contracts/Token.sol --solv 0.8.21
forge build
forge test --gas-report
forge test --fuzz-runs 10000
Quick Reference Tables
Lookups you reach for constantly during an assessment.
20/21 FTP 22 SSH 23 Telnet 25 SMTP
53 DNS 80 HTTP 110 POP3 143 IMAP
389 LDAP 443 HTTPS 445 SMB 3306 MySQL
3389 RDP 5432 Postgres 6379 Redis 27017 MongoDB
200 OK 301/302 Redirect 401 Unauthorized
403 Forbidden 404 Not Found 405 Method Not Allowed
429 Too Many Requests 500 Server Error 502/503 Gateway
python3 -m http.server 8000
openssl rand -base64 24
sha256sum file.bin
