Reference

Nmap Cheat Sheet

30+ essential Nmap commands organized by use case. Bookmark this page for quick reference.

Target Specification

nmap 192.168.1.1Scan a single IP
nmap 192.168.1.1-100Scan a range of IPs
nmap 192.168.1.0/24Scan an entire subnet (CIDR)
nmap scanme.nmap.orgScan a hostname
nmap -iL targets.txtScan targets from a file
nmap 192.168.1.1 --exclude 192.168.1.10Exclude specific hosts

Scan Types

nmap -sS 192.168.1.1SYN stealth scan (default, needs raw sockets)
nmap -sT 192.168.1.1TCP connect scan (works without raw sockets)
nmap -sU 192.168.1.1UDP scan (slower, use with -p for specific ports)
nmap -sV 192.168.1.1Service/version detection
nmap -O 192.168.1.1OS fingerprinting
nmap -A 192.168.1.1Aggressive: OS + version + script + traceroute

Port Selection

nmap -p 80 192.168.1.1Scan a single port
nmap -p 22,80,443 192.168.1.1Scan specific ports
nmap -p 1-1000 192.168.1.1Scan a range of ports
nmap -p- 192.168.1.1Scan all 65,535 ports
nmap -F 192.168.1.1Fast scan (top 100 ports)
nmap --top-ports 200 192.168.1.1Scan top N ports

Output Formats

nmap -oN scan.txt 192.168.1.1Normal output to file
nmap -oX scan.xml 192.168.1.1XML output (machine-readable)
nmap -oG scan.gnmap 192.168.1.1Grepable output
nmap -oA scan 192.168.1.1All formats at once
nmap -v 192.168.1.1Verbose output (use -vv for more detail)

Timing & Performance

nmap -T0 192.168.1.1Paranoid — extremely slow, evades IDS
nmap -T2 192.168.1.1Polite — slows down to reduce bandwidth
nmap -T3 192.168.1.1Normal — default timing
nmap -T4 192.168.1.1Aggressive — fast, assumes good network
nmap -T5 192.168.1.1Insane — very fast, may miss ports
nmap --max-retries 1 192.168.1.1Limit retries to speed up scan

NSE Scripts

nmap --script vuln 192.168.1.1Run vulnerability detection scripts
nmap --script safe 192.168.1.1Run safe (non-disruptive) scripts
nmap --script http-headers 192.168.1.1Check HTTP security headers
nmap --script ssh-auth-methods 192.168.1.1Enumerate SSH auth methods
nmap --script ssl-enum-ciphers -p 443 192.168.1.1Check SSL/TLS cipher strength
nmap --script-updatedbUpdate NSE script database

Practical Combinations

nmap -sT -Pn -F -sV --version-light -T4 192.168.1.1Quick scan (NetAudit AI fast profile)
nmap -sT -Pn -sV -p 1-1000 -T4 192.168.1.1Deep scan (NetAudit AI detailed profile)
nmap -sn 192.168.1.0/24Ping sweep — discover live hosts without port scan
sudo nmap -sS -sV -O -T4 192.168.1.1Full recon: stealth SYN + version + OS

Try These Scans in NetAudit AI

NetAudit AI runs these Nmap scans for you — no terminal needed. The Quick Audit profile uses -sT -Pn -F -sV --version-light -T4 and the Deep Inspection uses -sT -Pn -sV -p 1-1000 -T4. Both include AI analysis and remediation.

Related Guides