Nmap network scan

From automateyournetwork/netclaw · View interactive version

Nmap network scan is an AI agent skill from the GitHub repository automateyournetwork/netclaw. Host discovery and port scanning using nmap — ICMP/ARP host discovery, SYN/TCP/UDP port scanning with scope enforcement and audit logging. Use when discovering live hosts on a subnet, scanning for open ports, verifying firewall rules, or doing pre/post-change port scans

How to use this skill

Skill file

Network Scanning with nmap

Installer note: native registration and the documented MCP_CALL invocation share the installed component launcher. Check readiness.json before first use; failed discovery is not device state. Existing write approvals still apply.

How to Call the nmap MCP Tools

python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" TOOL_NAME '{"param":"value"}'

When to Use

Available Tools

| Tool | Purpose | Privileges |

|------|---------|-----------|

| nmap_ping_scan | ICMP+TCP host discovery (no port scan) | none |

| nmap_arp_discovery | ARP host discovery (LAN only) | cap_net_raw |

| nmap_top_ports | Fast scan of N most common ports | none |

| nmap_syn_scan | SYN half-open port scan (fast, stealthy) | cap_net_raw |

| nmap_tcp_scan | Full TCP connect scan (no root needed) | none |

| nmap_udp_scan | UDP port scan (DNS, SNMP, NTP, etc.) | cap_net_raw |

Workflow: Subnet Discovery

When asked "what's on this network?" or "scan this subnet":

Step 1: Host Discovery

Find live hosts first — avoids wasting time port-scanning dead IPs.

python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_ping_scan '{"target":"192.168.1.0/24"}'

On directly-connected LANs, ARP discovery is more reliable:

python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_arp_discovery '{"target":"192.168.1.0/24"}'

Step 2: Quick Port Scan

Scan the top 100 common ports on discovered hosts:

python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_top_ports '{"target":"192.168.1.1","count":100}'

Step 3: Targeted Port Scan

For deeper scanning, use SYN scan (faster) or TCP connect scan:

# SYN scan — faster, requires cap_net_raw
python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_syn_scan '{"target":"192.168.1.1","ports":"1-65535"}'

# TCP connect — works without special privileges
python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_tcp_scan '{"target":"192.168.1.1","ports":"22,80,443,8080"}'

Step 4: UDP Services

Check for UDP services (DNS, SNMP, TFTP, NTP, syslog):

python3 $MCP_CALL "python3 -u $NMAP_MCP_SCRIPT" nmap_udp_scan '{"target":"192.168.1.1","ports":"53,67,68,69,123,161,162,500,514,1900"}'

Tool Parameters

nmap_ping_scan

nmap_arp_discovery

nmap_top_ports

nmap_syn_scan

nmap_tcp_scan

nmap_udp_scan

Scope Enforcement

All targets are validated against the CIDR allowlist in config.yaml. Targets outside the allowed ranges are hard-rejected before nmap runs. Default allowed ranges:

Output Format

All tools return structured JSON with:

Important Rules

Failure Behavior

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.