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

Add an nmap.have_ssl NSE function and use it in the script showHTMLTitle.nse to

avoid doing an SSL probe if SSL is not available.
This commit is contained in:
david
2007-11-22 06:38:23 +00:00
parent 1c59946d7a
commit 3782d2c020
2 changed files with 21 additions and 2 deletions

View File

@@ -11,10 +11,19 @@ license = "See nmaps COPYING for licence"
categories = {"demo", "safe"}
require "shortport"
require "stdnse"
portrule = shortport.service({'http', 'https'})
portrule = function(host, port)
if not (port.service == 'http' or port.service == 'https') then
return false
end
-- Don't bother running on SSL ports if we don't have SSL.
if (port.service == 'https' or port.version.service_tunnel == 'ssl')
and not nmap.have_ssl() then
return false
end
return true
end
action = function(host, port)
local socket, request, result, status, s, title, protocol