run_nmap_scan
Execute network reconnaissance scans on IP addresses or ranges using Nmap to identify open ports, services, and vulnerabilities for security assessments.
Instructions
run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ips | Yes | ||
| flags | Yes |
Implementation Reference
- src/pentestmcp/server.py:188-190 (handler)The main handler function decorated with @mcp.tool decorator that registers and implements the 'run_nmap_scan' tool. It executes an nmap scan on the provided IPs using the specified flags, prepending default flags '-sV' and '-v', via the run_command utility.@mcp.tool(name="run_nmap_scan",description="run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)") async def run_nmap_scan(ips:List[str],flags:List[str]): return run_command(["nmap","-sV","-v"]+flags+ips)
- src/pentestmcp/server.py:188-188 (registration)The @mcp.tool decorator registers the 'run_nmap_scan' tool with the MCP server, including its name and description.@mcp.tool(name="run_nmap_scan",description="run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)")