Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

🔍 Rust Port Scanner

A fast, multithreaded TCP port scanner written in Rust with nmap-style output. Built for speed and simplicity — no external dependencies required.


✨ Features

  • ⚡ 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 / SERVICE table format
  • 📈 Live progress indicator — updates every 50 ports scanned
  • 🔌 Three port states — open, closed, filtered

📦 Installation

Prerequisites

  • Rust 1.56+ (2021 edition)

Build from source

git clone https://github.com/your-username/Rust_Port_Scanner.git
cd Rust_Port_Scanner
cargo build --release

The compiled binary will be at target/release/port_scanner.

Windows pre-built binary

A pre-built port_scanner.exe for Windows x86-64 is included in the repository root.


🚀 Usage

port_scanner <host> [OPTIONS]

Arguments

Argument Description
<host> Target hostname or IP address (required)

Options

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

📋 Examples

Scan default ports 1–1024 on a host:

./port_scanner scanme.nmap.org

Scan a specific range:

./port_scanner 192.168.1.1 -p 1-65535

Scan a comma-separated list of ports:

./port_scanner example.com -p 22,80,443,3306,8080

Mix ranges and individual ports:

./port_scanner 10.0.0.1 -p 1-100,443,8080-8090

Increase timeout for slow/remote hosts:

./port_scanner example.com -p 1-1024 -T 1000

Reduce thread count for quieter scanning:

./port_scanner 192.168.1.1 -p 1-1024 -t 20

🖥️ Sample Output

Starting 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)

🔌 Port State Reference

State Meaning
open TCP connection accepted — service is listening
closed Connection actively refused (Connection refused)
filtered No response or error — firewall/filter likely blocking

🗂️ Recognised Services

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.


⚠️ Legal Disclaimer

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.


🛠️ Project Structure

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

📄 License

This project is open source. See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages