From 8f75d3a46ba9906f0e1f031f123f92ca1b499676 Mon Sep 17 00:00:00 2001 From: Steve Embling <34773749+steve-embling@users.noreply.github.com> Date: Fri, 19 Jan 2018 15:10:14 +0000 Subject: [PATCH] Possible fix to changes in net::ssh usage --- .../auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb b/modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb index 4e5c312cdc..c589f15253 100644 --- a/modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb +++ b/modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb @@ -81,7 +81,10 @@ class MetasploitModule < Msf::Auxiliary end auth = Net::SSH::Authentication::Session.new(transport, opt_hash) - auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8)) + begin + auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8)) + rescue NoMethodError + end auth_method = auth.allowed_auth_methods.join('|') print_good "#{peer(ip)} Server Version: #{auth.transport.server_version.version}" report_service( @@ -116,7 +119,10 @@ class MetasploitModule < Msf::Auxiliary begin ::Timeout.timeout(datastore['SSH_TIMEOUT']) do - auth.authenticate("ssh-connection", user, pass) + begin + auth.authenticate("ssh-connection", user, pass) + rescue NoMethodError + end auth_method = auth.allowed_auth_methods.join('|') if auth_method != '' :success