Nmap is the foundation of every network engagement. This cheatsheet covers every scan type, timing option, NSE category, and evasion technique you’ll need — organized for quick lookup during pentests and CTF challenges.
Target Specification
nmap 192.168.1.1 # single IP nmap 192.168.1.1-254 # IP range nmap 192.168.1.0/24 # CIDR nmap 10.0.0.0/8 # entire class A nmap -iL targets.txt # from file nmap --exclude 192.168.1.5 # exclude host nmap 192.168.1.1 192.168.1.2 # multiple targets
# Random targets nmap -iR 100 --open # 100 random internet hosts
Scan Types
# TCP SYN scan (default, requires root) nmap -sS 192.168.1.1
# Ping scan only (no port scan) nmap -sn 192.168.1.0/24
Port Specification
nmap -p 22 192.168.1.1 # single port nmap -p 22,80,443 192.168.1.1 # multiple ports nmap -p 1-1024 192.168.1.1 # port range nmap -p- 192.168.1.1 # all 65535 ports nmap -p U:53,T:80,443 192.168.1.1 # mixed UDP/TCP nmap -p http,ftp 192.168.1.1 # by service name nmap --top-ports 1000 192.168.1.1 # most common 1000 nmap --top-ports 100 192.168.1.1 # most common 100 nmap -F 192.168.1.1 # fast — top 100
-T0 # Paranoid — IDS evasion, very slow -T1 # Sneaky — slow, lower risk of detection -T2 # Polite — slows to avoid bandwidth issues -T3 # Normal — default -T4 # Aggressive — faster, assumes reliable network -T5 # Insane — very fast, may miss open ports
Fine-grained timing:
--min-rate 1000 # at least 1000 packets/sec --max-rate 500 # at most 500 packets/sec --min-parallelism 100 # minimum parallel probes --max-retries 2 # fewer retries = faster --host-timeout 5m # give up on host after 5 min --scan-delay 200ms # wait 200ms between probes
Host Discovery
# ICMP echo ping nmap -PE 192.168.1.0/24
# TCP SYN ping (no ICMP) nmap -PS22,80,443 192.168.1.0/24
No comments yet. Be the first.