Skip to content

Commit 85d0180

Browse files
committed
Pass password_prompt and non_interactive to fix rapid7#8970
Fix rapid7#8970
1 parent 8f75d3a commit 85d0180

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/auxiliary/scanner/ssh/cerberus_sftp_enumusers.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def check_vulnerable(ip)
7171
auth_methods: ['password', 'keyboard-interactive'],
7272
use_agent: false,
7373
config: false,
74+
password_prompt: Net::SSH::Prompt.new,
75+
non_interactive: true,
7476
proxies: datastore['Proxies']
7577
}
7678

@@ -81,10 +83,7 @@ def check_vulnerable(ip)
8183
end
8284

8385
auth = Net::SSH::Authentication::Session.new(transport, opt_hash)
84-
begin
85-
auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8))
86-
rescue NoMethodError
87-
end
86+
auth.authenticate("ssh-connection", Rex::Text.rand_text_alphanumeric(8), Rex::Text.rand_text_alphanumeric(8))
8887
auth_method = auth.allowed_auth_methods.join('|')
8988
print_good "#{peer(ip)} Server Version: #{auth.transport.server_version.version}"
9089
report_service(

0 commit comments

Comments
 (0)