Nmap Development mailing list archives

Re: Script path lookup order


From: John Bond <john.r.bond () gmail com>
Date: Wed, 20 Jun 2012 11:35:48 +0200

Or store your script in. ~/.nmap/scripts/ which is searched first.  On a
related matter it would be nice to have a ~./nmap/nselib/ which had
precedence over the global lib dir
On Jun 19, 2012 5:59 PM, "David Fifield" <david () bamsoftware com> wrote:

On Wed, Jun 13, 2012 at 04:11:41PM +0100, Hani Benhabiles wrote:
Hi list,

I have noticed that when using --script=scriptname, the script is
looked for in the Nmap scripts directory first, before looking in
the current working directory afterward.

Even using --script=./scriptname keeps the same order of path lookup
and we have to provide the full path to the script in the current
directory in order to run it.

So, is there any logic behind this ? I believe that searching for
the script in the current directory first is more logical for
different needs (e.g testing a new version of a script.).

I think it is to be consistent with the other files that are found
through nmap_fetchfile. Like if you happen to have an nmap-services in
the current directory,

Warning: File ./nmap-services exists, but Nmap is using
/usr/local/bin/../share/nmap/nmap-services for security and consistency
reasons.  set NMAPDIR=. to give priority to files in your local directory
(may affect the other data files too).

I don't think checking in the current working directory first will
happen, but you can get something similar by using --datadir or by
running nmap from your working directory.

./nmap

When you run nmap like this, it puts the current working directory at
the beginning of the list of search paths. You might have to put your
script-under-development in the working copy's scripts directory.

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

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


Current thread: