Convert Figma logo to code with AI

RustScan logoRustScan

🤖 The Modern Port Scanner 🤖

14,087
944
14,087
41

Top Related Projects

9,874

Nmap - the Network Mapper. Github mirror of official SVN repository.

23,262

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.

4,587

A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests

5,434

ZMap is a fast single packet network scanner designed for Internet-wide network surveys.

DEPRECATED, bettercap developement moved here: https://github.com/bettercap/bettercap

Quick Overview

RustScan is a modern port scanning tool written in Rust. It aims to be a faster, more efficient alternative to traditional tools like Nmap, focusing on quick initial port discovery before passing the results to Nmap for deeper analysis.

Pros

  • Extremely fast scanning capabilities, able to scan all 65k ports in seconds
  • Low resource usage compared to traditional port scanners
  • Seamless integration with Nmap for detailed follow-up scans
  • Cross-platform support (Windows, macOS, Linux)

Cons

  • Less feature-rich compared to mature tools like Nmap
  • May trigger firewall or IDS alerts due to its speed
  • Relatively new project, so it may have undiscovered bugs or limitations
  • Limited documentation compared to more established tools

Getting Started

To install RustScan on a Unix-based system with Homebrew:

brew install rustscan

For other installation methods, visit the project's GitHub repository.

Basic usage:

# Scan a single IP address
rustscan -a 192.168.1.1

# Scan multiple IP addresses
rustscan -a 192.168.1.1 192.168.1.2 192.168.1.3

# Scan with specific port range
rustscan -a 192.168.1.1 -p 1-1000

# Scan and pipe results to Nmap
rustscan -a 192.168.1.1 -- -A -sC

For more advanced usage and configuration options, refer to the project's documentation on GitHub.

Competitor Comparisons

9,874

Nmap - the Network Mapper. Github mirror of official SVN repository.

Pros of nmap

  • Extensive feature set with advanced scanning techniques
  • Large, active community and long-standing reputation
  • Comprehensive documentation and widespread adoption

Cons of nmap

  • Slower scanning speed, especially for large networks
  • Steeper learning curve for new users
  • Written in C, which can be more challenging to contribute to

Code Comparison

nmap (C):

static int scan_ping_scan(Target *target)
{
    if (target->flags & HOST_UP)
        return OP_SUCCESS;
    return ping_scan(target);
}

RustScan (Rust):

pub fn scan_port(port: u16, addr: IpAddr, timeout: Duration) -> PortStatus {
    let socket = create_socket(addr);
    socket.set_read_timeout(Some(timeout)).unwrap();
    match socket.connect((addr, port)) {
        Ok(_) => PortStatus::Open(port),
        Err(_) => PortStatus::Closed(port),
    }
}

RustScan focuses on simplicity and speed, leveraging Rust's safety features and concurrency model. It provides a more user-friendly interface for basic port scanning tasks. However, nmap offers a broader range of scanning techniques and more detailed output, making it better suited for complex network analysis and security assessments. RustScan can be seen as a complementary tool to nmap, often used for initial rapid scans before diving deeper with nmap's advanced features.

23,262

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.

Pros of masscan

  • Written in C, potentially offering better performance for large-scale scans
  • More mature project with a longer development history
  • Supports a wider range of scanning techniques and protocols

Cons of masscan

  • Less user-friendly interface compared to RustScan
  • Requires more manual configuration and setup
  • May have a steeper learning curve for beginners

Code Comparison

masscan:

int main(int argc, char *argv[])
{
    struct Masscan masscan[1];
    masscan_init(masscan);
    masscan_command_line(masscan, argc, argv);
    masscan_start(masscan);
    return 0;
}

RustScan:

fn main() -> CliResult {
    let mut app = RustScan::new();
    app.run()
}

The code comparison shows that masscan's main function is more verbose and requires explicit initialization and configuration, while RustScan's main function is more concise and relies on a higher-level abstraction.

Both tools are powerful port scanners, but they cater to different user needs. masscan is better suited for advanced users who require fine-grained control and high-performance scanning of large networks. RustScan, on the other hand, offers a more user-friendly experience and is ideal for quick scans and users who prefer a simpler interface.

4,587

A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests

Pros of naabu

  • Written in Go, which offers better cross-platform compatibility
  • Supports multiple scanning techniques (SYN, CONNECT, UDP)
  • Integrates well with other projectdiscovery tools

