1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-03 12:06:35 +00:00

merge soc07 r4906 - NSE bugfixes

This commit is contained in:
fyodor
2007-08-11 04:16:56 +00:00
parent f69d93c65a
commit 88b0e212df
3 changed files with 81 additions and 61 deletions

View File

@@ -267,6 +267,12 @@ int init_updatedb(lua_State* l) {
)
lua_newtable(l);
/*give the script global namespace access*/
lua_newtable(l);
lua_getglobal(l, "_G");
lua_setfield(l, -2, "__index");
lua_setmetatable(l, -2);
for(iter = files.begin(); iter != files.end(); iter++) {
c_iter = strdup((*iter).c_str());
if(check_extension(SCRIPT_ENGINE_EXTENSION, c_iter) == MATCH

View File

@@ -1,43 +1,49 @@
module(...)
protorule = function(porttab, service, proto, state)
state = state or "open"
proto = proto or "tcp"
if porttab.service==service
and porttab.protocol == proto
and porttab.state == state
then
return true;
else
return false;
end
end
portnumber = function(porttab, number, proto, state)
state = state or "open"
proto = proto or "tcp"
if porttab.number==number
and porttab.protocol == proto
and porttab.state ==state
then
return true;
else
return false;
end
end
port_in_list = function(porttab, proto, ...)
if not porttab.protocol==proto
then
return false
end
for i, v in ipairs{...} do
if porttab.number == v then
return true
protorule = function(service, proto, state)
return function(host,port)
state = state or "open"
proto = proto or "tcp"
if port.service==service
and port.protocol == proto
and port.state == state
then
return true;
else
return false;
end
end
return false
end
portnumber = function(number, proto, state)
return function(host,port)
state = state or "open"
proto = proto or "tcp"
if port.number==number
and port.protocol == proto
and port.state ==state
then
return true;
else
return false;
end
end
end
port_in_list = function(proto, ...)
local list={...}
return function(host,port)
if not port.protocol==proto
then
return false
end
for _, v in ipairs(list) do
if port.number == v then
return true
end
end
return false
end
end
port_or_service = function(number, service, proto, state)

View File

@@ -1,25 +1,33 @@
Entry{ category = "intrusive", filename = "./scripts//dns-test-open-recursion.nse" }
Entry{ category = "backdoor", filename = "./scripts//RealVNC_auth_bypass.nse" }
Entry{ category = "safe", filename = "./scripts//showOwner.nse" }
Entry{ category = "intrusive", filename = "./scripts//SSLv2-support.nse" }
Entry{ category = "malware", filename = "./scripts//ircZombieTest.nse" }
Entry{ category = "version", filename = "./scripts//skype_v2-version.nse" }
Entry{ category = "demo", filename = "./scripts//echoTest.nse" }
Entry{ category = "discovery", filename = "./scripts//ripeQuery.nse" }
Entry{ category = "demo", filename = "./scripts//chargenTest.nse" }
Entry{ category = "backdoor", filename = "./scripts//strangeSMTPport.nse" }
Entry{ category = "demo", filename = "./scripts//showSMTPVersion.nse" }
Entry{ category = "demo", filename = "./scripts//showHTMLTitle.nse" }
Entry{ category = "safe", filename = "./scripts//showHTMLTitle.nse" }
Entry{ category = "backdoor", filename = "./scripts//mswindowsShell.nse" }
Entry{ category = "intrusive", filename = "./scripts//anonFTP.nse" }
Entry{ category = "malware", filename = "./scripts//kibuvDetection.nse" }
Entry{ category = "malware", filename = "./scripts//SMTP_openrelay_test.nse" }
Entry{ category = "discovery", filename = "./scripts//nbstat.nse" }
Entry{ category = "safe", filename = "./scripts//nbstat.nse" }
Entry{ category = "", filename = "./scripts//showHTTPVersion.nse" }
Entry{ category = "intrusive", filename = "./scripts//SSHv1-support.nse" }
Entry{ category = "intrusive", filename = "./scripts//ftpbounce.nse" }
Entry{ category = "vulnerability", filename = "./scripts//xamppDefaultPass.nse" }
Entry{ category = "demo", filename = "./scripts//showSSHVersion.nse" }
Entry{ category = "demo", filename = "./scripts//daytimeTest.nse" }
Entry{ category = "intrusive", filename = "SSLv2-support.nse" }
Entry{ category = "discovery", filename = "finger.nse" }
Entry{ category = "demo", filename = "showSSHVersion.nse" }
Entry{ category = "vulnerability", filename = "xamppDefaultPass.nse" }
Entry{ category = "intrusive", filename = "HTTPAuth.nse" }
Entry{ category = "intrusive", filename = "dns-test-open-recursion.nse" }
Entry{ category = "demo", filename = "showHTMLTitle.nse" }
Entry{ category = "safe", filename = "showHTMLTitle.nse" }
Entry{ category = "discovery", filename = "nbstat.nse" }
Entry{ category = "safe", filename = "nbstat.nse" }
Entry{ category = "backdoor", filename = "mswindowsShell.nse" }
Entry{ category = "demo", filename = "showSMTPVersion.nse" }
Entry{ category = "safe", filename = "showOwner.nse" }
Entry{ category = "backdoor", filename = "RealVNC_auth_bypass.nse" }
Entry{ category = "demo", filename = "daytimeTest.nse" }
Entry{ category = "", filename = "showHTTPVersion.nse" }
Entry{ category = "demo", filename = "chargenTest.nse" }
Entry{ category = "intrusive", filename = "SSHv1-support.nse" }
Entry{ category = "discovery", filename = "MSSQLm.nse" }
Entry{ category = "intrusive", filename = "MSSQLm.nse" }
Entry{ category = "demo", filename = "echoTest.nse" }
Entry{ category = "version", filename = "skype_v2-version.nse" }
Entry{ category = "intrusive", filename = "SMTP_openrelay_test.nse" }
Entry{ category = "intrusive", filename = "anonFTP.nse" }
Entry{ category = "discovery", filename = "ripeQuery.nse" }
Entry{ category = "backdoor", filename = "strangeSMTPport.nse" }
Entry{ category = "discovery", filename = "SNMPsysdesr.nse" }
Entry{ category = "safe", filename = "SNMPsysdesr.nse" }
Entry{ category = "malware", filename = "ircZombieTest.nse" }
Entry{ category = "intrusive", filename = "ftpbounce.nse" }
Entry{ category = "discovery", filename = "SMTPcommands.nse" }
Entry{ category = "intrusive", filename = "SMTPcommands.nse" }
Entry{ category = "malware", filename = "kibuvDetection.nse" }