CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/dect/station_scanner.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::DECT_COA
8
9
def initialize
10
super(
11
'Name' => 'DECT Base Station Scanner',
12
'Description' => 'This module scans for DECT base stations',
13
'Author' => [ 'DK <privilegedmode[at]gmail.com>' ],
14
'License' => MSF_LICENSE
15
)
16
17
end
18
19
20
def print_results
21
print_line("RFPI\t\tChannel")
22
@base_stations.each do |rfpi, data|
23
print_line("#{data['rfpi']}\t#{data['channel']}")
24
end
25
end
26
27
def run
28
@base_stations = {}
29
30
print_status("Opening interface: #{datastore['INTERFACE']}")
31
print_status("Using band: #{datastore['BAND']}")
32
33
open_coa
34
35
begin
36
37
print_status("Changing to fp scan mode.")
38
fp_scan_mode
39
print_status("Scanning...")
40
41
while(true)
42
data = poll_coa()
43
44
if (data)
45
parsed_data = parse_station(data)
46
if (not @base_stations.key?(parsed_data['rfpi']))
47
print_good("Found New RFPI: #{parsed_data['rfpi']}")
48
@base_stations[parsed_data['rfpi']] = parsed_data
49
end
50
end
51
52
next_channel
53
54
vprint_status("Switching to channel: #{channel}")
55
select(nil,nil,nil,1)
56
end
57
ensure
58
print_status("Closing interface")
59
stop_coa()
60
close_coa()
61
end
62
63
print_results
64
end
65
end
66
67