mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Let ssl-cert grab certs from DTLS services. Fix rules for TCP-only scripts
This commit is contained in:
@@ -38,7 +38,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"vuln", "safe"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.isPortSupported(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -37,7 +37,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"vuln", "safe"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.isPortSupported(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -37,7 +37,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"vuln", "safe"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.isPortSupported(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -37,7 +37,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"vuln", "safe"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.isPortSupported(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -69,7 +69,7 @@ categories = { "vuln", "safe" }
|
||||
dependencies = {"https-redirect"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
local Error = {
|
||||
|
||||
@@ -40,7 +40,7 @@ categories = {"discovery", "safe", "default"}
|
||||
dependencies = {"https-redirect"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
-- Miscellaneous script-wide constants
|
||||
|
||||
@@ -788,7 +788,7 @@ end
|
||||
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
local function format_check(t, label)
|
||||
|
||||
@@ -1095,7 +1095,7 @@ local function try_protocol(host, port, protocol, upresults)
|
||||
end
|
||||
|
||||
portrule = function (host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -47,7 +47,7 @@ dependencies = {"https-redirect"}
|
||||
local arg_protocols = stdnse.get_script_args(SCRIPT_NAME .. ".protocols") or {'TLSv1.0', 'TLSv1.1', 'TLSv1.2'}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
local function recvhdr(s)
|
||||
|
||||
@@ -103,7 +103,9 @@ local get_fingerprints = function(path)
|
||||
return true, fingerprints
|
||||
end
|
||||
|
||||
portrule = shortport.ssl
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.isPortSupported(port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
-- Get script arguments.
|
||||
|
||||
@@ -308,7 +308,7 @@ local function check_fallback_scsv(host, port, protocol, ciphers)
|
||||
end
|
||||
|
||||
portrule = function (host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -95,7 +95,7 @@ for k, v in pairs(sslv2.SSL_CIPHERS) do
|
||||
end
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
-- Return whether all values of "t1" are also values in "t2".
|
||||
|
||||
@@ -40,7 +40,7 @@ categories = {"default", "safe"}
|
||||
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -40,7 +40,7 @@ categories = {"discovery", "safe", "default"}
|
||||
dependencies = {"https-redirect"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ categories = {"discovery", "safe", "default"}
|
||||
dependencies = {"https-redirect"}
|
||||
|
||||
portrule = function(host, port)
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ portrule = function(host, port)
|
||||
return false
|
||||
end
|
||||
|
||||
return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port)
|
||||
return port.protocol == "tcp" and (shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port))
|
||||
end
|
||||
|
||||
local function is_vuln(host, port, version)
|
||||
|
||||
Reference in New Issue
Block a user