Nmap Development mailing list archives

Re: Log bogus targets in XML


From: David Fifield <david () bamsoftware com>
Date: Fri, 4 May 2012 08:15:20 -0700

On Thu, Apr 26, 2012 at 11:53:49PM -0700, David Fifield wrote:
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 '[6.7.8.9]'

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: [6.7.8.9].  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="[6.7.8.9]" status="skipped"/>

I committed this with an extra "reason" attribute.

<target specification="1.2.3.4.5" status="skipped" reason="invalid"/>

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: