Post

Nmap Cheat Sheet

A quick-access reference covering essential Nmap commands, scanning techniques, evasion tricks, and enumeration options for fast and effective network reconnaissance.

Nmap Cheat Sheet

What is NMAP?

Nmap is a network scanner created by Gordon Lyon. Nmap is used to discover hosts and services on a computer network by sending packets and analyzing the responses. Nmap provides a number of features for probing computer networks, including host discovery and service and operating system detection.

1
nmap -sC -sV -p -vvv IP -oX "filename.xml"

Convert the .xml file to .html.

1
2
apt install xsltproc
xsltproc filename.xml -o filename.html

Nmap Target Specification

Define the specific IPs, ranges, or subnets you want Nmap to examine during reconnaissance.

COMMANDDESCRIPTION
nmap $targetipScan a single IP
nmap 10.10.10.10 10.10.10.20Scan specific IPs
nmap 10.10.10.10-20Scan a range of IPs
nmap $domainScan a domain
nmap 10.10.10.0/24Scan using CIDR notation
nmap -iL $filenameScan a list of targets
nmap -iR 20Scan 20 random hosts
nmap -exclude $targetipExclude listed IP

Bypassing Filters

SWITCHDESCRIPTION
-fFragment packets
-g 80Spoof source port
-D RND:10Use random decoys
-sI $zombieip $targetipIdle (zombie) scan
-sAACK scan
--spoof-macSpoof MAC address

Saving Scans

SWITCHDESCRIPTION
-oXOutput in XML format
-oNNormal text output
-oGGreppable output
-oAOutput in all formats
-append-outputAppend to existing output

Scan Timming

SWITCHDESCRIPTION
-T0Paranoid (very slow, IDS evasion)
-T1Sneaky (slow, quiet)
-T2Polite (reduced speed)
-T3Normal (default timing)
-T4Aggressive (fast scan)
-T5Insane (very fast, noisy)

Service & Version Detection

SWITCHDESCRIPTION
-sVService/version detection
-sCRun default scripts
-AAggressive scan (OS, scripts, traceroute)
--scriptRun specific NSE scripts
-OOS detection

Resources

This post is licensed under CC BY 4.0 by the author.