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:
@@ -47,7 +47,7 @@ action = function(host, port)
|
|||||||
end
|
end
|
||||||
local output = stdnse.output_table()
|
local output = stdnse.output_table()
|
||||||
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
|
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
|
if open_session and open_session.status == 200 then
|
||||||
local _, _, source = string.find(open_session.body, "<data_source>(.-)</data_source>")
|
local _, _, source = string.find(open_session.body, "<data_source>(.-)</data_source>")
|
||||||
if source == nil then
|
if source == nil then
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ including PPPoE credentials, firmware version, model, gateway, dns servers and a
|
|||||||
end
|
end
|
||||||
|
|
||||||
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
|
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
|
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 _, _, 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>')
|
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)
|
return vuln_report:make_output(vuln)
|
||||||
end
|
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
|
if ppp.status and ppp.status == 200 then
|
||||||
local _, _, ppp_pwd = string.find(ppp.body, 'var pwdppp = "(.-)"')
|
local _, _, ppp_pwd = string.find(ppp.body, 'var pwdppp = "(.-)"')
|
||||||
info = string.format("%sPPPoE password:%s", info, ppp_pwd)
|
info = string.format("%sPPPoE password:%s", info, ppp_pwd)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ action = function(host, port)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Perform a GET request on the file
|
-- 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
|
if(not(result)) then
|
||||||
return stdnse.format_output(false, "Couldn't perform GET request")
|
return stdnse.format_output(false, "Couldn't perform GET request")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ untrusted website and XSS injection.]],
|
|||||||
|
|
||||||
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
|
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
local header = { ["Referer"] = '"><script>alert("XSS")</script><"' }
|
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
|
if open_session and open_session.status == 404 then
|
||||||
stdnse.debug2("got 404-that's good!")
|
stdnse.debug2("got 404-that's good!")
|
||||||
if open_session.body:match('"><script>alert%("XSS"%)</script><"') then
|
if open_session.body:match('"><script>alert%("XSS"%)</script><"') then
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ network's Active Directory.]],
|
|||||||
}
|
}
|
||||||
|
|
||||||
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
|
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
|
if open_session and open_session.status ==200 and string.len(open_session.body)>200 then
|
||||||
local s = open_session.body:gsub("%z", ".")
|
local s = open_session.body:gsub("%z", ".")
|
||||||
vuln.state = vulns.STATE.EXPLOIT
|
vuln.state = vulns.STATE.EXPLOIT
|
||||||
|
|||||||
Reference in New Issue
Block a user