-
Notifications
You must be signed in to change notification settings - Fork 0
/
os.rs
45 lines (44 loc) · 1.36 KB
/
os.rs
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
fn main() -> Result<(), String> {
#[cfg(feature = "os")]
{
use e_libscanner::os;
use e_libscanner::Opts;
// more command information use: -h
let mut scanner = Opts::new(Some(&[
"e-libscanner",
"--ips",
"192.168.80.8",
"192.168.80.1",
"--ports",
"80",
"135",
"554",
"8000",
"22",
"--model",
"os",
"--no-gui",
"--",
"-AS",
]))?
.init()?
.downcast::<os::Scanner>()
.unwrap();
let results = scanner.scan(None);
for result in results {
println!("{}", result.ip_addr);
println!("{:?}", result.icmp_echo_result);
println!("{:?}", result.icmp_timestamp_result);
println!("{:?}", result.icmp_address_mask_result);
println!("{:?}", result.icmp_information_result);
println!("{:?}", result.icmp_unreachable_ip_result);
println!("{:?}", result.icmp_unreachable_data_result);
println!("{:?}", result.tcp_syn_ack_result);
println!("{:?}", result.tcp_rst_ack_result);
println!("{:?}", result.tcp_ecn_result);
println!("{:?}", result.tcp_header_result);
println!();
}
Ok(())
}
}