1
0
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:
dmiller
2017-03-23 22:42:02 +00:00
parent b4f10146e4
commit 87fb195c3f
2 changed files with 5 additions and 3 deletions

View File

@@ -91,7 +91,8 @@ the http server's resources causing Denial Of Service.
local report = vulns.Report:new(SCRIPT_NAME, host, port)
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
stdnse.debug1("Error determining SSL: %s", response)
return nil

View File

@@ -202,9 +202,10 @@ local function do_monitor(host, port)
"Host: " .. host.ip ..
"\r\nUser-Agent: " .. http.USER_AGENT .. "\r\n\r\n"
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
local monitor = nmap.new_socket()