Tools Hub/
Network Reconnaissance
4 SPECIALIST TOOLS
BEGINNER TIER
PACKET TELEMETRY
T1046Network Service DiscoveryNmap Network MapperBeginner

1. Mental Model & Architectural Core

CORE OPERATIONAL PURPOSE

Nmap (Network Mapper) is the industry-standard open-source network scanner used by every penetration tester, sysadmin, and auditor on the planet. It discovers hosts, open ports, running services, OS fingerprints, and application versions across any IP range from a single host to a /8 CIDR block.

MENTAL MODEL ANALOGY

Imagine you are a locksmith hired to audit a building. Nmap is your clipboard and flashlight you walk every door, knock on each one, listen to how it responds, and note down exactly what's behind each lock. Some doors answer immediately, some are locked and quiet, and some have security guards that lie to you. Nmap handles all three.

When to Deploy
  • Initial reconnaissance of a target host or network range
  • Service version discovery before exploit selection
  • Vulnerability scanning via NSE Lua scripts (--script vuln)
  • Firewall and IDS evasion using fragmented packets or decoys
  • Network topology mapping for internal pivoting
Real-World Scenarios
  • HTB machines: identify web server on port 80 and custom service on high port before searching for exploit
  • Corporate pentest: map entire /24 subnet to identify rogue services and shadow IT
  • Bug bounty: sweep acquired IP ranges for forgotten staging servers
  • Internal red team: map AD domain controller ports (88, 389, 445, 636, 3268) for attack surface
HOW IT WORKS PROTOCOL & MEMORY INTERNALS

Nmap operates at the TCP/IP layer. For a SYN scan (-sS), it sends a TCP SYN packet and waits for a response: SYN-ACK means the port is OPEN, RST means CLOSED, and no response (after retries) means FILTERED. This "half-open" scanning leaves no TCP session in application logs because the 3-way handshake is never completed. Service detection (-sV) sends protocol-specific probes to open ports and matches responses against a database of 11,000+ service fingerprints (nmap-service-probes). OS detection (-O) analyzes TCP/IP stack characteristics like TTL, window size, and don't-fragment bit patterns.

2. Syntax, Flags & Live Telemetry

Flags & Options Reference
16 OPTIONS
Flag / OptionDescription
-sSTCP SYN "stealth" scan half-open, fastest, leaves no connection logs
-sVService version detection probes open ports to identify software and version
-sCDefault NSE script scan runs common safe discovery scripts
-OOS fingerprinting infer operating system from TCP/IP stack behavior
-PnSkip host discovery ping treat all hosts as alive (bypasses ICMP filters)
-p-Scan all 65535 TCP ports (default is top 1000 only)
-p 80,443,8080Scan specific ports only
--script vulnRun all vulnerability detection NSE scripts against open ports
--script=http-titleRun a specific NSE script (e.g., grab HTTP page title)
-T4Aggressive timing template faster scan, more network noise
-T0Paranoid timing very slow scan, almost undetectable by IDS
--min-rate 5000Send at least 5000 packets per second (faster for CTF targets)
-fFragment packets into 8-byte chunks to evade packet inspection firewalls
-D RND:10Decoy scan send probes from 10 random spoofed IPs alongside real IP
-oN output.txtSave output in human-readable format
-oA allformatsSave output in all 3 formats: normal, XML, and grepable
Standard Pentest Scan (most common)
COMMAND
nmap -sS -sV -sC -Pn -p- --min-rate 5000 -oA full_scan 10.10.11.240
Standard Pentest Scan (most common)
LIVE EXEC
[*] Initiating SYN Stealth Scan at 12:34 against 10.10.11.240...
[*] Scanning 65535 ports at 5000 pkt/s
[*] 22/tcp OPEN ssh OpenSSH 9.3p1 Ubuntu
[*] 80/tcp OPEN http nginx/1.24.0
[*] 8080/tcp OPEN http Apache Tomcat/9.0.58
[✓] Nmap done: 3 hosts up. Scan time: 14.83s
NSE Vulnerability Scan
COMMAND
nmap -sV --script vuln -p 80,443,8080,8443 10.10.11.240
NSE Vulnerability Scan
LIVE EXEC
[!] http-vuln-cve2021-41773: VULNERABLE (Apache path traversal RCE)
[!] ssl-poodle: VULNERABLE (SSLv3 POODLE attack)
[+] http-title: 80/tcp - "Login | CorpApp v3.2"
[✓] Scripts complete. 2 vulnerabilities mapped.
Firewall Evasion with Decoys
COMMAND
nmap -sS -Pn -f -D RND:10 --data-length 25 -T2 -p 22,80,443 10.10.11.240
Firewall Evasion with Decoys
LIVE EXEC
[*] Generating 10 random decoy IP addresses...
[*] Sending fragmented probes with random padding...
[*] 22/tcp OPEN ssh | 80/tcp OPEN http | 443/tcp FILTERED
[✓] Scan designed to blend into background traffic noise.
FORENSIC ANALYSIS & OPERATOR INSIGHT

When port 8080 shows Apache Tomcat with a JMX Console endpoint, immediately test for unauthenticated JMX exposure this is a direct path to remote class loading and OS command execution. Always follow up an Nmap scan with targeted service-specific probes.

3. Hands-On Practice Labs & Cyber Ranges

Practice environments are curated from PortSwigger, OffSec, HackTheBox, and TryHackMe. Complete these labs to earn credentials and build verified hands-on skills.

4. Detection & Prevention Playbook

MITRE ATT&CK TACTICS
TA0043 ReconnaissanceTA0007 Discovery
HOW TO DETECT LOG SOURCES & TELEMETRY
Network IDS alertsFirewall connection logsNetFlow/IPFIX flow dataSuricata/Snort alerts
HOW TO PREVENT & MITIGATE
  • Deploy IDS/IPS with Snort/Suricata rules for SYN scan signatures
  • Implement port-knocking or single-packet authorization (SPA) on sensitive services
  • Rate-limit TCP SYN packets per source IP at the firewall edge
  • Enable network flow monitoring (NetFlow/IPFIX) for anomalous port sweep patterns