Nmap Development mailing list archives

Re: http-slowloris-check.nse script error


From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 30 Aug 2012 19:17:58 -0500

Christopher,

This appears to happen because comm.tryssl() on line 123 cannot
connect to the target port, and so returns "none" for Bestopt. This
patch should avoid the error by ending the script at that point, but
there may be a larger issue. Can you reproduce this reliably?

--- a/scripts/http-slowloris-check.nse
+++ b/scripts/http-slowloris-check.nse
@@ -121,6 +121,10 @@ so, it starves the http server's resources
causing Denial Of Service.

        local _
        _, _, Bestopt = comm.tryssl(host, port, "GET / \r\n\r\n", {})
-- first determine if we need ssl
+       if Bestopt == "none" then
+               stdnse.print_debug("%s: Could not connect to port", SCRIPT_NAME)
+               return nil
+       end
        HalfHTTP = "POST /" .. tostring(math.random(100000, 900000))
.. " HTTP/1.1\r\n" ..
                          "Host: " .. host.ip .. "\r\n" ..
                          "User-Agent: " .. http.USER_AGENT .. "\r\n; " ..


Please let us know if there is any way to reliably reproduce the issue.

Dan

On Wed, Aug 29, 2012 at 3:15 PM, Christopher Clements
<christopher.a.clements () gmail com> wrote:
Received this error during a scan today with svn version 29697 (sanitized)

NSE: 'http-slowloris-check' worker (thread: 0x38b37b0) against
xx.xx.xx.xx:443 threw an error!
...local/bin/../share/nmap/scripts/http-slowloris-check.nse:75: bad
argument #3 to 'connect' (invalid option 'none')
stack traceback:
[C]: in function 'connect'
...local/bin/../share/nmap/scripts/http-slowloris-check.nse:75: in function
'main'
/usr/local/bin/../share/nmap/nse_main.lua:826: in function
</usr/local/bin/../share/nmap/nse_main.lua:826>
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: