2010-05-03 17:13:09 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-05-03 17:13:09 +00:00
|
|
|
##
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2010-05-03 17:13:09 +00:00
|
|
|
require 'msf/core'
|
2009-09-12 15:40:33 +00:00
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::DECT_COA
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'DECT Base Station Scanner',
|
|
|
|
'Description' => 'This module scans for DECT base stations',
|
|
|
|
'Author' => [ 'DK <privilegedmode[at]gmail.com>' ],
|
2015-10-27 17:41:32 +00:00
|
|
|
'License' => MSF_LICENSE
|
2013-08-30 21:28:54 +00:00
|
|
|
)
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def print_results
|
|
|
|
print_line("RFPI\t\tChannel")
|
|
|
|
@base_stations.each do |rfpi, data|
|
|
|
|
print_line("#{data['rfpi']}\t#{data['channel']}")
|
|
|
|
end
|
|
|
|
end
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run
|
|
|
|
@base_stations = {}
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Opening interface: #{datastore['INTERFACE']}")
|
|
|
|
print_status("Using band: #{datastore['BAND']}")
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
open_coa
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
begin
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Changing to fp scan mode.")
|
|
|
|
fp_scan_mode
|
|
|
|
print_status("Scanning...")
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
while(true)
|
|
|
|
data = poll_coa()
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if (data)
|
|
|
|
parsed_data = parse_station(data)
|
|
|
|
if (not @base_stations.key?(parsed_data['rfpi']))
|
|
|
|
print_status("Found New RFPI: #{parsed_data['rfpi']}")
|
|
|
|
@base_stations[parsed_data['rfpi']] = parsed_data
|
|
|
|
end
|
|
|
|
end
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
next_channel
|
2009-09-12 15:40:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
vprint_status("Switching to channel: #{channel}")
|
|
|
|
select(nil,nil,nil,1)
|
|
|
|
end
|
|
|
|
ensure
|
|
|
|
print_status("Closing interface")
|
|
|
|
stop_coa()
|
|
|
|
close_coa()
|
|
|
|
end
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_results
|
|
|
|
end
|
2009-09-12 15:40:33 +00:00
|
|
|
end
|