mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 09:49:05 +00:00
Add ssh banner to ssh-auth-methods
This commit is contained in:
@@ -147,6 +147,23 @@ function SSHConnection:list (username)
|
||||
return false
|
||||
end
|
||||
|
||||
---
|
||||
-- Attempt to retrieve the server's pre-auth banner
|
||||
--
|
||||
-- Need to attempt auth first (for instance by calling list)
|
||||
--
|
||||
-- @return The server's banner or nil on failure.
|
||||
function SSHConnection:banner ()
|
||||
if not self.session then
|
||||
return nil
|
||||
end
|
||||
local status, banner = pcall(libssh2.userauth_banner, self.session)
|
||||
if status then
|
||||
return banner
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
---
|
||||
-- Attempts to read public key file
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user