From 5318dd3c58fc634a7d87d86c9ff2d81ca9884a8a Mon Sep 17 00:00:00 2001 From: david Date: Fri, 12 Mar 2010 21:20:05 +0000 Subject: [PATCH] Only write host elements for down hosts to XML in verbose mode. This makes it consistent with other output formats. --- nmap.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nmap.cc b/nmap.cc index 6ad87aade..f76d2599d 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1766,9 +1766,11 @@ int nmap_main(int argc, char *argv[]) { /* I used to check that !currenths->weird_responses, but in some rare cases, such IPs CAN be port successfully scanned and even connected to */ if (!(currenths->flags & HOST_UP)) { - log_write(LOG_XML, ""); - write_host_header(currenths); - log_write(LOG_XML, "\n"); + if (o.verbose) { + log_write(LOG_XML, ""); + write_host_header(currenths); + log_write(LOG_XML, "\n"); + } delete currenths; o.numhosts_scanned++; continue;