Nmap Command Reference

Basic Scanning Techniques

Scan a single target -> nmap [target]

Scan multiple targets -> nmap [target1] [target2]

Scan a list of targets -> nmap -iL [list.txt]

Scan a range of hosts -> nmap [range]

Scan an entire subnet -> nmap [IP/cidr]

Excluding targets -> nmap [targets] --exclude [targets]

Perform an aggressive scan -> nmap -A [target]

Discovery Options

Perform a ping scan only -> nmap -sn [target]

Don't ping (Assume host is up) -> nmap -Pn [target]

ARP ping -> nmap -PR [target]

Traceroute -> nmap --traceroute [target]

Disable reverse DNS resolution -> nmap -n [target]

Advanced Scanning Options

TCP SYN Scan (Stealth) -> nmap -sS [target]

TCP connect scan -> nmap -sT [target]

UDP scan -> nmap -sU [target]

TCP Null scan -> nmap -sN [target]

Port Scanning Options

Perform a fast scan -> nmap -F [target]

Scan specific ports -> nmap -p [ports] [target]

Scan all ports -> nmap -p- [target]

Scan top ports -> nmap --top-ports [number] [target]

Version Detection

Operating system detection -> nmap -O [target]

Service version detection -> nmap -sV [target]

Firewall Evasion Techniques

Fragment packets -> nmap -f [target]

Specify a specific MTU -> nmap --mtu [MTU] [target]

Spoof MAC Address -> nmap --spoof-mac [MAC] [target]

Output Options

Save output to a text file -> nmap -oN [scan.txt] [target]