diff --git a/scripts/hadoop-datanode-info.nse b/scripts/hadoop-datanode-info.nse index beed31443..f8eb0c4d9 100644 --- a/scripts/hadoop-datanode-info.nse +++ b/scripts/hadoop-datanode-info.nse @@ -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 ) diff --git a/scripts/hadoop-jobtracker-info.nse b/scripts/hadoop-jobtracker-info.nse index 8b0bfa072..a8e06e008 100644 --- a/scripts/hadoop-jobtracker-info.nse +++ b/scripts/hadoop-jobtracker-info.nse @@ -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 = {} diff --git a/scripts/hadoop-namenode-info.nse b/scripts/hadoop-namenode-info.nse index c6e951bb8..2ea03c764 100644 --- a/scripts/hadoop-namenode-info.nse +++ b/scripts/hadoop-namenode-info.nse @@ -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 = {} diff --git a/scripts/hadoop-secondary-namenode-info.nse b/scripts/hadoop-secondary-namenode-info.nse index aac9df027..a9bc99158 100644 --- a/scripts/hadoop-secondary-namenode-info.nse +++ b/scripts/hadoop-secondary-namenode-info.nse @@ -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 ) diff --git a/scripts/hadoop-tasktracker-info.nse b/scripts/hadoop-tasktracker-info.nse index 8150824ee..e4029e563 100644 --- a/scripts/hadoop-tasktracker-info.nse +++ b/scripts/hadoop-tasktracker-info.nse @@ -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 ) diff --git a/scripts/hbase-master-info.nse b/scripts/hbase-master-info.nse index d0447757e..fa5cfb56b 100644 --- a/scripts/hbase-master-info.nse +++ b/scripts/hbase-master-info.nse @@ -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 ) diff --git a/scripts/hbase-region-info.nse b/scripts/hbase-region-info.nse index 74047828a..5dbfc63b5 100644 --- a/scripts/hbase-region-info.nse +++ b/scripts/hbase-region-info.nse @@ -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 )