Nmap Development mailing list archives

running scripts from directories


From: Robin Wood <robin () digininja org>
Date: Sun, 12 May 2013 21:16:14 +0100

Hi
I'm playing with running groups of scripts from a single directory but
can't get it working. I thought you just specified the directory name to
the script parameter but when I try that I get the following error:

./nmap  localhost --script=/tmp/nmap

Starting Nmap 6.25 ( http://nmap.org ) at 2013-05-12 21:05 BST
NSE: Warning: Loading '/tmp/nmap' -- the recommended file extension is
'.nse'.
NSE: failed to initialize the script engine:
/usr/src/nmap-6.25/nse_main.lua:234: /usr/src/nmap-6.25/nse_main.lua:227:
Is a directory
stack traceback:
        [C]: in ?
        [C]: in function 'load'
        /usr/src/nmap-6.25/nse_main.lua:234: in function 'loadscript'
        /usr/src/nmap-6.25/nse_main.lua:505: in function 'new'
        /usr/src/nmap-6.25/nse_main.lua:765: in function
'get_chosen_scripts'
        /usr/src/nmap-6.25/nse_main.lua:1239: in main chunk
        [C]: in ?
stack traceback:
        [C]: in function 'assert'
        /usr/src/nmap-6.25/nse_main.lua:234: in function 'loadscript'
        /usr/src/nmap-6.25/nse_main.lua:505: in function 'new'
        /usr/src/nmap-6.25/nse_main.lua:765: in function
'get_chosen_scripts'
        /usr/src/nmap-6.25/nse_main.lua:1239: in main chunk
        [C]: in ?

QUITTING!

But it does work if I add a * to it or if I specify a single file, both of
these work:

./nmap --script /tmp/nmap/* localhost
./nmap --script /tmp/nmap/sshv1.nse localhost

I'd guess this is because the shell is doing the expansion and nmap sees it
as a list of individual files as this fails:
./nmap --script "/tmp/nmap/*" localhost

I also can't get it to work specifying a directory/file and a category,
according to the docs this should work:
../nmap --script default,/tmp/nmap/ss* localhost

Starting Nmap 6.25 ( http://nmap.org ) at 2013-05-12 21:14 BST
NSE: failed to initialize the script engine:
/usr/src/nmap-6.25/nse_main.lua:753: '/tmp/nmap/ss*' did not match a
category, filename, or directory
stack traceback:
        [C]: in function 'error'
        /usr/src/nmap-6.25/nse_main.lua:753: in function
'get_chosen_scripts'
        /usr/src/nmap-6.25/nse_main.lua:1239: in main chunk
        [C]: in ?

QUITTING!

Is something broken or am I doing something wrong?

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


Current thread: