QianEricandQianEric b46f982b9b scripts: report a missing script program before scanning (#965)
Scripts are run through `sh -c`, so when the program a `call_format`
starts with is missing, the only feedback is whatever the shell prints
once the scan has already finished:

    Open 127.0.0.1:18080
    [~] Starting Script(s)
    [!] Error No such file or directory (os error 2)

which neither names the program nor arrives before a long scan has been
wasted.

Check the first word of every selected script format against PATH while
the scripts are initialised, and fail there with the program named. Name
resolution follows what the shell would do: PATH entries in order, plus
PATHEXT on Windows.

Formats that do not start with a bare program name are left alone, since
their first word is not something PATH can answer for:

- `FOO=bar cmd ...` (leading assignment)
- `/opt/custom/nmap ...` (explicit path)
- `{{script}} ...` (placeholder filled in at run time)

With nmap absent, on the same scan:

    before: scans, then "[!] Error No such file or directory (os error 2)"
    after:  "[!] Initiating scripts failed!
             The script `default` runs `nmap`, which is not installed or
             not in PATH. Install it, or skip scripts with `--scripts none`."

With nmap present the scan and the script phase run as before.

Implemented with std/target-specific helpers rather than a new
dependency: `which` pulls in a newer windows-sys and rewrites ~110 lines
of Cargo.lock for a 15-line check.

Refs #691

Co-authored-by: QianEric <[email protected]>
2026-11-04 09:29:26 +00:00
2020-11-06 01:43:56 +00:00
2020-08-28 01:31:54 +02:00
2020-08-27 12:36:56 +01:00
2020-10-10 12:27:39 +01:00
2025-11-27 10:48:45 +09:00
2020-07-19 23:32:35 +01:00
2022-11-12 16:41:14 +00:00

➡️ 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:

  pacman -S 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.
📖 Installation Guide 📚 Documentation 🦜 Discord
🐧 ARM Support

🙋 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!

2026-11-06 17:03:54 -10:00
Languages
Rust 79.5%
Python 19.9%
Makefile 0.3%
Just 0.2%
Dockerfile 0.1%