Path: blob/master/modules/auxiliary/scanner/dect/station_scanner.rb
19500 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::DECT_COA78def initialize9super(10'Name' => 'DECT Base Station Scanner',11'Description' => 'This module scans for DECT base stations.',12'Author' => [ 'DK <privilegedmode[at]gmail.com>' ],13'License' => MSF_LICENSE,14'Notes' => {15'Stability' => [CRASH_SAFE],16'SideEffects' => [],17'Reliability' => []18}19)20end2122def print_results23print_line("RFPI\t\tChannel")24@base_stations.each_value do |data|25print_line("#{data['rfpi']}\t#{data['channel']}")26end27end2829def run30@base_stations = {}3132print_status("Opening interface: #{datastore['INTERFACE']}")33print_status("Using band: #{datastore['BAND']}")3435open_coa3637begin38print_status('Changing to fp scan mode.')39fp_scan_mode40print_status('Scanning...')4142loop do43data = poll_coa4445if data46parsed_data = parse_station(data)47if !@base_stations.key?(parsed_data['rfpi'])48print_good("Found New RFPI: #{parsed_data['rfpi']}")49@base_stations[parsed_data['rfpi']] = parsed_data50end51end5253next_channel5455vprint_status("Switching to channel: #{channel}")56select(nil, nil, nil, 1)57end58ensure59print_status('Closing interface')60stop_coa61close_coa62end6364print_results65end66end676869