mirror of
https://github.com/nmap/nmap.git
synced 2026-01-23 14:49:02 +00:00
Fall back to TCP connect ping on Windows without pcap
While Windows raw sockets can send and receive ICMP packets, Nmap relies on libpcap packet capture to spot responses, so if pcap isn't available (--unprivileged or Npcap not installed), we need to fall back to TCP connect for host discovery, just like we do for unprivileged users on other operating systems. Previous behavior was a fatal error suggesting unhelpfully to use --unprivileged.
This commit is contained in:
2
nmap.cc
2
nmap.cc
@@ -479,7 +479,6 @@ void validate_scan_lists(scan_lists &ports, NmapOps &o) {
|
||||
o.pingtype |= PINGTYPE_TCP_USE_SYN;
|
||||
}
|
||||
|
||||
#ifndef WIN32 /* Win32 has perfectly fine ICMP socket support */
|
||||
if (!o.isr00t) {
|
||||
if (o.pingtype & (PINGTYPE_ICMP_PING | PINGTYPE_ICMP_MASK | PINGTYPE_ICMP_TS)) {
|
||||
error("Warning: You are not root -- using TCP pingscan rather than ICMP");
|
||||
@@ -490,7 +489,6 @@ void validate_scan_lists(scan_lists &ports, NmapOps &o) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
struct ftpinfo ftp = get_default_ftpinfo();
|
||||
|
||||
Reference in New Issue
Block a user