Convert Figma logo to code with AI

bee-san logoRustScan

🤖 The Modern Port Scanner 🤖

16,298
1,100
16,298
35

Top Related Projects

10,944

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

24,225

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

5,117

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

16,290

🤖 The Modern Port Scanner 🤖

5,747

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

Quick Overview

RustScan is a modern port scanning tool written in Rust. It aims to be a faster and 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 port scanning capabilities
  • Low resource usage compared to traditional scanners
  • Seamless integration with Nmap for detailed follow-up scans
  • Cross-platform support (Windows, macOS, Linux)

Cons

  • Less feature-rich compared to established 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 mature tools

Getting Started

To install RustScan on a system with Rust installed:

cargo install rustscan

Basic usage to scan a target:

rustscan -a 192.168.1.1

To scan multiple IP addresses and pass results to Nmap:

rustscan -a 192.168.1.1 192.168.1.2 -p 80 443 -- -sV -sC

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

Competitor Comparisons

10,944

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

Pros of Nmap

  • Extensive feature set with advanced scanning techniques
  • Large community and extensive documentation
  • Supports scripting for custom functionality

Cons of Nmap

  • Slower scanning speed, especially for large networks
  • Steeper learning curve for advanced features
  • Resource-intensive for large-scale scans

Code Comparison

Nmap (C++):

void scan_tcp_connect(Target *target, u16 *portarray, int numports,
                      struct scan_lists *ports) {
  // TCP connect scan implementation
}

RustScan (Rust):

pub fn scan_port(ip: IpAddr, port: u16, timeout: Duration) -> PortState {
    // TCP connect scan implementation
}

Key Differences

  • RustScan focuses on fast initial port discovery, while Nmap offers comprehensive scanning capabilities
  • RustScan is written in Rust, emphasizing speed and memory safety, whereas Nmap is primarily C/C++
  • RustScan can integrate with Nmap for detailed scans, combining speed with Nmap's advanced features

Use Cases

  • Nmap: In-depth network analysis, vulnerability scanning, and complex network mapping
  • RustScan: Rapid initial port discovery, especially useful for large-scale scans or time-sensitive situations

Community and Development

  • Nmap: Large, established community with long-term development history
  • RustScan: Newer project with growing community, focused on modern development practices and performance optimization
24,225

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 options

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 = App::new();
    let matches = app.get_matches();
    let config = Config::from_args(&matches)?;
    Scanner::new(config).run()
}

Key Differences

  • Language: masscan is written in C, while RustScan is written in Rust
  • User Interface: RustScan focuses on simplicity and ease of use, while masscan offers more advanced features
  • Speed: Both tools aim for high-speed scanning, but masscan may have an edge in raw performance
  • Target Audience: RustScan is more beginner-friendly, while masscan caters to advanced users and security professionals

Conclusion

Choose masscan for complex, large-scale scans with advanced requirements. Opt for RustScan if you prefer a more user-friendly tool with a focus on simplicity and modern language features.

5,117

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 may offer better performance for certain tasks
  • Supports multiple scanning techniques (SYN, CONNECT, UDP)
  • Includes built-in port database for service fingerprinting

Cons of naabu

  • Less focus on speed optimization compared to RustScan
  • May have a steeper learning curve for users new to port scanning tools
  • Lacks some of the user-friendly features found in RustScan

Code Comparison

RustScan:

let addr = format!("{}:{}", ip, port);
let socket = TcpStream::connect_timeout(&addr.parse().unwrap(), Duration::from_millis(1000));
if let Ok(_) = socket {
    println!("Port {} is open", port);
}

naabu:

conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", host, port), timeout)
if err != nil {
    return false
}
defer conn.Close()
return true

Both projects aim to provide efficient port scanning capabilities, but they take different approaches. RustScan focuses on speed and simplicity, leveraging Rust's performance benefits. naabu offers more advanced features and scanning techniques, making it suitable for more complex scenarios. The choice between the two depends on the user's specific needs and familiarity with the respective programming languages and ecosystems.

16,290

🤖 The Modern Port Scanner 🤖

Pros of RustScan

  • Faster scanning capabilities due to Rust's performance optimizations
  • More robust error handling and memory safety features
  • Potentially better cross-platform compatibility

Cons of RustScan

  • May have a steeper learning curve for contributors not familiar with Rust
  • Possibly smaller community and ecosystem compared to other languages
  • Could have longer compilation times, especially for large projects

Code Comparison

RustScan:

use rayon::prelude::*;

fn scan_ports(ip: &str, ports: &[u16]) -> Vec<u16> {
    ports.par_iter()
        .filter(|&&port| TcpStream::connect_timeout(&format!("{}:{}", ip, port).parse().unwrap(), Duration::from_millis(1000)).is_ok())
        .cloned()
        .collect()
}

This code snippet demonstrates the use of Rayon for parallel port scanning, which can significantly improve performance.

Summary

RustScan offers improved performance and safety features due to its implementation in Rust. However, it may present challenges for contributors less familiar with the language and could have a smaller ecosystem compared to alternatives. The code example showcases efficient parallel port scanning, highlighting the potential performance benefits of using Rust for network scanning tasks.

5,747

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

Pros of ZMap

  • Written in C, potentially offering better performance for low-level network operations
  • More mature project with a larger community and extensive documentation
  • Supports a wider range of scanning techniques and protocols

Cons of ZMap

  • Less user-friendly interface compared to RustScan
  • Slower development cycle and less frequent 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 app = build_app();
    let matches = app.clone().get_matches();
    let mut config = Config::default();
    config.update_from_args(&matches)?;

Summary

ZMap is a more established and feature-rich network scanner written in C, offering advanced scanning capabilities and potentially better performance. However, it has a steeper learning curve and slower development cycle. RustScan, on the other hand, is a newer, more user-friendly scanner written in Rust, focusing on simplicity and fast scanning. While it may lack some advanced features of ZMap, RustScan offers a more modern and accessible approach to network scanning.

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

🤔 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).

🛠️ 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: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.

🤸 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):


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

💻

Oskar

💻 ⚠️

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