1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Change some http scripts to use host table instead of IP in requests

This commit is contained in:
dmiller
2017-08-10 15:23:19 +00:00
parent 6c62fb6a74
commit 987680e7b6
5 changed files with 6 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ action = function(host, port)
end
local output = stdnse.output_table()
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
local open_session = http.get(host.ip, port, "/system/user/scn_user_list")
local open_session = http.get(host, port, "/system/user/scn_user_list")
if open_session and open_session.status == 200 then
local _, _, source = string.find(open_session.body, "<data_source>(.-)</data_source>")
if source == nil then

View File

@@ -91,7 +91,7 @@ including PPPoE credentials, firmware version, model, gateway, dns servers and a
end
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
local open_session = http.get(host.ip, port, "/Listadeparametros.html")
local open_session = http.get(host, port, "/Listadeparametros.html")
if open_session and open_session.status == 200 then
local _, _, pppoe_user = string.find(open_session.body, 'Usuario PPPoE:</td><TD class=tablerowvalue>\n(.-)</td></tr><tr>')
local _, _, model = string.find(open_session.body, 'Modelo de m\195\179dem:</td><TD class=tablerowvalue>\n(.-)</td></tr><tr>')
@@ -116,7 +116,7 @@ including PPPoE credentials, firmware version, model, gateway, dns servers and a
return vuln_report:make_output(vuln)
end
local ppp = http.get(host.ip, port, "/wanfun.js")
local ppp = http.get(host, port, "/wanfun.js")
if ppp.status and ppp.status == 200 then
local _, _, ppp_pwd = string.find(ppp.body, 'var pwdppp = "(.-)"')
info = string.format("%sPPPoE password:%s", info, ppp_pwd)

View File

@@ -56,7 +56,7 @@ action = function(host, port)
end
-- Perform a GET request on the file
result = http.get_url("http://" .. host.ip .. ":" .. port.number .. "/ts/in.cgi?open2")
result = http.get(host, port, "/ts/in.cgi?open2")
if(not(result)) then
return stdnse.format_output(false, "Couldn't perform GET request")
end

View File

@@ -66,7 +66,7 @@ untrusted website and XSS injection.]],
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
local header = { ["Referer"] = '"><script>alert("XSS")</script><"' }
local open_session = http.get(host.ip, port, "/"..stdnse.generate_random_string(16), { header = header })
local open_session = http.get(host, port, "/"..stdnse.generate_random_string(16), { header = header })
if open_session and open_session.status == 404 then
stdnse.debug2("got 404-that's good!")
if open_session.body:match('"><script>alert%("XSS"%)</script><"') then

View File

@@ -80,7 +80,7 @@ network's Active Directory.]],
}
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
local open_session = http.get(host.ip, port, "/PSBlock")
local open_session = http.get(host, port, "/PSBlock")
if open_session and open_session.status ==200 and string.len(open_session.body)>200 then
local s = open_session.body:gsub("%z", ".")
vuln.state = vulns.STATE.EXPLOIT