1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 01:19:03 +00:00

Added a check for a blank body, due to some false positives I found during a random scan

This commit is contained in:
ron
2009-08-23 04:11:04 +00:00
parent b2a3cd1114
commit f8e2fe6429

View File

@@ -1202,7 +1202,11 @@ function page_exists(data, result_404, known_404, page, displayall)
if(data.status == 200) then
if(result_404 == 200) then
-- If the 404 response is also "200", deal with it (check if the body matches)
if(clean_404(data.body) ~= known_404) then
if(string.len(data.body) == 0) then
-- I observed one server that returned a blank string instead of an error, on some occasions
stdnse.print_debug(1, "http-enum.nse: Page returned a totally empty body; page likely doesn't exist")
return false
elseif(clean_404(data.body) ~= known_404) then
stdnse.print_debug(1, "http-enum.nse: Page returned a body that doesn't match known 404 body, therefore it exists (%s)", page)
return true
else