Path: blob/master/modules/auxiliary/scanner/dect/call_scanner.rb
19567 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 Call Scanner',11'Description' => 'This module scans for active DECT calls.',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("Time\t\t\t\tRFPI\t\tChannel")24@calls.each_value do |data|25print_line("#{data['time']}\t#{data['rfpi']}\t#{data['channel']}")26end27end2829=begin30def record_call(data)31print_status("Synchronizing..")32pp_scan_mode(data['rfpi_raw'])33while(true)34data = poll_coa()35puts data36end37end38=end3940def run41@calls = {}4243print_status("Opening interface: #{datastore['INTERFACE']}")44print_status("Using band: #{datastore['BAND']}")4546open_coa4748begin49print_status('Changing to call scan mode.')50call_scan_mode51print_status('Scanning...')5253loop do54data = poll_coa55if data56parsed_data = parse_call(data)57parsed_data['time'] = Time.now58print_good("Found active call on: #{parsed_data['rfpi']}")59@calls[parsed_data['time']] = parsed_data60end6162next_channel6364vprint_status("Switching to channel: #{channel}")65select(nil, nil, nil, 1)66end67ensure68print_status('Closing interface')69stop_coa70close_coa71end7273print_results74end75end767778