mirror of
https://github.com/edu4rdshl/unimap.git
synced 2026-07-17 23:24:49 +00:00
Don't scan private IP addresses.
This commit is contained in:
parent
cde33efba1
commit
36419c3da7
2 changed files with 8 additions and 4 deletions
|
|
@ -67,7 +67,7 @@ pub fn check_full_path(full_path: &str) -> bool {
|
||||||
pub fn delete_files(paths: &HashSet<String>) {
|
pub fn delete_files(paths: &HashSet<String>) {
|
||||||
for file in paths {
|
for file in paths {
|
||||||
if Path::new(&file).exists() {
|
if Path::new(&file).exists() {
|
||||||
match std::fs::remove_file(&file) {
|
match std::fs::remove_file(file) {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(e) => error!("Error deleting the file {}. Description: {}", &file, e),
|
Err(e) => error!("Error deleting the file {}. Description: {}", &file, e),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,11 +214,15 @@ fn parallel_resolver_engine(
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let mut nmap_ips: HashSet<String> = resolv_data
|
let mut nmap_ips: HashSet<String> = resolv_data
|
||||||
.iter()
|
.values()
|
||||||
.map(|(_, resolv_data)| resolv_data.ip.clone())
|
.map(|resolv_data| resolv_data.ip.clone())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
nmap_ips.retain(|ip| !ip.is_empty());
|
nmap_ips.retain(|ip| {
|
||||||
|
!ip.is_empty()
|
||||||
|
&& ip.parse::<Ipv4Addr>().is_ok()
|
||||||
|
&& !ip.parse::<Ipv4Addr>().unwrap().is_private()
|
||||||
|
});
|
||||||
|
|
||||||
let nmap_data: HashMap<String, Nmaprun> = nmap_ips
|
let nmap_data: HashMap<String, Nmaprun> = nmap_ips
|
||||||
.par_iter()
|
.par_iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue