Home page logo

nmap-dev logo Nmap Development mailing list archives

Log bogus targets in XML
From: David Fifield <david () bamsoftware com>
Date: Thu, 26 Apr 2012 23:53:49 -0700

Currently if you give Nmap a syntactically invalid target specification
or one that can't be resolved, you get warnings like these:

$ ./nmap 1:2 3.4.5 '[]'

Starting Nmap 5.61TEST5 ( http://nmap.org ) at 2012-04-26 23:51 PDT
Invalid host expression: 1:2 -- colons only allowed in IPv6 addresses, and then you need the -6 switch
Invalid target host specification: 3.4.5
Invalid character in host specification: [].  Note in particular that square brackets [] are no longer allowed.  
They were redundant and can simply be removed.

However there's no machine-readable way to see that this happened, other
than to read stderr. Here is a patch that adds this information to the
XML output in a new target element.

<target specification="1:2" status="skipped"/>
<target specification="3.4.5" status="skipped"/>
<target specification="[]" status="skipped"/>

David Fifield

Attachment: bogus-target.patch

Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]