Nmap Cheat Sheet
Nmap Cheat Sheet
You may download the PDF version of this cheat sheet here
Start typing...
Target Specification
Scan Techniques
-sT nmap 192.168.1.1 -sT TCP connect port scan (Default without root privilege)
Host Discovery
-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
–top-
nmap 192.168.1.1 –top-ports 2000 Port scan the top x ports
ports
-sV –version- nmap 192.168.1.1 -sV – Intensity level 0 to 9. Higher number increases
intensity version-intensity 8 possibility of correctness
-sV –version- nmap 192.168.1.1 -sV – Enable light mode. Lower possibility of correctness.
light version-light Faster
OS Detection
-O –
nmap 192.168.1.1 -O – If at least one open and one closed TCP port are not found it will
osscan-
osscan-limit not try OS detection against host
limit
-O –
nmap 192.168.1.1 -O –
osscan- Makes Nmap guess more aggressively
osscan-guess
guess
-T0 nmap 192.168.1.1 -T0 Paranoid (0) Intrusion Detection System evasion
-T1 nmap 192.168.1.1 -T1 Sneaky (1) Intrusion Detection System evasion
Polite (2) slows down the scan to use less bandwidth and use less
-T2 nmap 192.168.1.1 -T2
target machine resources
EXAMPLE
SWITCH DESCRIPTION
INPUT
–min-rtt-timeout/max-rtt-timeout/initial-rtt-
1s; 4m; 2h Specifies probe round trip time
timeout <time>
–min-hostgroup/max-
50; 1024 Parallel host scan group sizes
hostgroup <size<size>
–min-parallelism/max-
10; 1 Probe parallelization
parallelism <numprobes>
NSE Scripts
–script nmap 192.168.1.1 –script=banner Scan with a single script. Example banner
–script nmap 192.168.1.1 –script “not intrusive” Scan default, but remove intrusive scripts
COMMAND DESCRIPTION
nmap -D
-D 192.168.1.101,192.168.1.102,192.168.1.103,192.168.1.23 Send scans from spoofed IPs
192.168.1.1
nmap -D decoy-ip1,decoy-ip2,your-own-ip,decoy-
-D Above example explained
ip3,decoy-ip4 remote-host-ip
Output
-oN nmap 192.168.1.1 -oN normal.file Normal output to the file normal.file
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
-oG – nmap 192.168.1.1 -oG – Grepable output to screen. -oN -, -oX – also usable
–open nmap 192.168.1.1 –open Only show open (or possibly open) ports
COMMAND DESCRIPTION
nmap -p80 -sV -oG – –open 192.168.1.1/24 | grep Scan for web servers and grep to show which IPs are
open running web servers
ndiff scanl.xml scan2.xml Compare output from nmap using the ndif
Miscellaneous Options
nmap 192.168.1.1-1/24 -PR -sn -vv Arp discovery only on local network, no port scan
nmap 192.168.1.1-50 -sL –dns-server 192.168.1.1 Query the Internal DNS for hosts, list targets only
Nathan House
Nathan House is the founder and CEO of Station X a cyber security training and consultancy company. He has
over 25 years experience in cyber security where he has advised some of largest companies in the world,
assuring security on multi-million and multi-billion pound projects. Nathan is the author of the popular "The
Complete Cyber Security Course" which has been taken by over half a million students in 195 countries. Winner
of the AI "Cyber Security Educator of the Year 2020" award. Over the years he has spoken at a number of
security conferences, developed free security tools, and discovered serious security vulnerabilities in leading
applications. PGP Fingerprint : CBA3FBF729FB00CB21D64FB00E7955AE6E37FEF1
Related Articles
CONSULTING