🛡️ Methodology Checklist

  • Run default scripts: nmap -sC [TARGET]
  • Run script category: nmap --script [auth|vuln|exploit|brute] [TARGET]
  • Run specific script: nmap --script [SCRIPT_NAME] [TARGET]
  • Pass script arguments: nmap --script [SCRIPT] --script-args [KEY=VAL] [TARGET]
  • Search for relevant scripts: ls /usr/share/nmap/scripts/ | grep [KEYWORD]
  • Run vuln scripts on service-specific ports after version detection

🎯 Operational Context

Think Dumber First: Run -sC (default scripts) with every version scan — they’re safe and reveal massive amounts of context. The vuln category is often avoided but runs fast on targeted ports. The smb-vuln-ms17-010 script is your first check on any Windows SMB host. Always run --script-updatedb if scripts error out.

When you land here: Services identified. Run service-specific NSE scripts on confirmed open ports. For AD targets: smb-vuln-ms17-010, smb-enum-shares, ldap-rootdse. For web: http-headers, http-title, http-methods. For databases: ms-sql-info, mysql-info.


⚡ Tactical Cheatsheet

CommandTactical Outcome
sudo nmap [TARGET_IP] -sCRun default NSE script category (safe, informative)
sudo nmap [TARGET_IP] -p [PORT] --script banner,smtp-commandsRun specific named scripts
sudo nmap [TARGET_IP] --script vulnRun all vulnerability-category scripts (maps versions to CVEs)
sudo nmap [TARGET_IP] -AAggressive: OS detection + version + default scripts + traceroute
sudo nmap --script-updatedbUpdate NSE script database

🔬 Deep Dive & Workflow

NSE Script Categories

CategoryDescriptionRisk Level
authBrute-force or bypass authenticationMedium
broadcastLocal network discovery via broadcastLow
bruteCredential brute-forcingMedium
default (-sC)Safe & useful — standard first passLow
discoveryAdvanced enumeration (SNMP, registries)Low
dosDenial of ServiceHigh — may crash target
exploitActive exploitationHigh — may gain shell or crash
externalQueries external DBs (Whois)Low
fuzzerSends random data to find bugsMedium
intrusiveAggressive/noisy — will trigger IDSHigh
malwareDetects backdoorsLow
safeNon-intrusive — won’t crash servicesLow
versionAdvanced version detection (extends -sV)Low
vulnChecks for known CVEsMedium

Aggressive Scan (-A)

Combines: OS Detection (-O) + Version Detection (-sV) + Script Scanning (-sC) + Traceroute. Very noisy — easily detected by IDS.

vuln Category

Includes the vulners script — matches detected software versions against CVSS scores and exploit databases. Excellent for quick VA sweeps.


🛠️ Troubleshooting & Edge Cases

ProblemCauseFix
Script returns ‘ERROR: Failed to load [script]‘Missing NSE library or outdated script databaseRun sudo nmap --script-updatedb; confirm script exists: ls /usr/share/nmap/scripts/ | grep [NAME]
--script vuln returns false positives (vulnerable when patched)Script checks version strings, not actual exploitationCross-validate with searchsploit [SERVICE] [VERSION]; manually test before reporting
Script hangs indefinitelyHitting blocked port or network timeoutAdd --script-timeout 30s to all script scans; scripts with no timeout default to nmap’s overall timeout
smb-vuln-ms17-010 shows ‘Host does NOT appear vulnerable’ on known-vulnerable targetScript uses crafted SMB packets that may fail through NATTest with MSF auxiliary/scanner/smb/smb_ms17_010 which has more robust detection
Script requires credentials but argument not passedForgot --script-argsFormat: nmap --script smb-brute --script-args userdb=/path/users.txt,passdb=/path/pass.txt [TARGET]

📝 Reporting Trigger

Finding Title: (NSE scripts surface specific vulnerabilities — each script hit is a potential finding. Document: script name, target port, raw script output, and CVE reference. Validate all vuln script results manually before including in report.)