Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Catch exception from net/ssh/connection/session.rb:381 #16309

Merged
merged 3 commits into from
Mar 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/metasploit/framework/login_scanner/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ def attempt_login(credential)

unless result_options.has_key? :status
if ssh_socket
proof = gather_proof unless skip_gather_proof
result_options.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: proof)
begin
proof = gather_proof unless skip_gather_proof
result_options.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: proof)
rescue => e
result_options.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: e)
end
HynekPetrak marked this conversation as resolved.
Show resolved Hide resolved
else
result_options.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: nil)
end
Expand Down