mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Use a legit HTTP probe for detecting SSL in http-slowloris and -check
This commit is contained in:
@@ -91,7 +91,8 @@ the http server's resources causing Denial Of Service.
|
|||||||
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
slowloris.state = vulns.STATE.NOT_VULN
|
slowloris.state = vulns.STATE.NOT_VULN
|
||||||
|
|
||||||
local sd, response, Bestopt = comm.tryssl(host, port, "GET / \r\n\r\n") -- first determine if we need ssl
|
local sd, response, Bestopt = comm.tryssl(host, port, "GET / HTTP/1.0\r\n\r\n") -- first determine if we need ssl
|
||||||
|
if sd then sd:close() end
|
||||||
if Bestopt == "none" then
|
if Bestopt == "none" then
|
||||||
stdnse.debug1("Error determining SSL: %s", response)
|
stdnse.debug1("Error determining SSL: %s", response)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -202,9 +202,10 @@ local function do_monitor(host, port)
|
|||||||
"Host: " .. host.ip ..
|
"Host: " .. host.ip ..
|
||||||
"\r\nUser-Agent: " .. http.USER_AGENT .. "\r\n\r\n"
|
"\r\nUser-Agent: " .. http.USER_AGENT .. "\r\n\r\n"
|
||||||
local opts = {}
|
local opts = {}
|
||||||
local _
|
local sd,_
|
||||||
|
|
||||||
_, _, Bestopt = comm.tryssl(host, port, "GET / \r\n\r\n", opts) -- first determine if we need ssl
|
sd, _, Bestopt = comm.tryssl(host, port, "GET / HTTP/1.0\r\n\r\n", opts) -- first determine if we need ssl
|
||||||
|
if sd then sd:close() end
|
||||||
|
|
||||||
while not StopAll do
|
while not StopAll do
|
||||||
local monitor = nmap.new_socket()
|
local monitor = nmap.new_socket()
|
||||||
|
|||||||
Reference in New Issue
Block a user