nmap_service_detection
Identify running services and their versions on network targets to assess security posture and detect vulnerabilities.
Instructions
Perform service and version detection scan
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"targets": "<targets>"
},
"name": "nmap_service_detection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targets | Yes | ||
| ports | No | common | |
| intensity | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:121-124 (registration)Registration of the 'nmap_service_detection' tool using the @app.tool decorator, specifying name and description.
@app.tool( name="nmap_service_detection", description="Perform service and version detection scan" ) - server.py:125-138 (handler)Handler function that executes Nmap service and version detection scan by constructing arguments and calling the shared run_nmap_command helper.
async def nmap_service_detection( targets: str, ports: str = "common", intensity: int = 7 ) -> str: """Perform service and version detection scan.""" args = ["-sV", f"--version-intensity={intensity}", "-p", ports, targets] result = run_nmap_command(args) if result["success"]: return f"Service detection scan completed:\n\n{result['stdout']}" else: return f"Service detection scan failed:\n\n{result['stderr']}"