0
0
Source

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.

Install

mkdir -p .claude/skills/nmap && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7880" && unzip -o skill.zip -d .claude/skills/nmap && rm skill.zip

Installs to .claude/skills/nmap

About this skill

Nmap Scan - Professional Network Reconnaissance

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.

Output Directory

Directory Structure

nmap-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.

Default Scanning Strategy

IMPORTANT: Unless the user explicitly requests a different scan type, ALWAYS use this two-phase approach:

Phase 1: Fast Port Discovery (Root SYN Scan)

sudo nmap -p- <target> -oA <output-dir>/nmap-portscan
  • Why sudo: Running as root enables fast SYN scan (-sS is implicit)
  • Why -p-: Scans all 65535 ports quickly
  • Duration: Typically 1-3 minutes for SYN scan
  • Output: List of all open ports

Host Down Detection: If the scan output contains "Note: Host seems down", automatically retry with:

sudo nmap -p- -Pn <target> -oA <output-dir>/nmap-portscan
  • -Pn: Skip host discovery, treat host as online
  • Use this when firewalls block ping probes

Phase 2: Targeted Service Detection

After Phase 1 completes, parse the open ports and run:

nmap -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 enumeration
  • Duration: Usually 1-3 minutes since only scanning known open ports

Why This Strategy?

  1. Speed: Fast SYN scan finds all open ports in 1-3 minutes
  2. Thoroughness: Covers all 65535 ports, not just top 1000
  3. Efficiency: Service detection only runs on confirmed open ports
  4. Accuracy: Two-phase approach reduces false negatives

Parsing Open Ports

After Phase 1, extract open ports using:

# Extract open ports from .gnmap file
grep "Ports:" <output-dir>/nmap-portscan.gnmap | sed 's/.*Ports: //g' | sed 's|/|\n|g' | grep "open" | cut -d'/' -f1 | tr '\n' ',' | sed 's/,$//'

Or parse from .nmap file:

grep "^[0-9]" <output-dir>/nmap-portscan.nmap | grep "open" | cut -d'/' -f1 | tr '\n' ',' | sed 's/,$//'

Implementation Workflow

When the nmap-scan skill is invoked:

  1. Create output directory

    OUTPUT_DIR="./nmap-output"
    mkdir -p "$OUTPUT_DIR"
    
  2. Run Phase 1: Fast port discovery

    sudo nmap -p- <target> -oA "$OUTPUT_DIR/nmap-portscan"
    
  3. Check for "Host seems down" error

    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
    
  4. Parse open ports from results

    OPEN_PORTS=$(grep "^[0-9]" "$OUTPUT_DIR/nmap-portscan.nmap" | grep "open" | cut -d'/' -f1 | tr '\n' ',' | sed 's/,$//')
    
  5. Run Phase 2: Service detection on open ports

    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
    
  6. Report results location

    echo "Scan complete. Results saved to: $OUTPUT_DIR"
    

Scan Types

Quick Scan (Top 1000 Ports)

Use for initial reconnaissance or when time is limited:

nmap -sV -sC <target> -oA <output-prefix>
  • -sV: Service version detection
  • -sC: Run default NSE scripts
  • -oA: Output in all formats (normal, XML, grepable)
  • Scans top 1000 most common ports
  • Typical duration: 1-3 minutes

Comprehensive Scan (All Ports)

Use for thorough assessment when all ports must be checked:

nmap -sV -sC -p- <target> -oA <output-prefix>
  • -p-: Scan all 65535 ports
  • Significantly longer duration (5-30+ minutes depending on target)
  • Use only when comprehensive coverage is required

Stealth SYN Scan

Use when trying to avoid detection (requires root/sudo):

