因为nmap扫描是默认使用的是nse脚本,但是在开发的过程中需要修改后缀(主要是因为后缀为lua才能显示高亮,所以这里用一个取巧的办法)
nse_main.lua文件中我们找到如下代码
local t, path = cnse.fetchscript(rule);
if t == nil then -- perhaps omitted the extension?
t, path = cnse.fetchscript(rule..".nse");
end
大家可以看到其实我们载入nse脚本扫描的过程中系统如果识别不出来才在后面加上一个nse后缀
我们可以在这里取个巧
local t, path = cnse.fetchscript(rule);
if t == nil then -- perhaps omitted the extension?
t, path = cnse.fetchscript(rule..".nse");
end
if t == nil then -- perhaps omitted the extension with lua?
t, path = cnse.fetchscript(rule..".lua");
end
代码很简单找不到nse后缀继续找lua后缀的脚本载入
/--------------------
默认default情况下的修改我还在找