Back

NMAP Command Reference

Complete NMAP command cheatsheet with practical examples

Host Discovery

nmap command
nmap -sn 192.168.1.0/24

Ping scan (no port scan)

nmap command
nmap -Pn target

Skip host discovery (assume host is alive)

nmap command
nmap -PR 192.168.1.0/24

ARP ping scan (local network)

nmap command
nmap -PS22,80,443 target

TCP SYN ping on specific ports

nmap command
nmap -PA80,443 target

TCP ACK ping on specific ports

Scan Types

nmap command
nmap target

Default TCP SYN scan (top 1000 ports)

nmap command
nmap -sS target

TCP SYN scan (stealth scan)

nmap command
nmap -sT target

TCP Connect scan (full connection)

nmap command
nmap -sU target

UDP scan

nmap command
nmap -sF target

TCP FIN scan

nmap command
nmap -sN target

TCP NULL scan

Port Specification

nmap command
nmap -p 80 target

Single port

nmap command
nmap -p 80,443 target

Multiple specific ports

nmap command
nmap -p 1-100 target

Port range

nmap command
nmap -p- target

All 65535 ports

nmap command
nmap --top-ports 100 target

Scan top 100 most common ports

nmap command
nmap -F target

Fast scan (top 100 ports)

Service Detection

nmap command
nmap -sV target

Service version detection

nmap command
nmap -A target

Aggressive scan (OS, version, scripts)

nmap command
nmap -O target

Operating system detection

nmap command
nmap -sC target

Default scripts

nmap command
nmap --script vuln target

Vulnerability detection scripts

Timing and Performance

nmap command
nmap -T0 target

Paranoid timing (very slow)

nmap command
nmap -T1 target

Sneaky timing (slow)

nmap command
nmap -T3 target

Normal timing (default)

nmap command
nmap -T4 target

Aggressive timing (fast)

nmap command
nmap -T5 target

Insane timing (very fast)

Firewall/IDS Evasion

nmap command
nmap -f target

Fragment packets

nmap command
nmap -D decoy1,decoy2,ME target

Decoy scan

nmap command
nmap --source-port 53 target

Spoof source port

nmap command
nmap --data-length 25 target

Append random data

nmap command
nmap --randomize-hosts target

Randomize target order