Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anubis

Anubis

Guardian of the gates — a fast, async TCP port scanner written in Rust.

Scans a host, grabs service banners, shows live progress, and saves the results to a file.

Rust Edition Runtime License

Warning

Educational project. Built for learning networking, Rust and async programming. Only run it against hosts you own or have explicit permission to scan. Unauthorized scanning may violate local laws.


Features

Async by default Tokio drives every probe — no thread-per-port overhead
Sequential mode --sync scans one port at a time when you want to go easy on the target
Smart banner grabbing The payload is chosen per port: HTTP ports get a GET, Redis gets a PING, and services that greet first (SSH, FTP, SMTP…) get nothing at all
Live feedback Open ports print as they are found, under a spinner (indicatif)
Clean CLI Flags and --help via clap
Structured logs tracing with uptime timestamps
Saved output One port per line in results.txt

Requirements

  • Rust 1.85+ (edition 2024)
  • Cargo

Installation

git clone https://github.com/DaviAlcanfor/anubis.git
cd anubis
cargo build --release

The binary lands at ./target/release/anubis.

Usage

anubis [OPTIONS] --host <HOST>

Options

Flag Default Description
--host required Target IP or hostname
--ports 1-1024 Port range, as start-end
--timeout 200 Connection timeout per port, in ms
--threads 2 Ports probed concurrently (ignored with --sync)
--sync off Scan one port at a time instead of concurrently

Examples

# Default range (1-1024)
anubis --host 192.168.1.1

# Full range, 500 ports at a time
anubis --host 192.168.1.1 --ports 1-65535 --threads 500

# Slower and gentler: one port at a time, generous timeout
anubis --host 192.168.1.1 --ports 1-1024 --timeout 500 --sync

Output

Open ports are printed live and written to results.txt in the current directory:

OPEN 22 | SSH-2.0-OpenSSH_9.6
OPEN 80 | HTTP/1.0 200 OK
OPEN 443

A port with no | answered the connection but stayed silent — it is open, just not talkative.

Project layout

src/
├── main.rs    # wiring only: parse args, run a scan, write the file
├── cli.rs     # flags and port-range parsing
├── scan.rs    # async and sequential scan strategies, result formatting
├── probe.rs   # single-port connect + per-port banner payloads
└── ui.rs      # logger and progress bar setup

Adding a banner payload for a new service is a single line in the PAYLOADS map in src/probe.rs.

Tests

cargo test

Dependencies

Crate Purpose
tokio Async runtime
futures Stream combinators for bounded concurrency
clap CLI argument parsing
indicatif Progress spinner
colored Terminal colors
tracing + tracing-subscriber Structured logging

License

MIT — see LICENSE.

Anubis illustration by Jeff Dahl, CC BY-SA 4.0.

About

Fast async TCP port scanner written in Rust. Scans a host, detects open ports and execute banner grabbing

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages