A lightweight TCP port scanner written in Go.
This tool scans a target host (IP or domain) across a single port or range of ports using concurrent workers, then prints discovered open ports.
- TCP connect scan using
net.DialTimeout - Configurable target host
- Supports single port (
80) or range (1-1024) - Configurable concurrency via worker threads
- Real-time output for open ports
- Go 1.20+ (module currently targets Go 1.24.2)
From the project root:
go run .Default behavior:
- Host:
127.0.0.1 - Ports:
1-1024 - Threads:
100
| Flag | Description | Default |
|---|---|---|
-host |
Target IP or domain (example: scanme.nmap.org) |
127.0.0.1 |
-ports |
Port range (1-1024) or single port (80) |
1-1024 |
-threads |
Number of concurrent workers | 100 |
Scan default localhost range:
go run .Scan a specific host and common ports:
go run . -host scanme.nmap.org -ports 20-100Scan one port only:
go run . -host 192.168.1.10 -ports 22Increase concurrency:
go run . -host example.com -ports 1-5000 -threads 300Scanning 127.0.0.1 on ports 1 to 1024 using 100 threads...
Port 22 is OPEN on 127.0.0.1
Port 80 is OPEN on 127.0.0.1
Scan complete! Open ports: [22 80]
- Only scans TCP ports.
- Port discovery order may vary because scanning is concurrent.
- Very high thread counts can increase CPU/network load.
Use this tool only on systems you own or have explicit permission to test.