2010-05-03 17:13:09 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/framework/
|
|
|
|
##
|
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
|
|
|
|
|
|
|
|
include Msf::Exploit::DECT_COA
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'DECT Base Station Scanner',
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Description' => 'This module scans for DECT base stations',
|
|
|
|
'Author' => [ 'DK <privilegedmode@gmail.com>' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' => [ ['Dedected', 'http://www.dedected.org'] ]
|
2010-05-03 17:13:09 +00:00
|
|
|
)
|
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
register_options([
|
2010-03-04 20:59:49 +00:00
|
|
|
OptBool.new('VERBOSE',[false, 'Print out verbose information during the scan', true])
|
2009-09-12 15:40:33 +00:00
|
|
|
], self.class )
|
|
|
|
end
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
|
|
|
|
def print_results
|
|
|
|
print_line("RFPI\t\tChannel")
|
|
|
|
@base_stations.each do |rfpi, data|
|
|
|
|
print_line("#{data['rfpi']}\t#{data['channel']}")
|
2010-05-03 17:13:09 +00:00
|
|
|
end
|
2009-09-12 15:40:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
@base_stations = {}
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
print_status("Opening interface: #{datastore['INTERFACE']}")
|
|
|
|
print_status("Using band: #{datastore['band']}")
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
open_coa
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
print_status("Changing to fp scan mode.")
|
|
|
|
fp_scan_mode
|
|
|
|
print_status("Scanning...")
|
|
|
|
|
|
|
|
while(true)
|
|
|
|
data = poll_coa()
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
next_channel
|
|
|
|
|
2010-03-04 20:59:49 +00:00
|
|
|
if (datastore['VERBOSE'])
|
2009-09-12 15:40:33 +00:00
|
|
|
print_status("Switching to channel: #{channel}")
|
|
|
|
end
|
|
|
|
sleep(1)
|
2010-05-03 17:13:09 +00:00
|
|
|
end
|
2009-09-12 15:40:33 +00:00
|
|
|
ensure
|
|
|
|
print_status("Closing interface")
|
|
|
|
stop_coa()
|
|
|
|
close_coa()
|
|
|
|
end
|
2010-05-03 17:13:09 +00:00
|
|
|
|
2009-09-12 15:40:33 +00:00
|
|
|
print_results
|
|
|
|
end
|
|
|
|
end
|