Enumeration is where pentests are won or lost. My playbook is a short, repeatable sequence of nmap scans ordered by cost vs. information. Run them in this order, save every output, and annotate as you go.
0. Set Up
mkdir -p scans && cd scans
HOST=target_ip
nmap ... > nmap_$(date +%s).txt 2>&1
[!TIP]
Never eyeball nmap output — grep it. grep -E "open|service|version" on a saved scan is faster than re-running anything.
1. The 100-Port Reconnaissance
nmap -sS -Pn -T4 --top-ports 100 $HOST
| Flag | Why |
|---|
-sS | SYN scan — fast, stealthy, reliable from a pentest box |
-Pn | Skip host discovery (firewalls love to eat ICMP/ping) |
-T4 | Aggressive but rarely triggers IDS |
--top-ports 100 | Cheap first pass; full sweep comes later |
Reading it: open ports are doors. 22 = SSH (brute-forceable? keys?), 80/443 = web (what's the stack?), 3306/5432 = database (exposed directly? that's a finding on its own).
2. The Full Port Sweep
nmap -sS -Pn -T4 -p- --min-rate 3000 $HOST
Full TCP range (1–65535). This finds the hidden gems: 2049 (NFS), 8080/8443 (alt web), 9200 (Elasticsearch), 27017 (Mongo). Most targets have 1–3 interesting ports that never show up in a top-100 scan.
3. Service Versioning
nmap -sV -sC -Pn -p <open_ports> $HOST
-sV — version probe: tells you what (nginx 1.24, OpenSSH 9.6, Apache Tomcat)
-sC — default NSE scripts: quick wins like default credentials and misconfigurations
Now every open port has a name and a version. Versions are CVEs waiting to be checked.
4. OS & Banner Details
nmap -O -sV --version-intensity 5 -p <open_ports> $HOST
nmap --script banner -p <open_ports> $HOST
-O (OS fingerprinting) only works well over TCP; it tells you if you're facing a Windows AD box (→ SMB, LDAP) or a Linux server (→ SUID, cron).
5. Targeted Script Sweeps
Only run these on the ports that matter:
nmap --script http-enum,http-title,http-headers -p 80,443 $HOST
nmap --script ssh2-enum-algos,ssh-hostkey -p 22 $HOST
nmap --script smb-enum-shares,smb-enum-users,smb-os-discovery -p 445 $HOST
nmap --script ssl-enum-ciphers,ssl-cert -p 443 $HOST
[!WARNING]
Scripts with -A or aggressive auth probes can lock accounts or trigger blocks. On live engagements, coordinate before brute-force-adjacent scripts.
6. The Aggressive All-in (When You Have Time)
nmap -A -Pn --top-ports 1000 $HOST -oA aggressive_$HOST
-A enables OS detection, version detection, script detection and traceroute. -oA writes XML, normal, and grepable output simultaneously. This is the scan I attach to every report's methodology section.
Reading the Output: What Actually Matters
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9 (protocol 2.0) ← version → check CVEs
80/tcp open http nginx 1.24.0 ← stack → web recon
443/tcp open ssl/http nginx 1.24.0 ← TLS details
2049/tcp open nfs nfsd 2-3 (root? export list) ← hidden gem
My mental loop per port:
- Service + version → known CVEs?
- Default configs? (admin panels, null sessions, anonymous access)
- Credentials → brute-force candidates, shared accounts
- Data → banners that leak internal hostnames, usernames
My Cheat Sheet (Condensed)
nmap -sS -Pn -T4 --top-ports 100 $H
nmap -sS -Pn -p- --min-rate 3000 $H
nmap -sV -sC -Pn -p 22,80,443,2049 $H
nmap -A -Pn --top-ports 1000 $H -oA report
Enumeration is not a one-shot. Every new piece of information — a username from a web page, an internal hostname from a banner — comes back around as a new scan target. Enumeration is a loop, not a line.
Discussion (0)
Sign in or create an account to join the discussion.
No comments yet. Start the discussion.