A lightweight port scanner with banner grabbing. Built for speed using goroutines.
- Go 1.21+
go build -o prt prt.go./prt [flags]
| Flag | Default | Description |
|---|---|---|
-h |
127.0.0.1 |
Target host |
-p |
top1000.txt |
File with port list |
-aP |
off | Scan all 65535 ports |
-timeout |
2s |
Connection timeout |
-t |
300 |
Concurrent threads |
# Scan top 1000 ports
./prt -h scanme.nmap.org
# Scan all ports
./prt -h scanme.nmap.org -aP
# Custom threads and timeout
./prt -h 192.168.1.1 -t 500 -timeout 3s
# Custom port list
./prt -h 192.168.1.1 -p myports.txt[*] Scanning ports from top1000.txt on scanme.nmap.org
[*] Timeout: 2s, Threads: 300
[*] Starting scan...
[+] scanme.nmap.org:22/tcp open | "SSH-2.0-OpenSSH_6.6.1p1"
[+] scanme.nmap.org:80/tcp open
[*] Scan complete
- Banner grabbing works for services that send data on connect (SSH, FTP, SMTP, etc.)
- Higher
-tvalues speed up the scan but may trigger rate limiting or IDS - Port list file should have one port per line
Only use against systems you have permission to scan.