Nmap Development mailing list archives

Re: [NSE] Script Arguments with Environment Variables


From: Fyodor <fyodor () insecure org>
Date: Fri, 11 Jun 2010 00:38:51 -0700

On Fri, Jun 11, 2010 at 12:27:06AM -0700, Fyodor wrote:
On Thu, Jun 03, 2010 at 08:57:06AM -0400, Patrick Donnelly wrote:

If someone is changing their shell startup files anyway, maybe they
can just alias nmap to "nmap --script-args whatever" rather than set
an environmental variable.  That has the advantage of working with
other options too.  Like maybe they always want -v and -T4 in their
scans, or a certain -S option on a machine with many IP aliases.  And
most shells provide an easy way to turn off the alias expansion for
one execution (for example you can specify the full path name of
Nmap).

Oh, one other way I've seen people deal with this is to define
environmental variables in their startup files which correspond to
favorite Nmap options and targets.  For example, they might have:

INTENSESCAN="-p- -A -T4 -v --script-args http.useragent='Mozilla/5.0 (compatible; Googlebot/2.1; 
+http://www.google.com/bot.html)'"
LIGHTSCAN="-F -T4 -v"
PRODIPS="161.225.130.163/16 72.21.207.225/24"
LOCALIPS="192.168.0.0/16 10.0-1.0-255.0-255"

Then they can do things like "nmap $INTENSESCAN $PRODIPS"

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


Current thread: