How bee-san/rustscan works
RustScan is a command-line port scanner: users supply targets and scan options, which are parsed and resolved before a configured TCP/UDP scan probes ports and reports open results. The CLI can then dispatch scripts with discovered ports, including the default Nmap command; README also documents adaptive learning, though the sampled source does not establish its implementation or wiring. Paths and relationships reflect the available tree and excerpts, so unsampled subsystem links are omitted where their callers are uncertain.
Main entry points: main.rs CLI orchestration · scanner/mod.rs Scan coordinator · address.rs Address resolution · port_strategy/mod.rs Port ordering
Components 16
Inputs and targets
- CLI orchestration
src/main.rs - Options and config
src/input.rs - Address resolution
src/address.rs
Port scanning
- Port ordering
src/port_strategy/mod.rs - Random range iterator
src/port_strategy/range_iterator.rs - Scan coordinator
src/scanner/mod.rs - Socket enumeration
src/scanner/socket_iterator.rs
Results and extensions
- Scan output
src/main.rs - Script engine
src/scripts/mod.rs - Adaptive learning
src - Accessible terminal UI
src/tui.rs
Other components
- CLI user
- DNS resolver
- Target hosts
- User scripts
- Nmap
Connections 18
- CLI user → CLI orchestration: invokes
- CLI orchestration → Options and config: reads options
- Options and config → CLI orchestration: provides config
- CLI orchestration → Address resolution: resolves targets
- Address resolution → DNS resolver: looks up names
- Address resolution → Target hosts: returns addresses
- CLI orchestration → Port ordering: selects ports
- Port ordering → Random range iterator: generates order
- CLI orchestration → Scan coordinator: runs scan
- Scan coordinator → Port ordering: gets port order
- Scan coordinator → Socket enumeration: enumerates sockets
- Scan coordinator → Target hosts: probes ports
- Scan coordinator → CLI orchestration: returns open ports
- CLI orchestration → Scan output: prints results
- CLI orchestration → Script engine: dispatches scripts
- User scripts → Script engine: supplies scripts
- Script engine → Nmap: runs command
- Scan output → Accessible terminal UI: formats output