1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

New, broader portrule for SSH scripts. Closes #1825

This commit is contained in:
dmiller
2020-01-10 05:32:08 +00:00
parent 922199296c
commit f974b625d2
9 changed files with 40 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"auth", "intrusive"}
local username = stdnse.get_script_args("ssh.user") or rand.random_alpha(5)
portrule = shortport.port_or_service(22, 'ssh')
portrule = shortport.ssh
function action (host, port)
local result = stdnse.output_table()

View File

@@ -31,7 +31,7 @@ categories = {
'intrusive',
}
portrule = shortport.port_or_service(22, 'ssh')
portrule = shortport.ssh
local arg_timeout = stdnse.get_script_args(SCRIPT_NAME .. ".timeout") or "5s"

View File

@@ -139,7 +139,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"safe","default","discovery"}
portrule = shortport.port_or_service(22, "ssh")
portrule = shortport.ssh
postrule = function() return (nmap.registry.sshhostkey ~= nil) end

View File

@@ -46,7 +46,7 @@ local usernames = stdnse.get_script_args "ssh.usernames"
local knownbad = stdnse.get_script_args "knownbad"
local publickeys = stdnse.get_script_args "ssh.publickeys"
local publickeydb = stdnse.get_script_args "publickeydb" or nmap.fetchfile("nselib/data/publickeydb")
portrule = shortport.port_or_service(22, 'ssh')
portrule = shortport.ssh
function action (host, port)
local result = stdnse.output_table()

View File

@@ -43,7 +43,7 @@ categories = {
'intrusive',
}
portrule = shortport.port_or_service(22, 'ssh')
portrule = shortport.ssh
local username = stdnse.get_script_args 'ssh-run.username'
local cmd = stdnse.get_script_args 'ssh-run.cmd'

View File

@@ -103,7 +103,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"safe", "discovery"}
portrule = shortport.port_or_service(22, "ssh")
portrule = shortport.ssh
-- Build onto lists{} and possibly modify parsed{} based on whether the
-- algorithm name-lists are identical between the server-to-client and

View File

@@ -19,7 +19,7 @@ categories = {"default", "safe"}
-- true
portrule = shortport.port_or_service(22, "ssh")
portrule = shortport.ssh
action = function(host, port)
local socket = nmap.new_socket()