Inertia — Fast hybrid Rust+Python port scanner (TCP + UDP)
Project description
██╗███╗ ██╗███████╗██████╗ ████████╗██╗ █████╗
██║████╗ ██║██╔════╝██╔══██╗╚══██╔══╝██║██╔══██╗
██║██╔██╗ ██║█████╗ ██████╔╝ ██║ ██║███████║
██║██║╚██╗██║██╔══╝ ██╔══██╗ ██║ ██║██╔══██║
██║██║ ╚████║███████╗██║ ██║ ██║ ██║██║ ██║
╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Hybrid Rust + Python port scanner — fast, clean, and built for real recon.
Overview
Inertia is a high-performance port scanner that combines a Rust async core with a Python interface, delivering speed without sacrificing usability. It automatically calibrates timeouts per target, loads port lists from the official Nmap database, supports both TCP and UDP, and displays results in a clean terminal UI with live hits as ports are discovered.
Built for network diagnostics, security auditing, and learning. Not for unauthorized use.
Quick Start
pip install inertia-scanner
# Scan a host with the top 100 most common ports
inertia -t 192.168.1.1
# Try the visual demo without any network connections
inertia --demo
Features
| Feature | Details | |
|---|---|---|
| 🦀 | Rust async core | Tokio-powered — thousands of concurrent probes via PyO3 |
| 🎯 | Auto timeout calibration | Measures real RTT to the target before scanning |
| 📡 | TCP + UDP | Full TCP connect scan + UDP with protocol-specific payloads |
| 🗂️ | Nmap port presets | Loaded from official nmap-services — top100 to all 65535 |
| 🚦 | Rate limiting | Token Bucket algorithm — prevents firewall triggers |
| 🔍 | Banner grabbing | Smart per-protocol requests (HTTP HEAD, SMTP CRLF, etc.) |
| ⚡ | Live hits | Open ports printed in real time as they're discovered |
| 📊 | Export formats | JSON, CSV, HTML report, and plain TXT |
| 🎭 | Demo mode | Full visual simulation — no network needed |
Installation
pip install inertia-scanner
Requires Python 3.8+. The Rust core is pre-compiled — no Rust installation needed.
Usage
inertia [options]
Target:
-t, --target HOST Target IP address or hostname
Ports:
-p, --ports PORTS Custom ports: 22,80,443 or 1-1024
--preset PRESET top100 | top1000 | top3000 | top10000 | todas
Protocols:
--udp Enable UDP scanning (in addition to TCP)
--tcp-only TCP only (default)
Timing:
-c, --concurrency N Max concurrent probes (default: 400)
--timeout MS Per-port timeout in ms (default: auto-calibrated)
--rate-limit PPS Max probes per second (default: unlimited)
Output:
-o, --output FILE Save report to file
-f, --format FORMAT json | csv | html | txt
Behavior:
--no-banner Skip banner grabbing (faster)
--no-logo Hide ASCII banner
--demo Visual simulation — no network connections
--update-ports Re-download nmap-services cache
--version Show version
Examples
# Basic scan — auto-calibrated timeout, top 100 ports
inertia -t 192.168.1.1
# Top 3000 most common ports
inertia -t scanme.nmap.org --preset top3000
# TCP + UDP — detects DNS (53), NTP (123), SNMP (161)
inertia -t 192.168.1.1 --udp
# Custom port range with rate limiting
inertia -t 10.0.0.1 -p 1-10000 --rate-limit 300 -c 500
# Full scan — all 65535 ports
inertia -t 10.0.0.1 --preset todas -c 1000
# Export an HTML report
inertia -t 10.0.0.1 --preset top1000 -o report.html
# Visual demo — no network required
inertia --demo
Architecture
Inertia is split into clear, single-responsibility modules:
inertia/
│
├── src/lib.rs # Rust core — async TCP/UDP, PyO3 bindings
│
└── inertia/
├── cli.py # Entry point — argument parsing, scan flow
│
├── nucleo/ # Core logic
│ ├── modelos.py # Data types: ResultadoPorta, SessaoScan
│ ├── scanner.py # Orchestrator — calls Rust, enriches results
│ ├── calibrador.py # Auto timeout calibration
│ ├── limitador.py # Token Bucket rate limiter
│ └── resolucao.py # Hostname resolution + reverse DNS
│
├── ui/
│ ├── terminal.py # Rich UI — banner, live hits, table, summary
│ └── demo.py # Demo mode (no network)
│
├── utils/
│ ├── portas.py # nmap-services loader, presets, port parser
│ └── servicos.py # Service database + banner fingerprinting
│
└── relatorios/
└── exportador.py # JSON, CSV, HTML, TXT exporters
How Python calls Rust
CLI (Python)
│
▼
nucleo/scanner.py
│
│ from inertia import inertia_core ← compiled .pyd / .so via PyO3
│
▼
inertia_core.varrer_portas(host, ports, ...)
│
│ [Rust / Tokio]
│ Semaphore → async fan-out → TCP connect / UDP probe → collect
│
▼
ResultadoVarredura { portas: Vec<ResultadoPorta>, ... }
│
▼
Python: enrichment → live hits → table → export
Built With
| Technology | Role |
|---|---|
| Rust | Async scan core |
| Tokio | Async runtime inside Rust |
| PyO3 | Rust ↔ Python native bindings |
| maturin | Build system for Rust+Python wheels |
| Rich | Terminal UI |
| Jinja2 | HTML report templating |
| nmap-services | Port frequency database |
Ethical Use
Inertia is designed for authorized network diagnostics, security auditing, and education.
Only scan hosts and networks you own or have explicit written permission to test.
Unauthorized port scanning may be illegal in your jurisdiction.
The scanme.nmap.org host is provided by the Nmap project specifically for testing scanners.
License
MIT — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inertia_scanner-1.0.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: inertia_scanner-1.0.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 314.7 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d534c626f9dd4c6f3d6afe5aead27fb957d3f935c624a721fabc07985c517ba1
|
|
| MD5 |
ac9bf478046dbabf84c69f1f17167e6a
|
|
| BLAKE2b-256 |
96f56e878bd7cb98aaee8314afa591287d36eb7c66842a5cb51b8339dbdfd8eb
|
File details
Details for the file inertia_scanner-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: inertia_scanner-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 431.8 kB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a14bc548e9f3ffd7220c60583b96f63d3f5b48c85361a66eb2d243f1ff845ba7
|
|
| MD5 |
2fc379996ba6012c56da4522261acc63
|
|
| BLAKE2b-256 |
29e3f438b97cfc47215149910036f9d84201d6858af189fa67cdc057fac03e72
|
File details
Details for the file inertia_scanner-1.0.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: inertia_scanner-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 392.4 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cf23b5462686759da4b2f66a491652f143430edebf3be00bcdd7f7a004d239a
|
|
| MD5 |
5a27460aa3ba61723c3f23fb4dd617ca
|
|
| BLAKE2b-256 |
bba5e9af2fe193a58be95b38b34be03632fa1075b4c7c973b40bd96c52e44c9a
|