Macksofy Technologies
Network reconnaissance

Nmap Cheatsheet — The 2026 Pentester's Reference

Every Nmap flag you actually use on engagements: scan types, NSE scripts, timing templates, evasion, output formats. The reference our consultants keep open during scans.

Nmap Network Cheatsheet Recon
Macksofy Network Team· Network and infrastructure security22 March 2026 11 min read
$ nmap -sS -sV -p-10.10.0.0/24PORT STATE SERVICE22 open ssh80 open http445 open smb10.10.0.0/24:22:3389:445:443:80:22:3389:445
NET

Nmap is 27 years old and still the network scanner every penetration tester opens first. Most testers use 5% of its capability and miss the rest. This cheatsheet covers the flags we actually use across BFSI and government engagements — grouped by what you're trying to accomplish.

-sS SYNSYN → no ACK backhalf-open · stealthy-sT ConnectFull TCP handshakeOS-level connect()-sU UDPUDP packetICMP unreachable = closed-sV VersionBanner grab + service fingerprinting
How TCP scan types differ at the packet level

Discovery — what's alive

Host discovery
bash
# ICMP + TCP SYN to 80, 443, 22, plus ARP if local
nmap -sn 10.0.0.0/24

# No ping, scan-as-if-up (good through firewalls)
nmap -Pn -p- 10.0.0.0/24

# DNS-only (passive-ish)
nmap -sL 10.0.0.0/24

Port scans you'll actually use

Top 10 commands
bash
# Fast SYN scan, top 1000 ports
sudo nmap -sS -T4 <target>

# All TCP ports, version detection, default scripts, OS guess
sudo nmap -sS -sV -sC -O -p- -T4 <target>

# UDP scan (slow but mandatory)
sudo nmap -sU --top-ports 100 -T4 <target>

# Both TCP and UDP in one go
sudo nmap -sS -sU -p T:1-65535,U:53,67,68,123,161,500 <target>

# Service version + script scan against a single port
sudo nmap -sV -sC -p 443 <target>

# Aggressive (do not use against production without approval)
sudo nmap -A -T4 <target>

# IPv6
sudo nmap -6 -sS -p- <target>

# From a list of targets
sudo nmap -iL targets.txt -oA outputs/scan-2026-04

Timing templates demystified

TemplateSpeedWhen to use
-T0 (paranoid)Days per hostIDS evasion in active red team
-T1 (sneaky)Hours per hostSame — slightly faster
-T2 (polite)SlowProduction where stability matters
-T3 (default)NormalMost engagements
-T4 (aggressive)FastAuthorized internal scanning
-T5 (insane)Very fastCTFs, lab environments only

NSE — the scripts that find vulnerabilities

Useful NSE invocations
bash
# Default safe scripts
nmap -sC <target>

# Vulnerability scripts (loud, run with care)
nmap --script vuln <target>

# Specific script
nmap --script smb-vuln-ms17-010 -p 445 <target>

# All HTTP-related scripts on 80/443
nmap --script "http-*" -p 80,443 <target>

# Update local NSE database
sudo nmap --script-updatedb
ScriptFinds
smb-os-discoveryOS via SMB negotiation
smb-enum-sharesOpen SMB shares
smb-vuln-ms17-010EternalBlue / WannaCry
smb2-security-modeSMB signing status
ssl-enum-ciphersWeak TLS ciphers
ssl-certCert details, expiry, SANs
http-title / http-headersWeb banner enum
http-enumCommon paths (admin, .git, backup)
dns-zone-transferAXFR test
snmp-infoSNMP banner / strings

NSE scripts our consultants run on every engagement

Output — feed your other tools

Output formats
bash
# All formats at once with the same prefix
nmap -sS -p- -oA prefix <target>
# Produces prefix.nmap (text), prefix.gnmap (greppable), prefix.xml

# Greppable extraction (open ports per host)
grep "open" prefix.gnmap | awk '{print $2}'

# Convert XML to HTML
xsltproc prefix.xml -o prefix.html

Stealth and evasion

Slow it down, look weirder
bash
# Decoys (your IP is one of many)
nmap -D RND:10 -sS <target>

# Source port (some firewalls trust 53)
nmap --source-port 53 -sS <target>

# Fragment packets
nmap -f -sS <target>

# Random target order
nmap --randomize-hosts -iL targets.txt

Common errors and fixes

ErrorFix
dnet: Failed to open deviceRun with sudo
No targets specifiedYou forgot the target argument
Host seems downAdd -Pn
UDP scan returns all open|filteredAdd -sV to disambiguate
Scan times outDrop -T4 to -T3 or split scope
RTTVAR has grown to over 2.3 secondsHigh-latency target — increase timeouts
Train with Macksofy

Our network pentest engagements is one of several hands-on tracks Macksofy delivers across India and the UAE. CERT-In empanelled, OffSec/EC-Council authorized, with weekend cohorts and corporate batches.

View training catalog
FAQ

Quick answers.

Nmap handles discovery and basic vuln checks. You still need Nessus / OpenVAS / custom scripts for full vulnerability coverage, and Metasploit / impacket / custom tools for exploitation.
Talk to us

Get a fixed-price proposal in 48 hours.

Tell us about your security need — pentest, audit, training or a wider engagement. A senior consultant will reply within a few business hours.

CERT-In Empanelled
Information Security Auditor · India
  • CERT-In Empanelled
  • EC-Council ATC · CompTIA Authorized
  • 20,000+ professionals trained
  • India + UAE engagements
Human verification· Cloudflare Turnstile

By submitting this form you agree to be contacted by Macksofy. We typically respond within a few business hours and never share your details. Protected by Cloudflare Turnstile and rate limiting.