NMAP Cheat Sheet v1

Port Specification Options
SyntaxExampleDescription
-pnmap -p 23 192.168.1.1scanning port 23 of host
-pnmap -p 23-100 192.168.1.1scanning port range 23-100
-pU: , -T:nmap -pU:110,T:23-25 192.168.1.1scanning UDP 110 and range 23-25 TCP
-p-nmap -p- 192.168.1.1scanning all ports
-Fnmap -F 192.168.1.1fast port scan
-rnmap -r 192.168.1.1sequencial port scan
Scanning Types (-s / -S)
SyntaxExampleDescription
-sSnmap -sS 192.168.1.1TCP SYN port Scan
-sTnmap -sT 192.168.1.1TCP Connet port scan
-sAnmap -sA 192.168.1.1TCP ACK port scan
-sUnmap -sU 192.168.1.1UDP port scan
-Sfnmap -Sf 192.168.1.1TCP FIN scan
-Sunmap -Su 192.168.1.1UDP scan
-sLnmap -sL 192.168.1.1-253List scan
Discovery Scan (-s / -P -n)
SyntaxExampleDescription
-sLnmap -sL 192.168.1.1-254list x.1-x.254 withour scan
-snnmap -sn 192.168.1.1/24disable port scan
-Pnnmap -Pn 192.168.1.1/24only portscan without host discovery
-PSnmap 192.168.1.1 -PS22-25,80,443SYN specified port scan 22-25,80,443
-PAnmap 192.168.1.1 -PA22-25,80,443ACK specified port scan 22-25,80,443
-PUnmap 191.68.1.1 -PU53UDP specified port scan
-PRnmap 192.168.1.1-255ARP discovery
-nnmap 192.168.1.1 -nno DNS reselution
Version Detection
SyntaxExampleDescription
-sVnmap -sV 192.168.1.1try to find the version of Service
-sV –version-allnmap -sV –version-all 192.168.1.Set intensily level to 9
-sV –version-lightnmap -sV –version-light 192.168.enable light mode
-Anmap -A 192.168.1.1enable all detections (OS,ver,script)
-Onmap -O 192.168.1.1OS-Detection
Scan options
SyntaxDescription
nmap -sP 192.168.1.1Ping Scan only
nmap 192.168.1.1 192.168.1.100Scan specific Ips
nmap 192.168.1.1-253scan a range of Ips
nmap test.descan a domain
nmap 192.168.1.0/24scan using CIDR
nmap -iL targets.txtscan from target file
Specification
Syntaxdescription
nmap 192.178.1.1single IP scan
nmap 192.178.1.1 192.168.100.1scan specific Ips
nmap 192.168.1.254scan a range of IPs
nmap test.comscan a domain
nmap 192.168.1.0/24scan CIDR notation
nmap -iL scan.txtscan from files
nmap –execlude 192.168.1.2exclude a specified IP
nmap –traceroute 192.168.1.1traceroute 192.168.1.1
nmap Output Formats (-o)
Syntaxdescription
Default /normal outputnmap -oN rs.txt 192.168.1.1
XMLnmap -oX rs.xml 192.168.1.
Grepablenmap -oG gp.txt 192.168.1.
All formatsnmap -oA all.txt 192.168.1.
Firewall Proofing
Syntaxdescription
nmap -f 192.168.1.1scan fragment packets
nmap -sTU 1490 192.168.1.1scan with specified MTU (1490)
nmap -sI 5 192.168.2.2scan ZOMBIE
nmap -source-port 22 192.168.1.1manual source port -specifiy scan
nmap -data-length 1400 192.168.1.1randomly appended data 1400
nmap -randomize-hosts192.168.1.0/25randomly scan of hosts
Timing Options
Syntaxdescription
nmap -T0 192.168.1.1slowest
nmap -T1 192.168.1.1tricky Scan to avoid IDS
nmap -T2 192.168.1.1timely scan
nmap -T3 192.168.1.1default scan timer
nmap -T4 192.168.1.1aggresive scan timer
nmap -T5 192.168.1.1avery aggresive scan timer
Use of nmap Scipts NSE
Syntaxdescription
nmap –script= test script 192.168.1.0/24execute script against target IP
nmap –script-updatedbupdate/adding new scripts
nmap -sV -sC 192.168.1.1safe default Scripts
nmao –script-help=”Test Script”get help for script
Mscellaneous Commands
Syntaxdescription
nmap -6scan IP-V6 targets
nmap -proxiesrun with proxies
nmap -openshow open ports only