xutil.dev
Login

Nmap Cheatsheet

Nmap command cheatsheet covering port scanning, host discovery, service detection, OS detection, NSE scripts, firewall evasion, and output options organized by category

Related Categories:NetworkSecurity

77 commands

nmap <host>

Scan a single host

nmap <host1> <host2>

Scan multiple hosts

nmap <range>

Scan an IP range

nmap <CIDR>

Scan a subnet

nmap -iL <file>

Read targets from file

nmap --exclude <host>

Exclude a host

nmap --excludefile <file>

Exclude from file

nmap -iR <num>

Scan N random hosts

nmap -sn

Ping scan, no port scan

nmap -Pn

Skip host discovery

nmap -PS<ports>

TCP SYN discovery

nmap -PA<ports>

TCP ACK discovery

nmap -PU<port>

UDP discovery

nmap -PR

ARP scan (local network)

nmap -PE

ICMP echo discovery

nmap -n

No reverse DNS resolution

nmap --traceroute

Perform traceroute

nmap -sS

TCP SYN scan (stealth)

nmap -sT

TCP connect scan

nmap -sU

UDP scan

nmap -sA

TCP ACK scan (firewall detection)

nmap -sN

TCP NULL scan

nmap -sF

TCP FIN scan

nmap -sX

TCP Xmas scan

nmap -sW

TCP window scan

nmap -sO

IP protocol scan

nmap -p <ports>

Scan specific ports

nmap -p <range>

Scan port range

nmap -p-

Scan all 65535 ports

nmap --top-ports <n>

Scan top N ports

nmap -F

Fast scan (top 100)

nmap -sU -p <ports>

Scan specific UDP ports

nmap -sS -sU -p T:,U:

Combined TCP and UDP scan

nmap -p <service-name>

Specify ports by service name

nmap -sV

Service version detection

nmap -O

OS detection

nmap -A

Aggressive scan (OS, version, scripts, traceroute)

nmap -sV --version-intensity <n>

Set version detection intensity

nmap -sV --version-light

Light version detection

nmap -sV --version-all

Try all probes for version detection

nmap -O --osscan-guess

Aggressive OS guessing

nmap -O --osscan-limit

Limit OS detection to promising targets

nmap --script=default

Run default scripts

nmap --script=vuln

Run vulnerability scripts

nmap --script=safe

Run safe scripts

nmap --script=auth

Run authentication scripts

nmap --script=http-enum

HTTP directory enumeration

nmap --script=ssl-cert

Get SSL certificate info

nmap --script=ssl-enum-ciphers

Enumerate SSL ciphers

nmap --script=smb-vuln*

Check SMB vulnerabilities

nmap --script=dns-brute

DNS brute force

nmap --script=banner

Banner grabbing

nmap -T0

Paranoid timing (IDS evasion)

nmap -T1

Sneaky timing

nmap -T2

Polite timing (less bandwidth)

nmap -T3

Normal timing (default)

nmap -T4

Aggressive timing

nmap -T5

Insane timing (may miss ports)

nmap --min-rate <n>

Set minimum packet rate

nmap --max-retries <n>

Limit max retries

nmap -f

Fragment packets

nmap --mtu <size>

Specify MTU size

nmap -D RND:<n>

Decoy scan

nmap -S <ip>

Spoof source IP

nmap -g <port>

Specify source port

nmap --data-length <n>

Append random data to packets

nmap --randomize-hosts

Randomize target host order

nmap --spoof-mac <mac>

Spoof MAC address

nmap -oN <file>

Save normal output

nmap -oX <file>

Save XML output

nmap -oG <file>

Save grepable output

nmap -oA <basename>

Save in all formats

nmap -v

Verbose output

nmap -vv

Very verbose output

nmap -d

Debug output

nmap --reason

Show port state reason

nmap --packet-trace

Show all packets sent/received