| Crates.io | rust-network-scanner |
| lib.rs | rust-network-scanner |
| version | 2.0.0 |
| created_at | 2025-11-18 05:24:32.591477+00 |
| updated_at | 2025-12-11 08:19:11.452192+00 |
| description | Memory-safe network security scanner with OS fingerprinting, vulnerability detection, and compliance reporting |
| homepage | |
| repository | https://github.com/guardsarm/rust-network-scanner |
| max_upload_size | |
| id | 1937914 |
| size | 145,249 |
A memory-safe, asynchronous network security scanner for vulnerability assessment and network monitoring. Built with Rust and Tokio for high-performance concurrent scanning.
Eliminates memory vulnerabilities in network security tools through Rust's ownership system. Aligns with 2024 CISA/FBI guidance for memory-safe security tooling.
Add to your Cargo.toml:
[dependencies]
rust-network-scanner = "0.1.0"
use rust_network_scanner::NetworkScanner;
use std::net::IpAddr;
use std::str::FromStr;
#[tokio::main]
async fn main() {
let scanner = NetworkScanner::new();
let ip = IpAddr::from_str("192.168.1.1").unwrap();
// Scan top 20 common ports
let result = scanner.scan_common_ports(ip).await.unwrap();
println!("Scan Results: {}", result.summary());
for port in &result.open_ports {
println!(" Port {}: {} ({})",
port.port,
port.service.as_ref().unwrap_or(&"Unknown".to_string()),
port.response_time_ms.unwrap_or(0));
}
}
use rust_network_scanner::NetworkScanner;
use std::net::IpAddr;
use std::str::FromStr;
#[tokio::main]
async fn main() {
let scanner = NetworkScanner::new();
let ip = IpAddr::from_str("192.168.1.100").unwrap();
// Scan ports 1-1000
let result = scanner.scan_ports(ip, 1, 1000).await.unwrap();
println!("Found {} open ports", result.open_ports.len());
// Export as JSON
let json = result.to_json().unwrap();
std::fs::write("scan_results.json", json).unwrap();
}
use rust_network_scanner::{NetworkScanner, ScannerConfig};
let config = ScannerConfig {
timeout_ms: 2000, // 2 second timeout
concurrent_scans: 200, // 200 concurrent connections
detect_services: true, // Enable service detection
};
let scanner = NetworkScanner::with_config(config);
Traditional C/C++ network scanners are vulnerable to:
This implementation eliminates these vulnerabilities through Rust's ownership system.
Safe concurrent scanning without data races:
// Scan multiple targets concurrently
let targets = vec!["192.168.1.1", "192.168.1.2", "192.168.1.3"];
let scanner = NetworkScanner::new();
let mut tasks = vec![];
for target in targets {
let ip = IpAddr::from_str(target).unwrap();
tasks.push(scanner.scan_common_ports(ip));
}
let results = futures::future::join_all(tasks).await;
Automatically identifies common services:
See the examples/ directory:
cargo run --example scan_network
cargo test
This scanner implements security assessment practices from:
This tool is designed for:
Unauthorized scanning is illegal. Always obtain proper authorization before scanning networks.
Designed for financial institutions requiring:
MIT License - See LICENSE file
Tony Chuks Awunor
Contributions welcome! Please open an issue or pull request.
This tool is for authorized security testing only. The author is not responsible for misuse or illegal activity. Always obtain proper authorization before scanning networks you do not own.
If you use this scanner in research or security assessments, please cite:
Awunor, T.C. (2024). Rust Network Scanner: Memory-Safe Network Security Assessment.
https://github.com/guardsarm/rust-network-scanner
Built for security assessment. Designed for memory safety. Implemented in Rust.