Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Professional network reconnaissance and port scanning using nmap. Supports various scan types (quick, full, UDP, stealth), service detection, vulnerability scanning, and NSE scripts. Use when you need to enumerate network services, detect versions, or perform network reconnaissance.
.claude/skills/aiskillstore-nmap/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-19 | ✗→✓ | ▲ Improved | 376% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 568% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 373% | 0% |
| case-01 | ✓→✗ | ▼ Worse | 344% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 267% | 0% |
You are helping the user perform professional network reconnaissance and port scanning using nmap. This skill provides guidance for various scan types, output formats, and result analysis.
bashnmap-output/ ├── nmap-portscan.nmap # Initial fast port discovery ├── nmap-portscan.xml ├── nmap-portscan.gnmap ├── nmap-services.nmap # Detailed service detection on open ports ├── nmap-services.xml └── nmap-services.gnmap
IMPORTANT: Always save nmap output to an organized directory structure. By default, use ./nmap-output/ or specify a custom directory.
IMPORTANT: Unless the user explicitly requests a different scan type, ALWAYS use this two-phase approach:
bashsudo nmap -p- <target> -oA <output-dir>/nmap-portscan
Host Down Detection: If the scan output contains "Note: Host seems down", automatically retry with:
bashsudo nmap -p- -Pn <target> -oA <output-dir>/nmap-portscan
-Pn: Skip host discovery, treat host as onlineAfter Phase 1 completes, parse the open ports and run:
bashnmap -p <OPEN_PORT_LIST> -sV -sC <target> -oA <output-dir>/nmap-services
-p <OPEN_PORT_LIST>: Only scan the ports found to be open (e.g., -p 23,80,443,554,8000)-sV: Service version detection-sC: Run default NSE scripts for additional enumerationAfter Phase 1, extract open ports using:
bash# Extract open ports from .gnmap file grep "Ports:" <output-dir>/nmap-portscan.gnmap | sed 's/.*Ports: //' | tr ',' '\n' | grep '/open/' | cut -d'/' -f1 | tr -d ' ' | tr '\n' ',' | sed 's/,$//'
Or parse from .nmap file (matches the STATE column exactly, so open|filtered ports are excluded):
bashawk '$2=="open"{split($1,p,"/"); ports=ports sep p[1]; sep=","} END{print ports}' <output-dir>/nmap-portscan.nmap
When the nmap-scan skill is invoked:
bash OUTPUT_DIR="./nmap-output" mkdir -p "$OUTPUT_DIR"
bash sudo nmap -p- <target> -oA "$OUTPUT_DIR/nmap-portscan"
bash if grep -q "Host seems down" "$OUTPUT_DIR/nmap-portscan.nmap"; then echo "Host appears down, retrying with -Pn flag..." sudo nmap -p- -Pn <target> -oA "$OUTPUT_DIR/nmap-portscan" fi
bash OPEN_PORTS=$(awk '$2=="open"{split($1,p,"/"); ports=ports sep p[1]; sep=","} END{print ports}' "$OUTPUT_DIR/nmap-portscan.nmap")
bash if [ -n "$OPEN_PORTS" ]; then nmap -p "$OPEN_PORTS" -sV -sC <target> -oA "$OUTPUT_DIR/nmap-services" else echo "No open ports found, skipping service detection." fi
bash echo "Scan complete. Results saved to: $OUTPUT_DIR"
Use for initial reconnaissance, when time is limited, or only when the user explicitly requests a quick/fast scan instead of the default two-phase strategy:
bashnmap -sV -sC <target> -oA <output-prefix>
-sV: Service version detection-sC: Run default NSE scripts-oA: Output in all formats (normal, XML, grepable)Use for thorough assessment when all ports must be checked:
bashnmap -sV -sC -p- <target> -oA <output-prefix>
-p-: Scan all 65535 portsUse when trying to avoid detection (requires root/sudo):
bashsudo nmap -sS -sV -sC <target> -oA <output-prefix>
-sS: SYN stealth scan (doesn't complete TCP handshake)Use when UDP services need to be enumerated:
bashsudo nmap -sU --top-ports 100 <target> -oA <output-prefix>
-sU: UDP scan--top-ports 100: Scan top 100 UDP ports (UDP scanning is slow)Use for maximum information gathering (noisy):
bashnmap -A -T4 <target> -oA <output-prefix>
-A: Enable OS detection, version detection, script scanning, traceroute-T4: Aggressive timing template (faster but more detectable)Use to check for known vulnerabilities:
bashnmap -sV --script vuln <target> -oA <output-prefix>
--script vuln: Run NSE vulnerability detection scriptsUse to identify operating system:
bashsudo nmap -O <target> -oA <output-prefix>
-O: Enable OS detectionRun Phase 1 (port discovery) and Phase 2 (service detection) per the Default Scanning Strategy and Implementation Workflow sections above. Then analyze:
Phase 3: Analysis
Based on service detection results, run specialized scans:
If web services found (80, 443, 8080, etc.):
bashnmap -p 80,443,8080,8443 --script http-* <target> -oA <output-dir>/nmap-web
If SSH found:
bashnmap -p 22 --script ssh-* <target> -oA <output-dir>/nmap-ssh
If RTSP found (554):
bashnmap -p 554 --script rtsp-* <target> -oA <output-dir>/nmap-rtsp
If ONVIF/camera suspected:
bashnmap -p 80,554,8000,8080 --script http-methods,http-headers <target> -oA <output-dir>/nmap-onvif
Always use -oA <prefix> to generate all three formats:
.nmap - Normal human-readable format.xml - XML format for parsing/importing into tools.gnmap - Grepable format for command-line processingUse -T<0-5> to control scan speed:
-T0 (Paranoid): Extremely slow, for IDS evasion-T1 (Sneaky): Very slow, for IDS evasion-T2 (Polite): Slow, less bandwidth intensive-T3 (Normal): Default, balanced speed-T4 (Aggressive): Fast, recommended for modern networks-T5 (Insane): Very fast, may miss resultsDefault: Use -T3 or omit (default is T3) Fast scans: Use -T4 when speed is important and network can handle it Stealth: Use -T1 or -T2 for evasion
bashnmap <ip-address>
bashnmap 192.168.1.0/24
bashnmap 192.168.1.1-254
bashnmap 192.168.1.1 192.168.1.10 192.168.1.100
bashnmap 192.168.1.0/24 --exclude 192.168.1.1,192.168.1.254
bash# Authentication scripts nmap --script auth <target> # Brute force scripts nmap --script brute <target> # Default safe scripts nmap -sC <target> # equivalent to --script default # Discovery scripts nmap --script discovery <target> # Vulnerability scripts nmap --script vuln <target> # All HTTP scripts nmap --script "http-*" <target>
bash# RTSP enumeration nmap -p 554 --script rtsp-methods,rtsp-url-brute <target> # UPnP discovery nmap -p 1900 --script upnp-info <target> # MQTT discovery nmap -p 1883,8883 --script mqtt-subscribe <target> # Modbus enumeration nmap -p 502 --script modbus-discover <target>
Extract open ports:
bashgrep "^[0-9]" nmap-output.nmap | grep "open"
Extract service versions:
bashgrep -E "^[0-9]+/tcp.*open" nmap-output.nmap
Check for vulnerabilities in NSE output:
bashgrep -i "vuln\|cve\|exploit" nmap-output.nmap
When scanning IoT devices, pay special attention to:
| Port | Service | Description | |------|---------|-------------| | 21 | FTP | File transfer (often misconfigured) | | 22 | SSH | Remote administration | | 23 | Telnet | Insecure remote access | | 80 | HTTP | Web interface | | 443 | HTTPS | Secure web interface | | 554 | RTSP | Video streaming | | 1883 | MQTT | IoT messaging protocol | | 3702 | WS-Discovery | ONVIF device discovery | | 5000 | UPnP | Universal Plug and Play | | 8000 | HTTP Alt | Alternative HTTP port | | 8080 | HTTP Proxy | Alternative HTTP port | | 8883 | MQTT/TLS | Secure MQTT |
Never run nmap without saving output:
bash# GOOD nmap -p <ports> -sV -sC <target> -oA output/nmap-services # BAD nmap -sV -sC <target>
Use the default two-phase strategy (see the Default Scanning Strategy section) unless the user explicitly requests a different scan type.
Match timing to your needs:
bash# Pentest with authorization: Fast nmap -sV -sC -T4 <target> # Red team/stealth: Slow nmap -sV -sC -T2 <target>
Always document:
Always save to an organized output directory (default ./nmap-output/). See the Implementation Workflow section for the full command sequence.
-T4 for faster scanning-p 1-1000 instead of -p---top-ports 100 instead of all ports-sS, -sT, -sA-Pn to skip host discovery-f for fragmented packets--source-port 53 or other trusted portsThese scan types require root:
-sS (SYN scan)-sU (UDP scan)-O (OS detection)If you see "Permission denied" or "Operation not permitted":
bash# Run with sudo sudo nmap <options> <target>
bashTARGET="192.168.1.100" OUTPUT_DIR="./nmap-output" mkdir -p "$OUTPUT_DIR" # Phase 1: Fast port discovery sudo nmap -p- $TARGET -oA "$OUTPUT_DIR/nmap-portscan" # Check for "Host seems down" if grep -q "Host seems down" "$OUTPUT_DIR/nmap-portscan.nmap"; then sudo nmap -p- -Pn $TARGET -oA "$OUTPUT_DIR/nmap-portscan" fi # Parse open ports OPEN_PORTS=$(awk '$2=="open"{split($1,p,"/"); ports=ports sep p[1]; sep=","} END{print ports}' "$OUTPUT_DIR/nmap-portscan.nmap") # Phase 2: Service detection if [ -n "$OPEN_PORTS" ]; then nmap -p "$OPEN_PORTS" -sV -sC $TARGET -oA "$OUTPUT_DIR/nmap-services" fi
Run the default two-phase scan from Workflow 1, then add camera-specific checks:
bashTARGET="192.168.1.100" OUTPUT_DIR="./nmap-output" # If ONVIF camera detected, check HTTP methods nmap -p 80 --script http-methods $TARGET -oA "$OUTPUT_DIR/nmap-http" # Check RTSP service nmap -p 554 --script rtsp-methods $TARGET -oA "$OUTPUT_DIR/nmap-rtsp"
bashOUTPUT_DIR="./nmap-output" # After completing default two-phase scan, optionally add: # UDP scan (top ports) sudo nmap -sU --top-ports 100 <target> -oA "$OUTPUT_DIR/nmap-udp" # OS detection sudo nmap -O <target> -oA "$OUTPUT_DIR/nmap-os" # Vulnerability scan nmap -sV --script vuln <target> -oA "$OUTPUT_DIR/nmap-vuln"
Before starting scans, clarify:
Note: Output is saved to ./nmap-output/ by default.
A successful nmap scan includes:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→fail | 15,542 | 31,363 | +102% | 1 | 1 | 0% | 1,733 | 7,688 | +344% | 0 | 0 | — |
case-02 | fail→fail | 14,291 | 21,332 | +49% | 1 | 1 | 0% | 1,161 | 6,051 | +421% | 0 | 0 | — |
case-03 | fail→fail | 15,685 | 18,307 | +17% | 1 | 1 | 0% | 1,809 | 5,013 | +177% | 0 | 0 | — |
case-04 | pass→pass | 10,604 | 16,514 | +56% | 1 | 1 | 0% | 673 | 5,364 | +697% | 0 | 0 | — |
case-19 | fail→pass | 7,286 | 4,748 | -35% | 1 | 1 | 0% | 1,156 | 5,500 | +376% | 0 | 0 | — |
case-05 | pass→pass | 12,215 | 20,049 | +64% | 1 | 1 | 0% | 2,039 | 5,909 | +190% | 0 | 0 | — |
case-06 | fail→pass | 5,015 | 4,670 | -7% | 1 | 1 | 0% | 824 | 5,507 | +568% | 0 | 0 | — |
case-07 | pass→pass | 14,252 | 8,635 | -39% | 1 | 1 | 0% | 2,051 | 5,643 | +175% | 0 | 0 | — |
case-08 | pass→pass | 9,887 | 5,807 | -41% | 1 | 1 | 0% | 718 | 5,613 | +682% | 0 | 0 | — |
case-09 | fail→fail | 13,403 | 14,985 | +12% | 1 | 1 | 0% | 1,259 | 6,015 | +378% | 0 | 0 | — |
case-10 | pass→pass | 3,956 | 5,157 | +30% | 1 | 1 | 0% | 510 | 5,390 | +957% | 0 | 0 | — |
case-11 | pass→pass | 14,683 | 11,300 | -23% | 1 | 1 | 0% | 1,700 | 5,795 | +241% | 0 | 0 | — |
case-12 | fail→pass | 12,151 | 15,798 | +30% | 1 | 1 | 0% | 1,142 | 5,405 | +373% | 0 | 0 | — |
case-13 | pass→pass | 7,144 | 12,931 | +81% | 1 | 1 | 0% | 1,256 | 6,039 | +381% | 0 | 0 | — |
case-14 | pass→pass | 9,480 | 7,493 | -21% | 1 | 1 | 0% | 1,581 | 5,747 | +264% | 0 | 0 | — |
case-15 | pass→pass | 10,575 | 10,609 | +0% | 1 | 1 | 0% | 1,012 | 5,698 | +463% | 0 | 0 | — |
case-16 | pass→pass | 15,494 | 10,947 | -29% | 1 | 1 | 0% | 1,375 | 5,716 | +316% | 0 | 0 | — |
case-17 | pass→pass | 11,943 | 13,644 | +14% | 1 | 1 | 0% | 1,262 | 6,033 | +378% | 0 | 0 | — |
case-18 | pass→pass | 11,432 | 4,077 | -64% | 1 | 1 | 0% | 1,157 | 5,316 | +359% | 0 | 0 | — |
case-20 | pass→fail | 8,599 | 8,024 | -7% | 1 | 1 | 0% | 1,659 | 6,093 | +267% | 0 | 0 | — |
case-21 | pass→pass | 6,916 | 10,220 | +48% | 1 | 1 | 0% | 1,331 | 5,505 | +314% | 0 | 0 | — |
case-22 | pass→pass | 8,295 | 11,635 | +40% | 1 | 1 | 0% | 1,529 | 5,794 | +279% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +5 percentage points is the difference between those two pass rates over the 21 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.