1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 21:51:28 +00:00

Fixes false positive when dealing with web servers returning status 200 for all reqs

This commit is contained in:
paulino
2012-07-04 17:57:22 +00:00
parent 1e8babf64a
commit bc3eb43f72

View File

@@ -1,10 +1,3 @@
local http = require "http"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local openssl = stdnse.silent_require "openssl"
description = [[ description = [[
Obtains the CakePHP version of a web application built with the CakePHP framework by fingerprinting default files shipped with the CakePHP framework. Obtains the CakePHP version of a web application built with the CakePHP framework by fingerprinting default files shipped with the CakePHP framework.
@@ -32,6 +25,12 @@ author = "Paulino Calderon"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html" license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery","safe"} categories = {"discovery","safe"}
local http = require "http"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local openssl = stdnse.silent_require "openssl"
portrule = shortport.http portrule = shortport.http
@@ -59,7 +58,13 @@ action = function(host, port)
local icon_hash, stylesheet_hash local icon_hash, stylesheet_hash
local output_lines local output_lines
local installation_version local installation_version
local _, http_status, _ = http.identify_404( host.ip,port)
if ( http_status == 200 ) then
stdnse.print_debug(1, "%s:HTTP server always return status 200. Exiting to avoid false positives", SCRIPT_NAME)
return false
end
-- Are the default icons there? -- Are the default icons there?
png_icon_response = http.get(host, port, PNG_ICON_QUERY) png_icon_response = http.get(host, port, PNG_ICON_QUERY)
gif_icon_response = http.get(host, port, GIF_ICON_QUERY) gif_icon_response = http.get(host, port, GIF_ICON_QUERY)