sudo nmap -sS -sV -sC <target> -oA <output-prefix>
  • -sS: SYN stealth scan (doesn't complete TCP handshake)
  • Less likely to be logged by target
  • Requires root privileges

UDP Scan

Use when UDP services need to be enumerated:

sudo nmap -sU --top-ports 100 <target> -oA <output-prefix>
  • -sU: UDP scan
  • --top-ports 100: Scan top 100 UDP ports (UDP scanning is slow)
  • Common UDP services: DNS (53), SNMP (161), DHCP (67/68)
  • Very slow - use top-ports to limit scope

Aggressive Scan

Use for maximum information gathering (noisy):

nmap -A -T4 <target> -oA <output-prefix>
  • -A: Enable OS detection, version detection, script scanning, traceroute
  • -T4: Aggressive timing template (faster but more detectable)
  • Very noisy - will be detected by IDS/IPS
  • Use only with authorization

Vulnerability Scan

Use to check for known vulnerabilities:

nmap -sV --script vuln <target> -oA <output-prefix>
  • --script vuln: Run NSE vulnerability detection scripts
  • Checks for common CVEs and misconfigurations
  • Can be noisy and trigger alerts

OS Detection

Use to identify operating system:

sudo nmap -O <target> -oA <output-prefix>
  • -O: Enable OS detection
  • Requires root privileges
  • Uses TCP/IP stack fingerprinting

Alternative Scan Types

The following scan types are available if the user explicitly requests them instead of the default two-phase strategy:

Quick Scan (Top 1000 Ports Only)

Use ONLY if user explicitly requests a quick/fast scan:

nmap -sV -sC <target> -oA <output-dir>/nmap-quick
  • -sV: Service version detection
  • -sC: Run default NSE scripts
  • -oA: Output in all formats (normal, XML, grepable)
  • Scans top 1000 most common ports ONLY
  • Typical duration: 1-3 minutes
  • Limitation: May miss services on non-standard ports

Scan Workflow

Default Workflow (Two-Phase Strategy)

Phase 1: Port Discovery

  1. Run fast SYN scan: sudo nmap -p- <target> -oA <output-dir>/nmap-portscan
  2. Check for "Host seems down" and retry with -Pn if needed
  3. Wait for scan to complete (typically 1-3 minutes)

Phase 2: Service Detection 4. Parse open ports from Phase 1 results 5. Run targeted service detection: nmap -p <OPEN_PORTS> -sV -sC <target> -oA <output-dir>/nmap-services 6. Wait for scan to complete (typically 1-3 minutes)

Phase 3: Analysis 7. Review the service detection results to determine:

  • What services are running?
  • What versions are detected?
  • Are there any interesting services (web, SSH, database, IoT protocols)?
  • Do NSE scripts reveal any issues?

Additional Targeted Scans (Optional)

Based on service detection results, run specialized scans:

If web services found (80, 443, 8080, etc.):

nmap -p 80,443,8080,8443 --script http-* <target> -oA <output-dir>/nmap-web

If SSH found:

nmap -p 22 --script ssh-* <target> -oA <output-dir>/nmap-ssh

If RTSP found (554):

nmap -p 554 --script rtsp-* <target> -oA <output-dir>/nmap-rtsp

If ONVIF/camera suspected:

nmap -p 80,554,8000,8080 --script http-methods,http-headers <target> -oA <output-dir>/nmap-onvif

Output Management

Output Formats

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 processing

Timing and Performance

Timing Templates

Use -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 results

Default: 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

Timeout Considerations

  • Phase 1 Port Discovery (sudo nmap -p-): 180-300 seconds timeout (3-5 minutes)
  • Phase 2 Service Detection (nmap -p <ports> -sV -sC): 120-180 seconds timeout (2-3 minutes)
  • UDP scan: 600+ seconds timeout (very slow)

Network Ranges

Single Host

nmap <ip-address>

CIDR Notation

nmap 192.168.1.0/24

IP Range

nmap 192.168.1.1-254

Multiple Hosts

nmap 192.168.1.1 192.168.1.10 192.168.1.100

Exclude Hosts

nmap 192.168.1.0/24 --exclude 192.168.1.1,192.168.1.254

NSE Scripts

Common Script Categories

# 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>

IoT-Specific Scripts

# 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>

Result Analysis

Key Information to Extract

  1. Open Ports and Services

    • What ports are open?
    • What services are running?
    • What versions are detected?
  2. Service Fingerprints

    • Does version detection reveal outdated software?
    • Are there known vulnerabilities for detected versions?
  3. NSE Script Results

    • A

Content truncated.

apktool

BrownFineSecurity

Android APK unpacking and resource extraction tool for reverse engineering. Use when you need to decode APK files, extract resources, examine AndroidManifest.xml, analyze smali code, or repackage modified APKs.

72

onvifscan

BrownFineSecurity

ONVIF device security scanner for testing authentication and brute-forcing credentials. Use when you need to assess security of IP cameras or ONVIF-enabled devices.

250

picocom

BrownFineSecurity

Use picocom to interact with IoT device UART consoles for pentesting operations including device enumeration, vulnerability discovery, bootloader manipulation, and gaining root shells. Use when the user needs to interact with embedded devices, IoT hardware, or serial consoles.

10

iotnet

BrownFineSecurity

IoT network traffic analyzer for detecting IoT protocols and identifying security vulnerabilities in network communications. Use when you need to analyze network traffic, identify IoT protocols, or assess network security of IoT devices.

00

ffind

BrownFineSecurity

Advanced file finder with type detection and filesystem extraction for analyzing firmware and extracting embedded filesystems. Use when you need to analyze firmware files, identify file types, or extract ext2/3/4 or F2FS filesystems.

50

telnetshell

BrownFineSecurity

Use telnet to interact with IoT device shells for pentesting operations including device enumeration, vulnerability discovery, credential testing, and post-exploitation. Use when the user needs to interact with network-accessible shells, IoT devices, or telnet services.

30

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9511,092

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

843845

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

570697

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

670461

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

512280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.