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/post/hardware/rftransceiver/transmitter.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::Post
7
include Msf::Post::Hardware::RFTransceiver::RFTransceiver
8
9
def initialize(info = {})
10
super(
11
update_info(
12
info,
13
'Name' => 'RF Transceiver Transmitter',
14
'Description' => %q{
15
This module powers an HWBridge-connected radio transceiver,
16
effectively transmitting on the frequency set by the FREQ option.
17
18
NOTE: Users of this module should be aware of their local laws,
19
regulations, and licensing requirements for transmitting on any
20
given radio frequency.
21
},
22
'References' => [
23
['URL', 'https://github.com/AndrewMohawk/RfCatHelpers']
24
],
25
'License' => MSF_LICENSE,
26
'Author' => ['Craig Smith'],
27
'Platform' => ['hardware'],
28
'SessionTypes' => ['hwbridge']
29
)
30
)
31
register_options([
32
OptInt.new('FREQ', [true, 'Frequency to transmit on']),
33
OptInt.new('SECONDS', [false, 'Seconds to transmit', 4]),
34
OptInt.new('BAUD', [false, 'Baud rate to use', 4800]),
35
OptInt.new('POWER', [false, 'Power level', 100]),
36
OptInt.new('INDEX', [false, 'USB Index to use', 0])
37
])
38
end
39
40
def run
41
unless is_rf?
42
print_error('Not an RF Transceiver')
43
return
44
end
45
unless set_index(datastore['INDEX'])
46
print_error("Couldn't set usb index to #{datastore['INDEX']}")
47
return
48
end
49
set_modulation('ASK/OOK')
50
set_freq(datastore['FREQ'])
51
set_sync_mode(0)
52
set_baud(datastore['BAUD'])
53
set_channel_spc(24000)
54
set_mode('idle')
55
set_power(datastore['POWER'])
56
57
print_status("Transmitting on #{datastore['FREQ']} for #{datastore['SECONDS']} seconds...")
58
set_mode('tx')
59
sleep(datastore['SECONDS'])
60
print_status('Finished transmitting')
61
set_mode('idle')
62
end
63
end
64
65