Skip to content

Commit 8f75d3a

Browse files
committed
Possible fix to changes in net::ssh usage
1 parent dc2b5df commit 8f75d3a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ def check_vulnerable(ip)
8181
end
8282

8383
auth = Net::SSH::Authentication::Session.new(transport, opt_hash)
84-
auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8))
84+
begin
85+
auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8))
86+
rescue NoMethodError
87+
end
8588
auth_method = auth.allowed_auth_methods.join('|')
8689
print_good "#{peer(ip)} Server Version: #{auth.transport.server_version.version}"
8790
report_service(
@@ -116,7 +119,10 @@ def check_user(ip, user, port)
116119

117120
begin
118121
::Timeout.timeout(datastore['SSH_TIMEOUT']) do
119-
auth.authenticate("ssh-connection", user, pass)
122+
begin
123+
auth.authenticate("ssh-connection", user, pass)
124+
rescue NoMethodError
125+
end
120126
auth_method = auth.allowed_auth_methods.join('|')
121127
if auth_method != ''
122128
:success

0 commit comments

Comments
 (0)