NSE:无法初始化脚本引擎:

我是一名新手 VAPT,我正在使用 Windows 的 GUI,当我使用此脚本从 nmap 的在线指南中使用时,这就是我得到的 [nmap -p 80 --script http-default-accounts.routers xx.xx.xx.xx]。我从这里借用了脚本:https://nmap.org/nsedoc/scripts/http-default-accounts.html

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

Nmap 输出从以下行开始:

NSE:无法初始化脚本引擎:

C:\Program Files (x86)\Nmap/nse_main.lua:823: 'http-default-accounts.category' 未匹配类别、文件名或目录

堆栈回溯:

[C]:在函数中 'error'

C:\Program Files (x86)\Nmap/nse_main.lua:823: 在本地获取脚本

C:\Program Files (x86)\Nmap/nse_main.lua:1315: 在主块中

[C]:在? QUITTING!

点赞
用户1183387
用户1183387

Nmap使用 --script 选项来引入脚本名称和类别的布尔表达式运行。为了为这些脚本提供参数,你要使用 --script-args 选项。所以你想运行的命令是:nmap --script http-default-accounts --script-args http-default-accounts.category=routers

在大多数情况下,你可以将脚本名称从脚本参数名称中省略掉,只要你意识到另一个脚本也可能在寻找名为 category 的参数。例如:nmap --script http-default-accounts --script-args category=routers

2019-07-03 16:23:13
用户16691325
用户16691325

如果您正在使用以下命令:

nmap --script vulscan.nmap-vulners -sV {target}

那么请改用以下命令。

nmap -sV --script vulners {target}

对我而言,这个命令是有效的。

2021-08-17 19:30:11
用户10324295
用户10324295

关于 Nmap 7.90 [2020-10-03] changelog,处理目录的方式已经改变:

[GH#2051] 限制 Nmap 对脚本和数据文件的搜索路径。在 Unix 和 Linux 上定义为 ${prefix}/share/nmap 的 NMAPDATADIR,在 Windows 上不再搜索,而以前定义为 C:\Nmap。此外,--script 选项不会解释名称作为目录名称,除非后面跟着 /。[ Daniel Miller]

所以,如果你使用的是 Kali,而以下是你的旧命令:

nmap --script vulscan -sV ###.###.###.###

它应该改为:

nmap --script vulscan/ -sV ###.###.###.###

在目录名称后面添加 /

2022-03-23 13:56:51