Nmap Cheat Sheet
Nmap Cheat Sheet
Scan Techniques
Switch Example Description
-sS nmap 192.168.1.1 -sS TCP SYN port scan (Default)
-sT nmap 192.168.1.1 -sT TCP connect port scan (Default without root privilege)
Host Discovery
Switch Example Description
-sn nmap 192.168.1.1/24 -sn Disable port scanning. Host discovery only.
-Pn nmap 192.168.1.1-5 -Pn Disable host discovery. Port scan only.
Port Specification
Switch Example Description
-sV –version- nmap 192.168.1.1 -sV – Enable light mode. Lower possibility of
-sV –version- nmap 192.168.1.1 -sV – Enable intensity level 9. Higher possibility
OS Detection
Switch Example Description
-O –osscan- nmap 192.168.1.1 -O – If at least one open and one closed TCP port are not
nmap 192.168.1.1
-T1 Sneaky (1) Intrusion Detection System evasion
-T1
nmap 192.168.1.1 Polite (2) slows down the scan to use less bandwidth and use
-T2
-T2 less target machine resources
nmap 192.168.1.1
-T3 Normal (3) which is default speed
-T3
nmap 192.168.1.1 Aggressive (4) speeds scans; assumes you are on a reasonably
-T4
-T4 fast and reliable network
nmap 192.168.1.1 Insane (5) speeds scan; assumes you are on an extraordinarily
-T5
-T5 fast network
Example
Switch Description
input
–min-rtt-timeout/max-rtt-timeout/
1s; 4m; 2h Specifies probe round trip time
initial-rtt-timeout <time>
–min-hostgroup/max-hostgroup <size<
50; 1024 Parallel host scan group sizes
size>
–min-parallelism/max-parallelism <nu
10; 1 Probe parallelization
mprobes>
20ms; 2s;
–scan-delay/–max-scan-delay <time> Adjust delay between probes
4m; 5h
NSE Scripts
Switch Example Description
and safe
–script nmap 192.168.1.1 –script default Scan with default NSE scripts.
iR 1000 servers
subdomains
192.168.1.1
scanme.nmap.org vulnerabilities
packet filters
nmap -D
Send scans from
-D 192.168.1.101,192.168.1.102,192.168.1.103,192.168.1.23
spoofed IPs
192.168.1.1
may be required)
Relay connections
proxies
Output
Switch Example Description
-oX nmap 192.168.1.1 -oX xml.file XML output to the file xml.file
-oG nmap 192.168.1.1 -oG grep.file Grepable output to the file grep.file
-oA nmap 192.168.1.1 -oA results Output in the three major formats at once
–open nmap 192.168.1.1 –open Only show open (or possibly open) ports
–packet- nmap 192.168.1.1 -T4 –packet- Show all packets sent and received
trace trace
nmap -p80 -sV -oG – –open 192.168.1.1/24 | Scan for web servers and grep to show
ndiff scanl.xml scan2.xml Compare output from nmap using the ndif
Miscellaneous Options
Switch Example Description
nmap 192.168.1.1-50 -sL –dns-server Query the Internal DNS for hosts, list