Cons of naabu

  • Generally slower than RustScan for large-scale scans
  • Less focus on being "user-friendly" compared to RustScan
  • Requires more manual configuration for optimal performance

Code Comparison

RustScan:

let scanner = Scanner::new(args.ip, args.ports, args.timeout);
scanner.run();

naabu:

options := &runner.Options{
    Host:    host,
    Ports:   ports,
    Timeout: timeout,
}
runner.NewRunner(options).Run()

Both projects aim to provide fast port scanning capabilities, but they differ in their implementation and target audience. RustScan focuses on speed and ease of use, making it more suitable for quick scans and beginners. naabu, on the other hand, offers more advanced features and integrations, making it a better choice for security professionals and those who need more customization options.

RustScan's simplicity and speed make it ideal for initial reconnaissance, while naabu's versatility and integration with other tools make it more suitable for comprehensive security assessments and penetration testing workflows.

5,434

ZMap is a fast single packet network scanner designed for Internet-wide network surveys.

Pros of zmap

  • Written in C, offering potentially faster execution and lower resource usage
  • More mature project with a longer development history
  • Supports a wider range of scanning techniques and protocols

Cons of zmap

  • Less user-friendly interface compared to RustScan
  • Slower development cycle and fewer recent updates
  • More complex setup and configuration process

Code Comparison

zmap (C):

int main(int argc, char *argv[])
{
    struct gengetopt_args_info args;
    struct cmdline_parser_params *params;
    if (cmdline_parser_ext(argc, argv, &args, &params) != 0) {
        exit(EXIT_SUCCESS);
    }
}

RustScan (Rust):

fn main() -> CliResult {
    let mut cli = Cli::parse();
    let mut scanner = Scanner::new(&mut cli)?;
    scanner.run()?;
    Ok(())
}

The code comparison shows that RustScan has a more concise and modern main function, leveraging Rust's error handling and parsing capabilities. zmap's main function demonstrates a more traditional C-style approach with manual argument parsing and error handling.

DEPRECATED, bettercap developement moved here: https://github.com/bettercap/bettercap

Pros of Bettercap

  • More comprehensive network attack and monitoring tool
  • Supports a wider range of protocols and attack vectors
  • Offers a web UI for easier management and visualization

Cons of Bettercap

  • Steeper learning curve due to its complexity
  • Requires more system resources to run effectively
  • Not as focused on port scanning as RustScan

Code Comparison

Bettercap (Ruby):

def start_httpd
  @httpd = HTTPServer.new(
    @options[:httpd][:port],
    @options[:httpd][:address],
    @options[:httpd][:server]
  )
  @httpd.start
end

RustScan (Rust):

pub fn run_scan(
    ips: Vec<IpAddr>,
    ports: Vec<u16>,
    config: &Config,
) -> Result<()> {
    let mut batch = Batch::new(ips, ports);
    batch.run(config)?;
    Ok(())
}

While both tools are used for network analysis, they serve different purposes. Bettercap is a more comprehensive network attack and monitoring framework, while RustScan focuses specifically on fast port scanning. The code snippets reflect this difference, with Bettercap's example showing HTTP server setup and RustScan's demonstrating its core scanning functionality.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

➡️ Discord | Installation Guide | Usage Guide ⬅️

Fast, smart, effective.

Arch Linux package Built with Rust GitHub All Releases Crates.io Discord Actions


🐋 (Recommended)👩‍💻🏗️🔧
DockerKaliArchapple
docker pull rustscan/rustscan:latest
Docker
Link to Documentationyay -S rustscanbrew install rustscan

🤔 What is this?

fast

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

✨ 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:books: Documentation:parrot: Discord

🙋 Table of Contents

🔭 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 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 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.

⚙️ Extensible

scripts

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.

🌊 Adaptive

adaptive

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.

👩‍🦯 Accessible

fast

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

Most penetration testing tools are not accessible, 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.

📖 Full Installation Guide

You can find our guide here.

🦊 Community Distributions

Here are all of RustScan's community distributions.

If you maintain a community distribution and want it listed here, leave an issue / pull request / Discord message or however, you want to let us know.

Packaging status

🤸 Usage

We have 2 usage guides. Basic Usage and Things you may want to do.

We also have documentation about our config file here.

🎪 Community

Contributing Read this to learn how.

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Brandon

🚇 ⚠️ 💻 🎨

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

💻

Oskar

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!