20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/metasploit/framework/login_scanner/amqp.rb', line 20
def attempt_login(credential)
result_options = {
credential: credential
}
begin
result_options.merge!(connect_login(credential.public, credential.private))
rescue Rex::Proto::Amqp::Error::NegotiationError => e
result_options[:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
result_options[:proof] = e.message
rescue Rex::Proto::Amqp::Error::AmqpError
result_options[:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
rescue ::EOFError, Errno::ECONNRESET, Rex::ConnectionError, Rex::ConnectionTimeout, ::Timeout::Error
result_options[:status] = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
end
result = ::Metasploit::Framework::LoginScanner::Result.new(result_options)
result.host = host
result.port = port
result.protocol = 'tcp'
result.service_name = "amqp#{ssl ? 's' : ''}"
result
end
|