MCPcopy Index your code
hub / github.com/bee-san/RustScan

github.com/bee-san/RustScan @2.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.4.1 ↗ · + Follow
137 symbols 291 edges 14 files 29 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

➡️ [Discord][discord] | [Installation Guide][toc-install] | [Usage Guide][usage-guide] ⬅️

Fast, smart, effective.

![Arch Linux package][badge-1] ![Built with Rust][badge-2] ![GitHub All Releases][badge-3] ![Crates.io][badge-4] ![Discord][badge-5] ![Actions][badge-6]

🤔 What is this?

![fast][speed-1]

The Modern Port Scanner. Find ports quickly (3 seconds at its fastest). Run scripts through our scripting engine (Python, Lua, Shell supported).

🛠️ Installation

You can install RustScan's binary from our releases page.

We would prefer you to install with a package manager so it is tested and works for your system.

RustScan is in many repositories already. Install it with whatever tools you wish:

Packaging status

RustScan only officially supports Cargo installations, if you want to use that please install Rust and then cargo install rustscan

Example installations include:

MacOS:

  brew install rustscan

Arch:

  yay rustscan

✨ Features

  • Scans all 65k ports in 3 seconds.
  • Full scripting engine support. Automatically pipe results into Nmap, or use our scripts (or write your own) to do whatever you want.
  • Adaptive learning. RustScan improves the more you use it. No bloated machine learning here, just basic maths.
  • The usuals you would expect. IPv6, CIDR, file input and more.
  • Automatically pipes ports into Nmap.

‼️ Important Links

:book: [Installation Guide][links-table-1] :books: [Documentation][links-table-2] :parrot: [Discord][discord]

🙋 Table of Contents

  • 📖 [Installation Guide][toc-install]
  • 🐋 [Docker Usage][toc-docker-usage]
  • 🦜 [Discord][discord]
  • 🤸 [Usage][usage-1]

🔭 Why RustScan?

RustScan is a modern take on the port scanner. Sleek & fast. All while providing extensive extendability to you.

Not to mention RustScan uses Adaptive Learning to improve itself over time, making it the best port scanner for you.

🧋 Speed

![fast][speed-1]

Speed is guaranteed via RustScan. However, if you want to run a slow scan due to stealth, that is possible too.

Firstly, let's talk code.

We have tests that check to see if RustScan is significantly slower than the previous version. If it is, the continuous integration fails, and we can't commit code to master unless we make it faster.

[HyperFine][speed-2] is used to monitor RustScan's performance over time to answer the question, "Are we getting faster? Are we getting slower?".

Every pull request is reviewed by one person, but more often than not, two people review it. We test it manually and ensure the code doesn't negatively affect performance.

[Read more here][speed-3].

⚙️ Extensible

![scripts][extensible-1]

RustScan piping results into the custom Python script

RustScan has a new scripting engine that allows anyone to write scripts in most languages. Python, Lua, and Shell are all supported.

Want to take your found ports and pipe them into Nmap for further analysis? That's possible. Want to run smb-enum if SMB is found open? Possible.

The possibilities are endless -- and you can write scripts in whatever language you feel comfortable with.

[Read more here][extensible-2].

🌊 Adaptive

![adaptive][adaptive-1]

RustScan automatically fine-tunes itself to match the host OS

RustScan has a cool set of features called "Adaptive Learning". These features "learn" about the environment you are scanning and how you use RustScan to improve itself over time.

We use this umbrella term for any feature that fits this criterion. The list constantly changes, so [check out our wiki for more information][adaptive-learning].

👩‍🦯 Accessible

![fast][accessible-1]

RustScan is one of the first penetration testing tools that aims to be entirely accessible.

[Most penetration testing tools are not accessible][accessible-2], which negatively affects the whole industry.

RustScan has continuous integration testing that aims to ensure it is accessible, and we are constantly working on ways to improve our accessibility and ensure everyone can use RustScan.

🤸 Usage

We have 2 usage guides. [Basic Usage][usage-1] and [Things you may want to do][usage-2].

We also have documentation about our config file [here][config-file-here].

🎪 Community

[Contributing][community-1] Read this to learn how.

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Bee 🚇 ⚠️ 💻 🎨 SakiiR 💻 🐛 smackhack 🤔 💡 Bernardo Araujo 💻 🐛 🎨 Izzy Whistlecroft 🐛 imlonghao 🐛 🚧 royharoush 🤔 🎨
Atul Bhosale 💻 Thomas Gotwig 📦 Rémi Gourdon 📖 💻 Ben (CMNatic) 💻 📖 🎨 Alessandro Ferrari 🖋 Phenomite 🖋 Sandro 🖋 🐛 💻
Cass 📦 💻 🐛 Niklas Mohrin 📖 💻 🐛 Artem Polishchuk 📦 buermarc 💻 bergabman 💻 🐛 🎨 Dmitry Savintsev 💻 Sebastian Andersson 💻
Matt Corbin 💻 RootSploit 📝 eiffel-fl 💻 Y.Horie 💻

Extension points exported contracts — how you extend this code

RangeOrder (Interface)
Trait associated with a port strategy. Each PortStrategy must be able to generate an order for future port scanning. [2 …
src/port_strategy/mod.rs

Core symbols most depended-on inside this repo

push
called by 28
src/benchmark/mod.rs
parse_addresses
called by 12
src/address.rs
run
called by 9
src/scripts/mod.rs
run
called by 9
src/scanner/mod.rs
run_rustscan_with_timeout
called by 8
tests/timelimits.rs
infer_batch_size
called by 5
src/main.rs
order
called by 5
src/port_strategy/mod.rs
generate_sorted_range
called by 5
src/port_strategy/range_iterator.rs

Shape

Function 89
Method 29
Class 15
Enum 3
Interface 1

Languages

Rust100%

Modules by API surface

src/scripts/mod.rs24 symbols
src/address.rs19 symbols
src/scanner/mod.rs18 symbols
src/input.rs17 symbols
src/port_strategy/mod.rs11 symbols
src/main.rs10 symbols
tests/timelimits.rs9 symbols
src/benchmark/mod.rs8 symbols
src/port_strategy/range_iterator.rs6 symbols
build.rs6 symbols
benches/benchmark_portscan.rs5 symbols
src/scanner/socket_iterator.rs4 symbols

For agents

$ claude mcp add RustScan \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact