1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-09 06:56:35 +00:00

Change hadoop/hbase portrules to match HTTP services.

This is so that these scripts can run for ports that -sV detects as
http, but not when the port is a common HTTP port.
This commit is contained in:
david
2012-01-14 01:03:17 +00:00
parent a2e693fb24
commit 86c042302f
7 changed files with 42 additions and 7 deletions

View File

@@ -29,7 +29,12 @@ categories = {"default", "discovery", "safe"}
require ("shortport")
require ("http")
portrule = shortport.port_or_service ({50075}, "hadoop-datanode", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service({50075}, "hadoop-datanode")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
action = function( host, port )

View File

@@ -47,7 +47,12 @@ require ("shortport")
require ("target")
require ("http")
portrule = shortport.port_or_service ({50030}, "hadoop-jobtracker", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({50030}, "hadoop-jobtracker")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
get_userhistory = function( host, port )
local results = {}

View File

@@ -47,7 +47,12 @@ require ("shortport")
require ("target")
require ("http")
portrule = shortport.port_or_service ({50070}, "hadoop-namenode", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({50070}, "hadoop-namenode")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
get_datanodes = function( host, port, Status )
local result = {}

View File

@@ -43,7 +43,12 @@ require ("shortport")
require ("target")
require ("http")
portrule = shortport.port_or_service ({50090}, "hadoop-secondary-namenode", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({50090}, "hadoop-secondary-namenode")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
action = function( host, port )

View File

@@ -33,7 +33,12 @@ categories = {"default", "discovery", "safe"}
require ("shortport")
require ("http")
portrule = shortport.port_or_service ({50060}, "hadoop-tasktracker", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({50060}, "hadoop-tasktracker")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
action = function( host, port )

View File

@@ -44,7 +44,12 @@ require ("shortport")
require ("http")
require ("target")
portrule = shortport.port_or_service ({60010}, "hbase-master", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({60010}, "hbase-master")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
action = function( host, port )

View File

@@ -38,7 +38,12 @@ require ("shortport")
require ("http")
require ("target")
portrule = shortport.port_or_service ({60030}, "hbase-region", {"tcp"})
portrule = function(host, port)
-- Run for the special port number, or for any HTTP-like service that is
-- not on a usual HTTP port.
return shortport.port_or_service ({60030}, "hbase-region")(host, port)
or (shortport.service(shortport.LIKELY_HTTP_SERVICES)(host, port) and not shortport.portnumber(shortport.LIKELY_HTTP_PORTS)(host, port))
end
action = function( host, port )