mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 21:19:01 +00:00
Use shortport.http in http-title.
This commit is contained in:
@@ -2,6 +2,7 @@ local dns = require "dns"
|
|||||||
local http = require "http"
|
local http = require "http"
|
||||||
local ipOps = require "ipOps"
|
local ipOps = require "ipOps"
|
||||||
local nmap = require "nmap"
|
local nmap = require "nmap"
|
||||||
|
local shortport = require "shortport"
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
local string = require "string"
|
local string = require "string"
|
||||||
local url = require "url"
|
local url = require "url"
|
||||||
@@ -29,20 +30,7 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
|||||||
categories = {"default", "discovery", "safe"}
|
categories = {"default", "discovery", "safe"}
|
||||||
|
|
||||||
|
|
||||||
portrule = function(host, port)
|
portrule = shortport.http
|
||||||
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
|
|
||||||
|
|
||||||
action = function(host, port)
|
action = function(host, port)
|
||||||
local resp, redirect_url, title
|
local resp, redirect_url, title
|
||||||
|
|||||||
Reference in New Issue
Block a user