Require separate host groups for targets with different source addresses.

This commit is contained in:
david 2011-12-30 18:19:07 +00:00
parent acaade017b
commit 9941656055
2 changed files with 11 additions and 1 deletions

View file

@ -1,5 +1,10 @@
# Nmap Changelog ($Id$); -*-text-*-
o Targets requiring different source addresses now go into different
hostgroups, not only for host discovery but also for port scanning.
Before, only responses to one of the source addresses would be
processed, and the others would be ignored. [David]
o [NSE] Added script broadcast-wpad-discover which detects proxy servers on the
network by using the Web Proxy Auto Discover Protocol (WPAD). [Patrik]

View file

@ -2057,7 +2057,8 @@ int nmap_main(int argc, char *argv[]) {
/* Returns true iff this target is incompatible with the other hosts in the host
group. This happens when:
1. it uses a different interface, or
2. it has the same IP address as another target already in the group.
2. it uses a different source address, or
3. it has the same IP address as another target already in the group.
These restrictions only apply for raw scans. This function is similar to one
of the same name in targets.cc. That one is for ping scanning, this one is
for port scanning. */
@ -2076,6 +2077,10 @@ static bool target_needs_new_hostgroup(std::vector<Target *> &targets,
return true;
}
/* Different source address? */
if (sockaddr_storage_cmp(targets[0]->SourceSockAddr(), target->SourceSockAddr()) != 0)
return true;
/* Is there already a target with this same IP address? ultra_scan doesn't
cope with that, because it uses IP addresses to look up targets from
replies. What happens is one target gets the replies for all probes