1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 09:59:04 +00:00

Rectify an HTTP digest authentication crash. Fixes #1665

This commit is contained in:
nnposter
2019-08-05 00:14:10 +00:00
parent 14b63a8ffe
commit f513575f5c
2 changed files with 7 additions and 3 deletions

View File

@@ -1404,7 +1404,7 @@ function generic_request(host, port, method, path, options)
options_with_auth_removed["auth"] = nil
local r = generic_request(host, port, method, path, options_with_auth_removed)
local h = r.header['www-authenticate']
if not r.status or (h and not string.find(h:lower(), "digest.-realm")) then
if not (r.status and h and h:lower():find("digest.-realm")) then
stdnse.debug1("http: the target doesn't support digest auth or there was an error during request.")
return http_error("The target doesn't support digest auth or there was an error during request.")
end