Nmap cheat sheet

Cover Image for Nmap cheat sheet
CRUSVEDER

3 min read

Nmap Commands Cheat Sheet. Quick reference for common commands. Perfect reference guide.

Scanning Options are as follows:

OptionWhat It DoesExample Command
10.10.10.0/24Specifies the target network range.nmap 10.10.10.0/24
-snSkips port scanning.nmap -sn 10.10.10.0/24
-PnDisables ICMP Echo Requests (no ping).nmap -Pn 10.10.10.0/24
-nAvoids DNS resolution.nmap -n 10.10.10.0/24
-PEPing scan using ICMP Echo Requests.nmap -PE 10.10.10.0/24
--packet-traceShows detailed packet sending/receiving logs.nmap --packet-trace 10.10.10.0/24
--reasonDisplays the reason for a result.nmap --reason 10.10.10.0/24
--disable-arp-pingDisables ARP Ping.nmap --disable-arp-ping 10.10.10.0/24
--top-ports=<num>Scans the most common ports.nmap --top-ports=100 10.10.10.0/24
-p-Scans all ports.nmap -p- 10.10.10.0/24
-p22-110Scans ports between 22 and 110.nmap -p22-110 10.10.10.0/24
-p22,25Scans only ports 22 and 25.nmap -p22,25 10.10.10.0/24
-FScans top 100 most common ports.nmap -F 10.10.10.0/24
-sSPerforms a TCP SYN scan.nmap -sS 10.10.10.0/24
-sAConducts a TCP ACK scan.nmap -sA 10.10.10.0/24
-sURuns a UDP scan.nmap -sU 10.10.10.0/24
-sVScans service versions.nmap -sV 10.10.10.0/24
-sCUses default scripts for scanning.nmap -sC 10.10.10.0/24
--script <script>Runs specified scripts during the scan.nmap --script http-title 10.10.10.0/24
-OIdentifies the target’s operating system.nmap -O 10.10.10.0/24
-AOS, service, and traceroute detection.nmap -A 10.10.10.0/24
-D RND:5Uses 5 random decoys for the scan.nmap -D RND:5 10.10.10.0/24
-eSpecifies the network interface for scanning.nmap -e eth0 10.10.10.0/24
-S 10.10.10.200Sets the source IP address.nmap -S 10.10.10.200 10.10.10.0/24
-gSpecifies the source port.nmap -g 80 10.10.10.0/24
--dns-server <ns>Uses a custom DNS server for resolution.nmap --dns-server 8.8.8.8 10.10.10.0/24

Output Options

OptionWhat It DoesExample Command
-oA filenameSaves results in all formats under the given filename.nmap -oA scan_results 10.10.10.0/24
-oN filenameSaves results in a normal text format.nmap -oN scan.txt 10.10.10.0/24
-oG filenameSaves results in a grepable format.nmap -oG scan.grep 10.10.10.0/24
-oX filenameSaves results in XML format.nmap -oX scan.xml 10.10.10.0/24

Performance Options

OptionWhat It DoesExample Command
--max-retries <num>Sets the number of retries for failed scans.nmap --max-retries 3 10.10.10.0/24
--stats-every=5sDisplays scan progress every 5 seconds.nmap --stats-every=5s 10.10.10.0/24
-v/-vvIncreases verbosity during the scan.nmap -vv 10.10.10.0/24
--initial-rtt-timeout 50msSets the initial round-trip timeout value.nmap --initial-rtt-timeout 50ms 10.10.10.0/24
--max-rtt-timeout 100msSets the maximum round-trip timeout value.nmap --max-rtt-timeout 100ms 10.10.10.0/24
--min-rate 300Sets the rate of packets sent per second.nmap --min-rate 300 10.10.10.0/24
-T <0-5>Chooses the scan timing template (0 = slowest, 5 = fastest).nmap -T4 10.10.10.0/24

Script Categories

CategoryWhat It DoesExample Command
authTests for authentication weaknesses.nmap --script auth 10.10.10.0/24
broadcastDiscovers hosts via broadcasting.nmap --script broadcast 10.10.10.0/24
bruteBrute-forces logins with common credentials.nmap --script brute 10.10.10.0/24
defaultRuns default scripts with the -sC option.nmap -sC 10.10.10.0/24
discoveryIdentifies available services.nmap --script discovery 10.10.10.0/24
dosTests for Denial of Service vulnerabilities (risky).nmap --script dos 10.10.10.0/24
exploitAttempts to exploit known vulnerabilities.nmap --script exploit 10.10.10.0/24
externalUses external services for data processing.nmap --script external 10.10.10.0/24
fuzzerIdentifies vulnerabilities by sending malformed packets.nmap --script fuzzer 10.10.10.0/24
intrusivePerforms potentially damaging tests.nmap --script intrusive 10.10.10.0/24
malwareScans for signs of malware infections.nmap --script malware 10.10.10.0/24
safeSafe, non-intrusive defensive scans.nmap --script safe 10.10.10.0/24
versionDetects service versions.nmap --script version 10.10.10.0/24
vulnScans for specific vulnerabilities.nmap --script vuln 10.10.10.0/24