mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Fix some arg handling for ssh-publickey-acceptance
This commit is contained in:
@@ -152,14 +152,14 @@ end
|
|||||||
--
|
--
|
||||||
-- @param publickey An SSH public key file.
|
-- @param publickey An SSH public key file.
|
||||||
-- @return true on success or false on error.
|
-- @return true on success or false on error.
|
||||||
-- @return publick key data on success or error code on error.
|
-- @return public key data on success or error code on error.
|
||||||
function SSHConnection:read_publickey (publickey)
|
function SSHConnection:read_publickey (publickey)
|
||||||
local status, result = pcall(libssh2.read_publickey, publickey)
|
local status, result = pcall(libssh2.read_publickey, publickey)
|
||||||
return status, result
|
return status, result
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Attempts authentication with publick key
|
-- Attempts authentication with public key
|
||||||
--
|
--
|
||||||
-- @param username A username to authenticate as.
|
-- @param username A username to authenticate as.
|
||||||
-- @param key Base64 decrypted public key.
|
-- @param key Base64 decrypted public key.
|
||||||
|
|||||||
0
scripts/http-jsonp-detection.nse
Executable file → Normal file
0
scripts/http-jsonp-detection.nse
Executable file → Normal file
0
scripts/smb-enum-services.nse
Executable file → Normal file
0
scripts/smb-enum-services.nse
Executable file → Normal file
@@ -43,7 +43,7 @@ categories = {"auth", "intrusive"}
|
|||||||
local privatekeys = stdnse.get_script_args "ssh.privatekeys"
|
local privatekeys = stdnse.get_script_args "ssh.privatekeys"
|
||||||
local passphrases = stdnse.get_script_args "ssh.passphrases" or {}
|
local passphrases = stdnse.get_script_args "ssh.passphrases" or {}
|
||||||
local usernames = stdnse.get_script_args "ssh.usernames"
|
local usernames = stdnse.get_script_args "ssh.usernames"
|
||||||
local knownbad = stdnse.get_script_args "known-bad"
|
local knownbad = stdnse.get_script_args "knownbad"
|
||||||
local publickeys = stdnse.get_script_args "ssh.publickeys"
|
local publickeys = stdnse.get_script_args "ssh.publickeys"
|
||||||
local publickeydb = stdnse.get_script_args "publickeydb" or nmap.fetchfile("nselib/data/publickeydb")
|
local publickeydb = stdnse.get_script_args "publickeydb" or nmap.fetchfile("nselib/data/publickeydb")
|
||||||
portrule = shortport.port_or_service(22, 'ssh')
|
portrule = shortport.port_or_service(22, 'ssh')
|
||||||
@@ -70,7 +70,7 @@ function action (host, port)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if knownbad or not (privatekeys and publickeys) then
|
if knownbad or not (privatekeys or publickeys) then
|
||||||
for line in io.lines(publickeydb) do
|
for line in io.lines(publickeydb) do
|
||||||
local sections = {}
|
local sections = {}
|
||||||
for section in string.gmatch(line, '([^,]+)') do
|
for section in string.gmatch(line, '([^,]+)') do
|
||||||
|
|||||||
Reference in New Issue
Block a user