MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / osint_ports

Function osint_ports

cli/main.py:279–292  ·  view source on GitHub ↗

Scan for open ports (uses nmap if available).

(
    target: str = typer.Argument(..., help="Target IP or domain"),
    ports: Optional[str] = typer.Option(None, "--ports", "-p", help="Ports to scan (e.g., '22,80,443' or '1-1000')"),
    scan_type: str = typer.Option("default", "--type", "-t", help="Scan type: quick, default, full"),
    verbose: bool = typer.Option(False, "--verbose", "-v"),
)

Source from the content-addressed store, hash-verified

277
278@osint_app.command("ports")
279def osint_ports(
280 target: str = typer.Argument(..., help="Target IP or domain"),
281 ports: str | None = typer.Option(None, "--ports", "-p", help="Ports to scan (e.g., '22,80,443' or '1-1000')"),
282 scan_type: str = typer.Option("default", "--type", "-t", help="Scan type: quick, default, full"),
283 verbose: bool = typer.Option(False, "--verbose", "-v"),
284):
285 """Scan for open ports (uses nmap if available)."""
286 setup_logging(debug=verbose)
287 from modules.osint import PortScanner
288
289 console.print(f"[bold]Port Scan:[/bold] {target}")
290 scanner = PortScanner(ports=ports, scan_type=scan_type)
291 result = run_async(scanner.run(Target.from_string(target)))
292 display_result(result)
293
294
295@osint_app.command("tech")

Callers

nothing calls this directly

Calls 6

runMethod · 0.95
setup_loggingFunction · 0.90
PortScannerClass · 0.90
run_asyncFunction · 0.85
display_resultFunction · 0.85
from_stringMethod · 0.80

Tested by

no test coverage detected