Search code examples
luanmapwinpcapport-scanning

NSE: failed to initialize the script engine:


I'm new to VAPT and I'm using GUI for windows, this is what I got when I used this script from nmap online guide [nmap -p 80 --script http-default-accounts.routers xx.xx.xx.xx]. I borrowed the script from here : https://nmap.org/nsedoc/scripts/http-default-accounts.html

[nmap -p 80 --script http-default-accounts.routers xx.xx.xx.xx]

Nmap output begins below this line:

NSE: failed to initialize the script engine:

C:\Program Files (x86)\Nmap/nse_main.lua:823: 'http-default-accounts.category' did not match a category, filename, or directory

stack traceback:

[C]: in function 'error'

C:\Program Files (x86)\Nmap/nse_main.lua:823: in local 'get_chosen_scripts'

C:\Program Files (x86)\Nmap/nse_main.lua:1315: in main chunk

[C]: in ? QUITTING!


Solution

  • Nmap uses the --script option to introduce a boolean expression of script names and categories to run. To provide arguments to these scripts, you use the --script-args option. So what you wanted to run was: nmap --script http-default-accounts --script-args http-default-accounts.category=routers

    In most cases, you can leave the script name off of the script argument name, as long as you realize that another script may also be looking for an argument called category. For example: nmap --script http-default-accounts --script-args category=routers