From 54fa9ec345e93a78d2af90413edad1ced3c8e115 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 2 Aug 2012 05:28:02 +0000 Subject: [PATCH] Use shortport.http in http-title. --- scripts/http-title.nse | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/http-title.nse b/scripts/http-title.nse index 30f704845..6921fa698 100644 --- a/scripts/http-title.nse +++ b/scripts/http-title.nse @@ -2,6 +2,7 @@ local dns = require "dns" local http = require "http" local ipOps = require "ipOps" local nmap = require "nmap" +local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local url = require "url" @@ -29,20 +30,7 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = {"default", "discovery", "safe"} -portrule = function(host, port) - local svc = { std = { ["http"] = 1, ["http-alt"] = 1 }, - ssl = { ["https"] = 1, ["https-alt"] = 1 } } - if port.protocol ~= 'tcp' - or not ( svc.std[port.service] or svc.ssl[port.service] ) then - return false - end - -- Don't bother running on SSL ports if we don't have SSL. - if (svc.ssl[port.service] or port.version.service_tunnel == 'ssl') - and not nmap.have_ssl() then - return false - end - return true -end +portrule = shortport.http action = function(host, port) local resp, redirect_url, title