RustScan: Complete Guide to High-Speed Port Scanning and Service Discovery Using Kali Linux

RustScan: Complete Guide to High-Speed Port Scanning and Service Discovery Using Kali Linux

1. Tool Introduction

RustScan is a modern, open-source port scanner written in Rust by Bee (bee-san). Its design goal is to be “the fastest port scanner,” using asynchronous techniques and an adaptive learning algorithm to scan all 65,535 ports on a host in seconds. Rather than trying to replace Nmap’s deep service/script scanning capability, RustScan is built to complement it: RustScan rapidly identifies which ports are open, then automatically pipes those results into Nmap for detailed service/version/script scanning. It supports a scripting/plugin system of its own and a configurable batch/ulimit system to maximize scan speed without overwhelming the host OS.

2. Installation

Kali Linux includes RustScan in its repositories:

sudo apt update
sudo apt install rustscan -y

Alternative installation via the .deb release or cargo:

# via cargo (Rust package manager)
cargo install rustscan

Verify:

rustscan --version

Expected output:

rustscan 2.3.0

3. Syntax

rustscan [OPTIONS] -a <IP/host/CIDR> -- [Nmap options]

4. Command-Line Options (Full Reference)

5. Basic Usage

rustscan -a 10.10.10.5

Expected output:

.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
Open 10.10.10.5:22
Open 10.10.10.5:80
Open 10.10.10.5:3306
[~] Starting Nmap
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
3306/tcp open  mysql

6. Practical Examples

Example 1 — Scan a single IP with default settings

rustscan -a 192.168.1.10
Open 192.168.1.10:22
Open 192.168.1.10:445
[~] Starting Nmap
PORT    STATE SERVICE
22/tcp  open  ssh
445/tcp open  microsoft-ds

Example 2 — Scan a specific port range

rustscan -a 192.168.1.10 -r 1-1000
Open 192.168.1.10:21
Open 192.168.1.10:80

Example 3 — Scan a CIDR range with greppable output

rustscan -a 192.168.1.0/24 -g
192.168.1.10 -> [22,80,443]
192.168.1.15 -> [80]

Example 4 — Increase batch size and lower timeout for speed

rustscan -a 10.10.10.5 -b 6500 -t 1500
Open 10.10.10.5:22
Open 10.10.10.5:80
[~] Starting Nmap

Example 5 — Pass Nmap script/version flags after --

rustscan -a 10.10.10.5 -- -sC -sV
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu
80/tcp open  http    Apache httpd 2.4.52
| http-title: Home

Example 6 — Scan multiple targets from a file

rustscan -a targets.txt
Open 10.10.10.5:22
Open 10.10.10.6:80

Example 7 — Exclude specific ports

rustscan -a 10.10.10.5 -p 1-1000 -x 135,139
Open 10.10.10.5:22
Open 10.10.10.5:445

Example 8 — Top ports only scan

rustscan -a 10.10.10.5 --top
Open 10.10.10.5:22
Open 10.10.10.5:80
Open 10.10.10.5:443

Example 9 — Custom ulimit for large batch scans

rustscan -a 10.10.10.0/24 -u 5000 -b 4500
Open 10.10.10.5:22
Open 10.10.10.9:3389

Example 10 — Accessible mode output

rustscan -a 10.10.10.5 --accessible
Open 10.10.10.5 port 22
Open 10.10.10.5 port 80

7. Common Use Cases

8. Automation with Bash

#!/bin/bash
# rustscan_pipeline.sh - full port sweep then detailed Nmap scan
TARGET="$1"
OUTDIR="./rustscan_results"
mkdir -p "$OUTDIR"

echo "[*] Running RustScan against $TARGET..."
rustscan -a "$TARGET" -b 4500 -- -sC -sV -oN "$OUTDIR/${TARGET}_nmap.txt"

echo "[+] Full results saved to $OUTDIR/${TARGET}_nmap.txt"

9. Tips and Best Practices

10. Troubleshooting

11. References

Exit mobile version