Nmap Development mailing list archives

Re: [NSE][patch] Load script-args from a file


From: Fyodor <fyodor () insecure org>
Date: Sat, 18 Jun 2011 14:42:38 -0700

On Wed, Jun 15, 2011 at 10:12:02PM -0500, Daniel Miller wrote:

Here's a patch to let users specify a file from which to load
script-args. Example:

$ cat ~/.nmap/myargs
smbdomain=WORKGROUP,
smbpassword=MyPa$$,

$ nmap --script smb-* --script-args file=myargs target.example.com

Simply put, it checks for a script-arg of "file", parses the contents
of the file the same way we currently parse the argument to --script-args,
combines it with any arguments on the command line, then goes about
business as usual. Any arguments on the command line supersede ones in the
file. The file can be an absolute path, or a path relative to Nmap's usual
search path (NMAPDIR, etc.)

Thanks Dan.  That does sound like it might be useful.  It would be
interesting to hear other people's take on this (e.g. who here is
likely to use this)?  From a UI perspective, I think it would be
better to add a separate Nmap option (e.g. --script-args-file) rather
than to make the "file" script argument name be magic.  That would be
consistent with the way we offer both --exclude and --excludefile
rather than providing a syntax to --exclude that causes it to load a
file.

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: