Tool Family: recon
- Registration source:
tools/mcp_tools/recon.py:10 register_recon_tools(mcp, *, ctx)— auto-discovered; no edit tomcp_exploit_server.py. - Gate: all 7 tools
@require_allowlist()(target-IP lock + audit trail).
Tools Exported (7)
| Tool | Params | Result Shape | What it does |
|---|---|---|---|
check_os | target_ip: str | `OS_CHECK_RESULTS:\nTARGET: ...\nTTL: ...? + Port X/tcp: open - banner + OS_VERDICT: WINDOWS | LINUX |
quick_scan | target_ip: str, ports: str="22,80,135,139,443,445,3389,3000,8080,8081,8082,8083,2222,2121,2323,4455,3306" | format_socket_scan_results output | Comma-separated ports → delegates to tools.socket_scan.socket_scan_sync native TCP-connect + banner grab (same impl as recon pipeline no-privilege fallback, tools/mcp_tools/recon.py:183-198). |
run_full_recon | target_ip: str, aggression: str="normal" (`stealth | normal | aggressive |
get_service_fingerprint | target_ip: str, port: int | SERVICE_FINGERPRINT: ip:port\nPORT: ...\nSERVICE_GUESS: ...\nBANNER: ...\nSSL/TLS INFO?: Issuer/Subject/SAN/Valid Until | TCP connect + HTTP HEAD for 80/8080/8000/3000/5000; TLS ports 443/8443/636/993/995/465/989/990 try _ssl_module create_default_context + getpeercert() + SAN extraction, else plain banner. Service guess from port/banners (tools/mcp_tools/recon.py:275-404). |
run_udp_recon | target_ip: str, top_ports: int=100 | UDP_PORTS: completed\nTARGET: ...\nSCAN_TOOL: ...\nUDP_PORT_COUNT: N\nUDP_PORTS: [...] | ReconPipeline.recon_udp(target_ip, top_ports) via nmap -sU --top-ports N -sV (root-required → auto-downgrade). Filters protocol=="udp" services (tools/mcp_tools/recon.py:413-460). |
run_osint_recon | target_ip: str | `OSINT: completed\nTARGET: ...\nHOSTNAME: ...\nREVERSE_DNS: ...\nIPV6_ADDRESSES: ...\nCERT_TRANSPARENCY: N certs\nSHODAN: enabled | disabled` |
diff_recon_runs | old_path: str, new_path: str | RECON_DIFF: completed\nTARGET: ...\nSUMMARY: ...\nADDED_PORTS: ...\nREMOVED_PORTS: ...\nCHANGED_SERVICES: N\nNEW_CVES: ...\nLOST_CVES: ...\nOS_CHANGED: ... | Loads two recon_result.json snapshots via tools.recon_diff.diff_recon_files — no scanning; require_allowlist for audit consistency only (tools/mcp_tools/recon.py:509-556). |
Parameters — Validation
target_ipvalidated byvalidate_target_or_ip(IPv4/IPv6/FQDN) — returnsERROR: Invalid target (IP or domain).on fail (for the async/full tools) orBLOCKED: target_ip is required.for check_os/quick_scan.portmust be1..65535;top_portscoerced to 100 when non-positive.aggressionmapped via{"stealth":stealth, "normal":normal, "aggressive/maximum":aggressive}.
Result Shape — Common
ATTEMPT_IDfrom_attempt_dir;recon_result.jsonpersisted perrun_full_recon.- OS hints derived deterministically; warnings/errors capped to first 5 entries.
Dependencies
tools/recon_pipeline.ReconPipeline,ReconConfig,HostReconResulttools/socket_scan.socket_scan_sync,format_socket_scan_resultstools/recon_osint.run_osint,tools/recon_diff.diff_recon_filestools/validation_utils.validate_target_or_ip,is_target_in_allowlisttools/kernel/allowlist._allowed_target_list(allowlist lock)
Config
recon.*— aggression defaults,dns_zone_transfer(used bydns_reconfamily, not this family)nmap.path,nmap.sudo,nmap.priv_fallback— primary scanner privilege handlingexploit.require_explicit_allowlist,exploit.allowed_targets— lock
Auditing
All @require_allowlist() → writes started then completed|blocked to exploit_audit.jsonl with redacted args; run_full_recon/run_udp_recon are async handlers (audit wrapper handles both sync/async). diff_recon_runs is allowlist-gated for audit consistency though it touches no target.
Validation
- Syntactic IP/FQDN check before any socket or pipeline call.
- Allowlist gate refuses out-of-scope hosts before connect/scan.
- No subprocess shell injection — recon tools use pipeline (no argv shell strings in the handlers themselves).
Tests
tests/test_mcp_tool_registration.py— expectscheck_os,quick_scan,run_full_recon,get_service_fingerprinttests/test_recon_pipeline.py(pipeline unit),tests/test_domain_mcp_tools.pycovers domain recon but not this family's port scans; mock the pipeline/socket scan in family tests.
Related Docs
docs/mcp/security.md— allowlist lockdocs/architecture.md— ReconPipeline shapedocs/mcp/tool-families/domain.md— domain recon counterpart
source: repo docs (build sync)Edit this page on GitHub →