Security scan library with the aim of being lightweight and fast.
nerve
provides a cross-platform API for network / security scan
(for security testing, network management, evaluation)
using Rust.
It is currently in alpha stage.
Add nerve
to your dependencies
toml:Cargo.toml
[dependencies]
nerve = "0.2.1"
- Structs that provide each function
- PortScanner
- HostScanner
- UriScanner
- DomainScanner
- Basic usage of each struct
- ::new()
returns a Scanner.
- Set up the scanner (see Examples)
- ::run_scan()
Run scan with current settings.
- Results are stored in ::scan_result
- ::get_result()
returns a scan resut.
Port Scan Example ```Rust extern crate nerveport; use nerveport::PortScanner; use nerveport::PortScanType; use nerveport::ScanStatus; use std::time::Duration;
fn main() { let mut portscanner = match PortScanner::new(None, None) { Ok(scanner) => (scanner), Err(e) => panic!("Error creating scanner: {}", e), }; portscanner.settargetipaddr("192.168.1.92"); portscanner.setrange(1, 1000); portscanner.setscantype(PortScanType::SynScan); portscanner.settimeout(Duration::frommillis(10000)); portscanner.runscan(); let result = portscanner.getresult(); print!("Status: "); match result.scanstatus { ScanStatus::Done => {println!("Normal end")}, ScanStatus::Timeout => {println!("Timed out")}, _ => {println!("Error")}, } println!("Open Ports:"); for port in result.openports { println!("{}", port); } println!("Scan Time: {:?}", result.scan_time); } ```
For more details see Examples
This library requires the ability to create raw sockets. Execute with root user privileges.