1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/// # ntrace: A fast and secure network port scanner and protocol analyzer.
///
/// This library provides functionality for scanning TCP/UDP ports, detecting services,
/// and analyzing protocols on a target host. It is designed for penetration testing
/// and security auditing.
///
/// ## Features
///
/// - **Advanced Port Scanning**: Asynchronous TCP port scanning with configurable concurrency and rate limiting
/// - **Service Detection**: Identifies services running on open ports
/// - **Protocol Analysis**: Detects and analyzes common protocols
/// - **Flexible Port Selection**: Scan specific ports, ranges, or use predefined groups
/// - **Traceroute**: Trace the route packets take to a host with TCP, UDP, or ICMP
///
/// ## Example
///
/// ```rust,no_run
/// use ntrace::{Scanner, ScanConfig, Protocol, Target};
/// use std::net::IpAddr;
/// use std::str::FromStr;
/// use std::time::Duration;
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// // Configure the scanner
/// let config = ScanConfig {
/// target: Target::Ip(IpAddr::from_str("192.168.1.1")?),
/// ports: vec![80, 443, 8080],
/// timeout: Duration::from_secs(2),
/// protocol: Protocol::Tcp,
/// batch_size: 100,
/// max_retries: 3,
/// retry_delay: Duration::from_millis(500),
/// fail_fast: false,
/// };
///
/// // Create and configure the scanner
/// let scanner = Scanner::new(config)
/// .with_rate_limit(1000)
/// .with_concurrency_limit(50);
///
/// // Run the scan
/// let results = scanner.scan().await?;
///
/// // Process results
/// for result in results {
/// if result.is_open {
/// println!(
/// "Port {}: Open - Service: {}, Protocol: {}, Latency: {:?}",
/// result.port,
/// result.service.unwrap_or_else(|| "Unknown".to_string()),
/// result.protocol_info.unwrap_or_else(|| "Unknown".to_string()),
/// result.latency
/// );
/// }
/// }
///
/// Ok(())
/// }
/// ```
/// Command line interface for ntrace
pub use Cli;
pub use NtraceError;
pub use ScanResult;
/// Protocol types and analyzer
pub use ;
/// Core scanner functionality
pub use ;
/// Traceroute functionality
pub use ;