some more minor fixes

some more minor fixes around broken
ssh modules

7321
bug/bundler_fix
David Maloney 2016-09-15 14:25:17 -05:00
parent e10c133eef
commit dfcd5742c1
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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