From b0c8a758a0dc820a76b498403cac39aab392f055 Mon Sep 17 00:00:00 2001 From: patrik Date: Tue, 24 Jul 2012 10:11:09 +0000 Subject: [PATCH] fixed bug where script would return "Host is safe to browse.", when an invalid API key was being used. --- scripts/http-google-malware.nse | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/http-google-malware.nse b/scripts/http-google-malware.nse index 917e75a55..dc5c4c221 100644 --- a/scripts/http-google-malware.nse +++ b/scripts/http-google-malware.nse @@ -77,6 +77,10 @@ action = function(host, port) local req = http.get_url(qry) stdnse.print_debug(2, "%s", qry) + if ( req.status == 403 ) then + return "[ERROR] 403 Forbidden (invalid API key?)" + end + --The Safe Lookup API responds with a type when site is on the lists if req.body then if http.response_contains(req, "malware") then