Skip to main content

Inertia — Fast hybrid Rust+Python port scanner (TCP + UDP)

Project description

 ██╗███╗   ██╗███████╗██████╗ ████████╗██╗ █████╗
 ██║████╗  ██║██╔════╝██╔══██╗╚══██╔══╝██║██╔══██╗
 ██║██╔██╗ ██║█████╗  ██████╔╝   ██║   ██║███████║
 ██║██║╚██╗██║██╔══╝  ██╔══██╗   ██║   ██║██╔══██║
 ██║██║ ╚████║███████╗██║  ██║   ██║   ██║██║  ██║
 ╚═╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝   ╚═╝   ╚═╝╚═╝  ╚═╝

Hybrid Rust + Python port scanner — fast, clean, and built for real recon.

PyPI Python Rust License Authorized use only


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.


Built with 🦀 Rust + 🐍 Python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

inertia_scanner-1.1.1-cp38-abi3-win_amd64.whl (314.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

inertia_scanner-1.1.1-cp38-abi3-manylinux_2_34_x86_64.whl (431.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

inertia_scanner-1.1.1-cp38-abi3-macosx_11_0_arm64.whl (392.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file inertia_scanner-1.1.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for inertia_scanner-1.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f236975f4276fa5d49c6b2f1065c50499ba580feb6596294c97b04c9c0bc63bd
MD5 283958c9070ff5d3785599c58442344f
BLAKE2b-256 057a7c6703708c9ed7551fccb87bab3d8a6496ffb7f0d176f370718e4ba218b5

See more details on using hashes here.

File details

Details for the file inertia_scanner-1.1.1-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for inertia_scanner-1.1.1-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0cd1546b51e1957e17bdbbcf44b43dc16914729313d1d9656e2394851b8f5f4d
MD5 fb59eaeca7bd9fa12e6e6a6eb17a1e2a
BLAKE2b-256 91a7bedbf94a86d02883b9a5e0be42d4defb5190524f7a6ee30d5f2a065e8106

See more details on using hashes here.

File details

Details for the file inertia_scanner-1.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for inertia_scanner-1.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d36aa3b13aace2265dc4fa15c09fe35148a5a725431fca137ae1d3498de420fc
MD5 1054319aecb7c203c7a14031ab6c3a8f
BLAKE2b-256 e0693d29587d3b571082ca01a52c4b8d7f0aedeeaa2e7cfb19d4ab3525705a4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page