Network Security
Nmap Cheat Sheet
4 sections23 commands
Host Discovery
5 entriesCommand / syntaxDescription
nmap -sn <target>Ping scan (no port scan)nmap -Pn <target>Skip host discoverynmap -PS22,80,443 <target>TCP SYN ping on portsnmap -PA80 <target>TCP ACK pingnmap -PU53 <target>UDP ping
Scan Types
7 entriesCommand / syntaxDescription
nmap -sS <target>SYN scan (stealth)nmap -sT <target>TCP connect scannmap -sU <target>UDP scannmap -sA <target>ACK scan (firewall detection)nmap -sV <target>Version detectionnmap -O <target>OS detectionnmap -A <target>Aggressive (OS + version + scripts)
NSE Scripts
5 entriesCommand / syntaxDescription
nmap --script vuln <target>Run vulnerability scriptsnmap --script=http-enum <target>HTTP enumerationnmap --script=smb-vuln* <target>SMB vulnerability checknmap --script=dns-brute <target>DNS brute forcenmap --script=default <target>Run default scripts
Output & Timing
6 entriesCommand / syntaxDescription
nmap -oN output.txt <target>Normal outputnmap -oX output.xml <target>XML outputnmap -oG output.gnmap <target>Grepable outputnmap -T4 <target>Aggressive timingnmap -p- <target>All 65535 portsnmap -p 1-1000 <target>Port range