scan-ports
Discover open ports and services on a target host or network using customizable port scan types and timing options.
Instructions
Scan ports on a target host or network.
Performs a port scan using nmap with the specified parameters. Validates all inputs to prevent command injection.
IMPORTANT: Only scan targets you are authorized to scan.
Returns: ScanResult with discovered hosts, ports, and their states.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Target to scan: IP address (192.168.1.1), hostname (example.com), or CIDR notation (192.168.1.0/24). Max /24 network size. | |
| ports | No | Port specification. Examples: "22", "1-1024", "22,80,443", "T:22,80,U:53" for protocol-specific. If omitted, scans nmap default ports. | |
| scan_type | No | Scan type: "connect" (TCP connect, no root needed), "syn" (SYN stealth, needs root), "udp" (UDP, needs root), "fin", "xmas", "null", "ack". Default: "connect". | connect |
| timing | No | Timing template: "paranoid", "sneaky", "polite", "normal", "aggressive", "insane". Default: "normal". | normal |
| service_detection | No | Enable service/version detection (-sV). Slower but identifies running software. | |
| timeout | No | Maximum scan duration in seconds. Default: 600. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The nmap command that was executed (sanitized) | |
| hosts | No | Results per host | |
| scan_stats | No | Scan statistics | |
| raw_output | No | Raw nmap output text | |
| warnings | No | Scan warnings |