Nmap Network Scanning & Reconnaissance Cheat Sheet
Nmap (“Network Mapper”) is the industry standard for network discovery, port scanning, and vulnerability surface mapping. This cheat sheet compiles the most critical scanning flags categorized by operational objective. 1. Host Discovery (Ping Sweeps) Determine which hosts are alive on a target network without performing full port scans: # ICMP Echo Request nmap -sn -PE <target_range> # ICMP Timestamp & Address Mask Requests nmap -sn -PP <target_range> nmap -sn -PM <target_range> # ARP Ping (fastest for local subnet discovery) nmap -sn -PR <local_subnet> # TCP SYN / ACK Ping (probes ports without full scan) nmap -sn -PS22,80,443 <target_range> nmap -sn -PA80,443 <target_range> 2. Core Port Scanning Techniques Flag Scan Type Description -sS TCP SYN (Stealth) Default scan. Sends SYN, receives SYN/ACK, then sends RST without completing handshake. Stealthy and fast. -sT TCP Connect Completes the full 3-way handshake (connect() syscall). Used when unprivileged or behind strict proxies. -sU UDP Scan Probes UDP endpoints (DNS, SNMP, NTP, DHCP). Slower because closed ports return ICMP port unreachable. -sV Version Detection Interrogates open ports to determine service name and version numbers. -sA TCP ACK Scan Maps firewall rules and state tables (determines filtered vs. unfiltered ports). -sW TCP Window Scan Exploits anomalies in TCP Window sizes of certain OS implementations. # Typical comprehensive scan: nmap -sS -sV -sC -O -p- -T4 <target> 3. Advanced & Inverse TCP Scans (Bypassing Stateless Firewalls) Inverse scans manipulate TCP header flags (RFC 793). Open ports drop the packet without reply, whereas closed ports respond with a RST: ...