Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/amqp/amqp_login.rb
Views: 11623
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45require 'metasploit/framework/credential_collection'6require 'metasploit/framework/login_scanner/amqp'78class MetasploitModule < Msf::Auxiliary9include Msf::Auxiliary::AuthBrute10include Msf::Auxiliary::Scanner11include Msf::Auxiliary::Report1213# Creates an instance of this module.14def initialize(info = {})15super(16update_info(17info,18'Name' => 'AMQP 0-9-1 Login Check Scanner',19'Description' => %q{20This module will test AMQP logins on a range of machines and21report successful logins. If you have loaded a database plugin22and connected to a database this module will record successful23logins and hosts so you can track your access.24},25'Author' => [ 'Spencer McIntyre' ],26'License' => MSF_LICENSE,27'References' => [28[ 'URL', 'https://www.rabbitmq.com/amqp-0-9-1-reference.html' ]29],30'Notes' => {31'Stability' => [],32'Reliability' => [],33'SideEffects' => []34}35)36)3738register_options(39[40Opt::RPORT(5671)41]42)4344register_advanced_options(45[46OptBool.new('SSL', [ true, 'Negotiate SSL/TLS for outgoing connections', true ]),47Opt::SSLVersion48]49)50end5152def run_host(ip)53cred_collection = build_credential_collection(54username: datastore['USERNAME'],55password: datastore['PASSWORD']56)5758scanner = Metasploit::Framework::LoginScanner::AMQP.new(59host: ip,60port: datastore['RPORT'],61cred_details: cred_collection,62stop_on_success: datastore['STOP_ON_SUCCESS'],63bruteforce_speed: datastore['BRUTEFORCE_SPEED'],64framework: framework,65framework_module: self,66ssl: datastore['SSL'],67ssl_version: datastore['SSLVersion']68)6970scanner.scan! do |result|71credential_data = result.to_h72credential_data.merge!(73module_fullname: fullname,74workspace_id: myworkspace_id75)76if result.success?77credential_core = create_credential(credential_data)78credential_data[:core] = credential_core79create_credential_login(credential_data)8081print_good "#{ip}:#{datastore['RPORT']} - Login Successful: #{result.credential}"82else83invalidate_login(credential_data)84vprint_error "#{ip}:#{datastore['RPORT']} - LOGIN FAILED: #{result.credential} (#{result.status}: #{result.proof})"85end86end87end88end899091