mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 16:39:03 +00:00
Print the addresses that were resolved but not scanned in each scan
report. It looks like this. $ ./nmap google.com -sn Starting Nmap 5.30BETA1 ( http://nmap.org ) at 2010-05-10 23:57 MDT Nmap scan report for google.com (66.102.7.99) Host is up (0.073s latency). Other addresses for google.com (not scanned): 66.102.7.104 rDNS record for 66.102.7.99: lax04s01-in-f99.1e100.net This replaces the line Hostname google.com resolves to 2 IPs. Only scanned 66.102.7.99
This commit is contained in:
12
output.cc
12
output.cc
@@ -1305,9 +1305,15 @@ void write_host_header(Target *currenths) {
|
||||
write_host_status(currenths, o.resolve_all);
|
||||
if (currenths->TargetName() != NULL
|
||||
&& currenths->resolved_addrs.size() > 1) {
|
||||
log_write(LOG_PLAIN, "Hostname %s resolves to %u IPs. Only scanned %s\n",
|
||||
currenths->TargetName(), (unsigned int) currenths->resolved_addrs.size(),
|
||||
currenths->targetipstr());
|
||||
std::list<struct sockaddr_storage>::iterator it;
|
||||
|
||||
log_write(LOG_PLAIN, "Other addresses for %s (not scanned):",
|
||||
currenths->TargetName());
|
||||
it = currenths->resolved_addrs.begin();
|
||||
it++;
|
||||
for (; it != currenths->resolved_addrs.end(); it++)
|
||||
log_write(LOG_PLAIN, " %s", inet_ntop_ez(&*it, sizeof(*it)));
|
||||
log_write(LOG_PLAIN, "\n");
|
||||
}
|
||||
/* Print reverse DNS if it differs. */
|
||||
if (currenths->TargetName() != NULL
|
||||
|
||||
Reference in New Issue
Block a user