From 537726defa39f39033e36f8f7fb847dbc7b6c833 Mon Sep 17 00:00:00 2001 From: ron Date: Wed, 2 Sep 2009 14:12:03 +0000 Subject: [PATCH] Added '503 Service Unavailable' to the list of recognized error codes for 404 errors. I observed this on a 'Microsoft Project Server' host that gave valid results (though odd 404s). I also changed the code such that the scan will still run, even if an unrecognized error code is encountered. --- nselib/http.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index 7a366b91f..3e4a9735e 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -1278,7 +1278,7 @@ end -- body is the cleaned-up body (or a hash of the cleaned-up body). function identify_404(host, port) local data - local bad_responses = { 301, 302, 400, 401, 403, 499, 501 } + local bad_responses = { 301, 302, 400, 401, 403, 499, 501, 503 } -- The URLs used to check 404s local URL_404_1 = '/nmaplowercheck' .. os.time(os.date('*t')) @@ -1362,7 +1362,7 @@ function identify_404(host, port) stdnse.print_debug(1, "Unexpected response returned for 404 check: %s", get_status_string(data)) -- io.write("\n\n" .. nsedebug.tostr(data) .. "\n\n") - return false, string.format("Unexpected response returned for 404 check: %s", get_status_string(data)) + return true, data.status end ---Determine whether or not the page that was returned is a 404 page. This is actually a pretty simple function,