Class: Metasploit::Framework::LoginScanner::AMQP

Inherits:
Object
  • Object
show all
Includes:
Base, RexSocket
Defined in:
lib/metasploit/framework/login_scanner/amqp.rb

Constant Summary collapse

DEFAULT_PORT =
5671
LIKELY_PORTS =
[ DEFAULT_PORT, 5672 ]
LIKELY_SERVICE_NAMES =
[ 'amqp', 'amqps' ]
PRIVATE_TYPES =
[ :password ]
REALM_KEY =
nil

Instance Method Summary collapse

Instance Method Details

#attempt_login(credential) ⇒ Object



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 (credential)
  result_options = {
      credential: credential
  }

  begin
    result_options.merge!((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