Complete NMAP command cheatsheet with practical examples
nmap -sn 192.168.1.0/24
Ping scan (no port scan)
nmap -Pn target
Skip host discovery (assume host is alive)
nmap -PR 192.168.1.0/24
ARP ping scan (local network)
nmap -PS22,80,443 target
TCP SYN ping on specific ports
nmap -PA80,443 target
TCP ACK ping on specific ports
nmap target
Default TCP SYN scan (top 1000 ports)
nmap -sS target
TCP SYN scan (stealth scan)
nmap -sT target
TCP Connect scan (full connection)
nmap -sU target
UDP scan
nmap -sF target
TCP FIN scan
nmap -sN target
TCP NULL scan
nmap -p 80 target
Single port
nmap -p 80,443 target
Multiple specific ports
nmap -p 1-100 target
Port range
nmap -p- target
All 65535 ports
nmap --top-ports 100 target
Scan top 100 most common ports
nmap -F target
Fast scan (top 100 ports)
nmap -sV target
Service version detection
nmap -A target
Aggressive scan (OS, version, scripts)
nmap -O target
Operating system detection
nmap -sC target
Default scripts
nmap --script vuln target
Vulnerability detection scripts
nmap -T0 target
Paranoid timing (very slow)
nmap -T1 target
Sneaky timing (slow)
nmap -T3 target
Normal timing (default)
nmap -T4 target
Aggressive timing (fast)
nmap -T5 target
Insane timing (very fast)
nmap -f target
Fragment packets
nmap -D decoy1,decoy2,ME target
Decoy scan
nmap --source-port 53 target
Spoof source port
nmap --data-length 25 target
Append random data
nmap --randomize-hosts target
Randomize target order