A fast, multithreaded TCP port scanner written in Rust with nmap-style output. Built for speed and simplicity — no external dependencies required.
- ⚡ Multithreaded scanning — distributes ports across up to 100 concurrent threads by default
- 🎯 Flexible port targeting — single ports, comma-separated lists, or ranges
- 🏷️ Service identification — recognises 70+ well-known ports (SSH, HTTP, MySQL, Redis, etc.)
- 📊 Nmap-style output — familiar
PORT / STATE / SERVICEtable format - 📈 Live progress indicator — updates every 50 ports scanned
- 🔌 Three port states —
open,closed,filtered
- Rust 1.56+ (2021 edition)
git clone https://github.com/your-username/Rust_Port_Scanner.git
cd Rust_Port_Scanner
cargo build --releaseThe compiled binary will be at target/release/port_scanner.
A pre-built port_scanner.exe for Windows x86-64 is included in the repository root.
port_scanner <host> [OPTIONS]
| Argument | Description |
|---|---|
<host> |
Target hostname or IP address (required) |
| Flag | Value | Default | Description |
|---|---|---|---|
-p |
<port-spec> |
1-1024 |
Ports to scan (see formats below) |
-T |
<milliseconds> |
500 |
Connection timeout per port in ms |
-t |
<count> |
100 |
Number of threads to use |
Scan default ports 1–1024 on a host:
./port_scanner scanme.nmap.orgScan a specific range:
./port_scanner 192.168.1.1 -p 1-65535Scan a comma-separated list of ports:
./port_scanner example.com -p 22,80,443,3306,8080Mix ranges and individual ports:
./port_scanner 10.0.0.1 -p 1-100,443,8080-8090Increase timeout for slow/remote hosts:
./port_scanner example.com -p 1-1024 -T 1000Reduce thread count for quieter scanning:
./port_scanner 192.168.1.1 -p 1-1024 -t 20Starting RustScan - Port Scanner
A fast TCP connect scanner written in Rust
Scanning 1024 port(s) on scanme.nmap.org (timeout: 500ms, threads: 100)
Progress: 1024/1024 ports scanned...
Nmap scan report for scanme.nmap.org
Host is up (0.0023s latency).
Not shown: 1020 closed ports, 2 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
9929/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 3.41 seconds — 4 open port(s)
| State | Meaning |
|---|---|
open |
TCP connection accepted — service is listening |
closed |
Connection actively refused (Connection refused) |
filtered |
No response or error — firewall/filter likely blocking |
The scanner maps 70+ well-known ports to service names, including:
| Port | Service | Port | Service |
|---|---|---|---|
| 21 | ftp | 3306 | mysql |
| 22 | ssh | 3389 | ms-wbt-server (RDP) |
| 25 | smtp | 5432 | postgresql |
| 53 | domain (DNS) | 5900 | vnc |
| 80 | http | 6379 | redis |
| 443 | https | 9200 | elasticsearch |
| 1433 | ms-sql-s | 27017 | mongod |
| 2375 | docker | 9092 | kafka |
Ports not in the list are labelled unknown.
This tool is intended for authorised network testing only. Scanning hosts without explicit permission may violate local laws and network policies. The author is not responsible for any misuse.
Rust_Port_Scanner/
├── main.rs # Full source — scanner logic, CLI parser, output formatter
├── Cargo.toml # Package manifest
├── port_scanner.exe # Pre-built Windows binary
└── README.md
This project is open source. See LICENSE for details.