Nmap Development mailing list archives
Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family()
From: Kris Katterjohn <katterjohn () gmail com>
Date: Thu, 26 Aug 2010 23:36:20 -0500
On 08/26/10 17:01, David Fifield wrote:
On Wed, Aug 11, 2010 at 02:03:14AM -0500, Kris Katterjohn wrote:I've merged the Script Pre-scanning and Post-scanning phases to Nmap trunk. I hope that we'll see lot of scripts that make use of them.I've attached a patch and new prerule script for adding new targets to Nmap (target adding functionality is still not in trunk yet, but here's this anyway like my snmp-interfaces changes). The script is called resolveall and just takes a host as it's only argument, resolveall.host. Several months ago there was discussion on Nmap scanning all addresses for a given host name, which is a very bad idea for default behavior. As far as I know, nothing else came of this (no options, etc), so I decided to write this. I've also added general functions to the nmap library: resolve(host,af) takes a name and optional address family ("inet", etc) and returns a table with all of the addresses; address_family() returns Nmap's o.af() value as "inet" or "inet6" like resolve() expects. If resolve() is not given an address family then it doesn't care and returns all addresses.I think that resolve and address_family look good. Please commit them. To document them, you just add a phony function in nselib/nmap.luadoc.
Great, I've committed these as r19980.
As for the script, it looks good to me but nobody has had much to say about it. One suggestion I would make is to allow the script argument to take an array of host names, not just a single one. It would be like this: --script-args='newtargets,resolveall.hosts={host1,host2}'
Yeah, that makes more sense: I've attached an updated script which works that way. Thanks for looking at it.
David Fifield
Cheers, Kris KatterjohnP.S. I may be with limited to no internet access during the next several days, in case of any replies.
Attachment:
resolveall.nse
Description:
_______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Re: [NSE] Script Pre-scanning and Post-scanning example, (continued)
- Re: [NSE] Script Pre-scanning and Post-scanning example David Fifield (Sep 27)
- Re: [NSE] Script Pre-scanning and Post-scanning example Kris Katterjohn (Sep 27)
- [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Kris Katterjohn (Aug 11)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Djalal Harouni (Aug 11)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Patrik Karlsson (Aug 12)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Patrick Donnelly (Aug 12)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Fyodor (Aug 15)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Patrik Karlsson (Aug 15)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Djalal Harouni (Aug 11)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Djalal Harouni (Aug 12)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Kris Katterjohn (Aug 26)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() David Fifield (Sep 27)
- Re: [NSE] resolveall prerule, nmap.resolve(), nmap.address_family() Kris Katterjohn (Sep 27)