Concurrent TCP port scanner with service identification and banner grabbing. A connect scan needs no root, so it runs anywhere Python does. Standard library only, no dependencies.
python portscope.py <target> [options]
target is a hostname, an IP, or a CIDR range (10.0.0.0/24).
python portscope.py scanme.nmap.org
python portscope.py 192.168.1.10 -p 1-1024
python portscope.py 10.0.0.0/24 -p top --open-only
python portscope.py example.com -p 80,443,8080 --no-banner --json
-p, --ports top | all | list (22,80,443) | range (1-1024) (default: top)
-t, --timeout per-connection timeout in seconds (default: 1.0)
-w, --workers concurrent connections per host (default: 200)
--no-banner skip banner grabbing
--open-only only show hosts with at least one open port
--json machine-readable output
--no-color disable ANSI colors
top covers the common service and web/admin ports. On a CIDR sweep each host
is liveness-probed first, so dead addresses are skipped quickly.
Connect scans complete the TCP handshake, so they are reliable but visible in
target logs. Banner grabbing reads the first line a service offers and, for HTTP
ports, sends a HEAD / request. TLS ports are wrapped before reading.
Scan only hosts you own or have explicit written permission to test. Port scanning third-party systems without authorization is illegal in many jurisdictions.
MIT