rustscan
Fast port scanner that pipes to nmap for service detection.
Quickstart
rustscan -a 10.10.10.10
rustscan -a 10.10.10.10 -- -sV -sC
rustscan -a 10.10.10.10 -p 22,80,443
Core Concepts
| Concept |
Description |
| Speed |
Async Rust-based scanning |
| nmap integration |
Auto-pipes to nmap |
| Batch size |
Control concurrent connections |
Syntax
rustscan -a <target> [options] -- [nmap options]
Options
Target
| Option |
Description |
-a <addr> |
Target address(es) |
-p <ports> |
Port list/range |
-r <range> |
Port range (1-65535) |
--top |
Scan top 1000 ports |
| Option |
Description |
-b <n> |
Batch size (default 4500) |
-t <ms> |
Timeout (default 1500) |
-u <n> |
Ulimit |
--tries <n> |
Retry attempts |
Output
| Option |
Description |
-g |
Greppable output |
-o <file> |
Output file |
--no-nmap |
Skip nmap |
nmap
| Option |
Description |
-- |
Pass args to nmap |
--scripts <s> |
nmap scripts |
Recipes
Basic Scanning
rustscan -a 10.10.10.10
rustscan -a 10.10.10.10 -p 22,80,443,8080
rustscan -a 10.10.10.10 -r 1-10000
rustscan -a 10.10.10.10 --top
With nmap
rustscan -a 10.10.10.10 -- -sV
rustscan -a 10.10.10.10 -- -sC
rustscan -a 10.10.10.10 -- -sV -sC -A
rustscan -a 10.10.10.10 -- --script vuln
rustscan -a 10.10.10.10 -b 10000
rustscan -a 10.10.10.10 -b 1000 -t 3000
rustscan -a 10.10.10.10 -u 5000
Multiple Targets
rustscan -a 10.10.10.10,10.10.10.11,10.10.10.12
rustscan -a 10.10.10.0/24
rustscan -a $(cat hosts.txt | tr '\n' ',')
Output
rustscan -a 10.10.10.10 -g
rustscan -a 10.10.10.10 -o results.txt
rustscan -a 10.10.10.10 --no-nmap
Skip nmap (Fast Mode)
rustscan -a 10.10.10.10 --no-nmap
rustscan -a 10.10.10.10 -g --no-nmap
Docker
docker run -it --rm rustscan/rustscan:latest -a 10.10.10.10
docker run -it --rm rustscan/rustscan:latest -a 10.10.10.10 -- -sV
Pipeline
rustscan -a 10.10.10.10 --no-nmap -g | \
awk -F'[\\[\\],]' '{for(i=2;i<NF;i++) print $i}' | \
xargs -I {} nmap -sV -p {} 10.10.10.10
rustscan -a 10.10.10.10 -g --no-nmap 2>/dev/null | \
grep -oP '\[\K[^\]]+' | tr ',' '\n'
Output & Parsing
rustscan -a 10.10.10.10 -g --no-nmap 2>/dev/null | \
grep -oP '\[\K[^\]]+'
rustscan -a 10.10.10.10 --no-nmap 2>&1 | \
grep "Open" | awk '{print $NF}'
Troubleshooting
| Issue |
Solution |
| Too many files |
Reduce -b batch size |
| Slow |
Increase -b, check network |
| Missing ports |
Add --tries, increase timeout |
| nmap errors |
Check nmap args after -- |
References