Nmap Cheat Sheet 2023
Nmap Cheat Sheet 2023
Search our Nmap cheat sheet to find the right cheat for the term you're looking
for. Simply enter the term in the search bar and you'll receive the matching
cheats available.
Target Specification
SWITCH EXAMPLE DESCRIPTION
-sT nmap 192.168.1.1 -sT TCP connect port scan (Default without root privilege)
https://www.stationx.net/nmap-cheat-sheet/ 2/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
Email Address
DOWNLOAD
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.
https://www.stationx.net/nmap-cheat-sheet/ 3/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
OS discovery www.google.com
Generate
Port Specification
SWITCH EXAMPLE DESCRIPTION
https://www.stationx.net/nmap-cheat-sheet/ 4/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
-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
light version-light correctness. Faster
OS Detection
SWITCH EXAMPLE DESCRIPTION
https://www.stationx.net/nmap-cheat-sheet/ 5/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
-O -osscan- nmap 192.168.1.1 -O - If at least one open and one closed TCP port are not
limit osscan-limit found it will not try OS detection against host
-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
-T2 nmap 192.168.1.1 -T2
less target machine resources
https://www.stationx.net/nmap-cheat-sheet/ 6/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
EXAMPLE
SWITCH DESCRIPTION
INPUT
-min-rtt-timeout/max-rtt-timeout/initial-
1s; 4m; 2h Specifies probe round trip time
rtt-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
SWITCH EXAMPLE DESCRIPTION
https://www.stationx.net/nmap-cheat-sheet/ 7/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
nmap -n -Pn -p 80 -open -sV -vvv -script banner,http-title -iR Fast search for random web
1000 servers
Requested scan
(including ping scans)
-f nmap 192.168.1.1 -f use tiny fragmented
IP packets. Harder for
packet filters
https://www.stationx.net/nmap-cheat-sheet/ 8/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
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
Relay connections
nmap -proxies http://192.168.1.1:8080, through
-proxies
http://192.168.1.2:8080 192.168.1.1 HTTP/SOCKS4
proxies
-oX nmap 192.168.1.1 -oX xml.file XML output to the file xml.file
https://www.stationx.net/nmap-cheat-sheet/ 9/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
-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
https://www.stationx.net/nmap-cheat-sheet/ 10/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
Email Address
DOWNLOAD
nmap -p80 -sV -oG - -open 192.168.1.1/24 | Scan for web servers and grep to show which
grep open IPs are running web servers
00:00
nmap -iR 10 -n -oX out.xml | grep "Nmap" | cut
00:00
Generate a list of the IPs of live hosts
1
-d " " -f5 > live-hosts.txt
ndiff scanl.xml scan2.xml Compare output from nmap using the ndif
https://www.stationx.net/nmap-cheat-sheet/ 11/18
7/3/23, 8:50 PM Nmap Cheat Sheet 2023: All the Commands, Flags & Switches
COMMAND DESCRIPTION
nmap 192.168.1.1-1/24 -PR -sn -vv Arp discovery only on local network, no port scan
You are only doing yourself a disservice by failing to learn and utilize all of Nmap’s
features. It 00:00
is the first go-to tool you will use in the scanning and00:00
many assessments, setting the foundation for the rest of your pentest.
enumeration
1 stage of
Keep a copy of this Nmap cheat sheet to refer back to, and consider our Complete Nmap
Ethical Hacking Course. It, and many other ethical hacking courses, are available in our
VIP Member’s Section.
https://www.stationx.net/nmap-cheat-sheet/ 12/18