mirror of
https://github.com/nmap/nmap.git
synced 2026-01-02 21:09:00 +00:00
Include the reason why a host is down with --reason. It looks like this:
Nmap scan report for 1.2.3.4 [host down, received time-exceeded] Nmap scan report for 1.2.3.5 [host down, received no-response]
This commit is contained in:
10
output.cc
10
output.cc
@@ -1425,10 +1425,14 @@ static char *num_to_string_sigdigits(double d, int digits) {
|
||||
including host status and DNS records. */
|
||||
void write_host_header(Target *currenths) {
|
||||
if ((currenths->flags & HOST_UP) || o.verbose || o.resolve_all) {
|
||||
if (currenths->flags & HOST_UP)
|
||||
if (currenths->flags & HOST_UP) {
|
||||
log_write(LOG_PLAIN, "Nmap scan report for %s\n", currenths->NameIP());
|
||||
else if (currenths->flags & HOST_DOWN)
|
||||
log_write(LOG_PLAIN, "Nmap scan report for %s [host down]\n", currenths->NameIP());
|
||||
} else if (currenths->flags & HOST_DOWN) {
|
||||
log_write(LOG_PLAIN, "Nmap scan report for %s [host down", currenths->NameIP());
|
||||
if (o.reason)
|
||||
log_write(LOG_PLAIN, ", %s", target_reason_str(currenths));
|
||||
log_write(LOG_PLAIN, "]\n");
|
||||
}
|
||||
}
|
||||
write_host_status(currenths, o.resolve_all);
|
||||
if (currenths->TargetName() != NULL
|
||||
|
||||
Reference in New Issue
Block a user