CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/dect/call_scanner.rb
Views: 1904
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 Call Scanner',
12
'Description' => 'This module scans for active DECT calls',
13
'Author' => [ 'DK <privilegedmode[at]gmail.com>' ],
14
'License' => MSF_LICENSE
15
)
16
end
17
18
def print_results
19
print_line("Time\t\t\t\tRFPI\t\tChannel")
20
@calls.each do |rfpi, data|
21
print_line("#{data['time']}\t#{data['rfpi']}\t#{data['channel']}")
22
end
23
end
24
25
26
=begin
27
def record_call(data)
28
print_status("Synchronizing..")
29
pp_scan_mode(data['rfpi_raw'])
30
while(true)
31
data = poll_coa()
32
puts data
33
end
34
end
35
=end
36
37
def run
38
@calls = {}
39
40
print_status("Opening interface: #{datastore['INTERFACE']}")
41
print_status("Using band: #{datastore['BAND']}")
42
43
open_coa
44
45
begin
46
47
print_status("Changing to call scan mode.")
48
call_scan_mode
49
print_status("Scanning...")
50
51
while (true)
52
data = poll_coa()
53
if (data)
54
parsed_data = parse_call(data)
55
parsed_data['time'] = Time.now
56
print_good("Found active call on: #{parsed_data['rfpi']}")
57
@calls[parsed_data['time']] = parsed_data
58
end
59
60
next_channel
61
62
vprint_status("Switching to channel: #{channel}")
63
select(nil,nil,nil,1)
64
end
65
ensure
66
print_status("Closing interface")
67
stop_coa()
68
close_coa()
69
end
70
71
print_results
72
end
73
end
74
75