Nmap Development mailing list archives
Re: [NSE] hostmap-ip2hosts
From: David Fifield <david () bamsoftware com>
Date: Sat, 27 Apr 2013 09:40:33 -0700
On Sat, Apr 06, 2013 at 05:10:55PM -0600, Paulino Calderon wrote:
I've been using a version of this script for host mapping for a while and I finally update it today to add XML output support. I've been running the service ip2hosts.com for about two years and it uses BING's host db.
I have some suggestions for the XML output formatting. Here is what it looks like now: <script id="hostmap-ip2hosts"> <elem key="ip">173.255.243.189</elem> <elem key="hosts">
http://insecure.org
http://nmap.org
http://sectools.org
https://svn.nmap.org
http://cgi.insecure.org</elem> <elem key="output">Saved to hostmap-nmap.org
</elem> </script> It should rather look like this: <script id="hostmap-ip2hosts"> <table key="domains"> <elem>insecure.org</elem> <elem>nmap.org</elem> <elem>sectools.org</elem> <elem>svn.nmap.org</elem> <elem>cgi.insecure.org</elem> </table> <elem key="filename">hostmap-nmap.org</elem> </script> That is, remove the "ip" output because that is already part of the output. Remove the http:// prefixes so the output is domain names and not URLs, and put the names in an actual array, not a text string. Just use output.domains = hostnames not output.domains = "\n" .. stdnse.strjoin("\n", hostnames) Structured output should be in the form that is convenient for a programmer--you shouldn't have to re-split the hostnames array. There shouldn't be human-readable labels like "Saved to" nor extra newlines in structured output. You should also add a sample of the structured output in an @xmloutput tag. Do you think you could make these structured output changes in the other hostmap scripts as well? David Fifield _______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- [NSE] hostmap-robtex and http-robtex-reverse-ip -- Same thing? Daniel Miller (Apr 01)
- Re: [NSE] hostmap-robtex and http-robtex-reverse-ip -- Same thing? Fyodor (Apr 06)
- Re: [NSE] hostmap-robtex and http-robtex-reverse-ip -- Same thing? Paulino Calderon (Apr 06)
- Re: [NSE] hostmap-ip2hosts David Fifield (Apr 27)
- Re: [NSE] hostmap-ip2hosts Paulino Calderon (Apr 29)
- Re: [NSE] hostmap-ip2hosts David Fifield (Apr 29)
- Re: [NSE] hostmap-robtex and http-robtex-reverse-ip -- Same thing? Paulino Calderon (Apr 06)
- Re: [NSE] hostmap-robtex and http-robtex-reverse-ip -- Same thing? Fyodor (Apr 06)