pentesting, updated

RustScan

RustScan: a very fast port scanner that finds open ports in seconds and hands them to nmap for service/version detection.

What it’s for

Scan all 65535 ports in seconds, then pipe the open ones straight into nmap for the detail a full-range nmap scan would take far longer to produce.

Options

Targets and ports

FlagEffect
-aTarget address, hostname or CIDR (comma-separate several)
-pSpecific ports, e.g. -p 80,443
-rPort range, e.g. -r 1-1000
--topScan only the top ports from the config
-addresses list file via -a $(cat f)No native file flag — expand in the shell

Speed and reliability

FlagEffect
-bBatch size — concurrent ports (raise to go faster)
-tTimeout per port in milliseconds
--ulimitRaise the open-file-descriptor limit (biggest speed lever)
--triesRetries per port before giving up
--scan-orderserial or random

Behaviour and output

FlagEffect
-gGreppable output (one line per host)
-A / --accessibleAccessible, screen-reader-friendly output
--no-configIgnore ~/.rustscan.toml
-- <nmap args>Everything after -- is passed to nmap on the open ports

Examples

Fast sweeps

rustscan -a 10.0.0.5                              # all ports, default settings
rustscan -a 10.0.0.0/24                           # a whole subnet
rustscan -a 10.0.0.5 -r 1-1000                    # a specific range
rustscan -a 10.0.0.5 --ulimit 5000                # raise FD limit for speed
rustscan -a 10.0.0.5 -b 4500 -t 1500              # bigger batch, longer timeout for lossy links

Hand off to nmap

rustscan -a 10.0.0.5 -- -sV -sC                   # open ports → nmap version + default scripts
rustscan -a 10.0.0.5 -- -sV -O -A                 # open ports → aggressive nmap
rustscan -a 10.0.0.5 -- --script vuln             # open ports → nmap vuln scripts

Multiple hosts and files

rustscan -a 10.0.0.5,10.0.0.6,example.com         # comma-separated targets
rustscan -a "$(paste -sd, hosts.txt)"             # expand a host file into the -a list
rustscan -a 10.0.0.0/24 -g                        # greppable, one line per host for scripting

References

§ home
~/knubertus/home/
1,1 Top