Files
metasploit-gs/modules/post/hardware/rftransceiver/transmitter.rb
T
Pearce Barry 31c03840bb Style fixes for HWBridge RF and a couple small bug fixes
I should have tweaked these earlier, my bad.
2017-03-26 13:45:19 -05:00

61 lines
1.8 KiB
Ruby

class MetasploitModule < Msf::Post
include Msf::Post::Hardware::RFTransceiver::RFTransceiver
def initialize(info={})
super( update_info( info,
'Name' => 'RF Transceiver Transmitter',
'Description' => %q{
This module powers an HWBridge-connected radio transceiver,
effectively transmitting on the frequency set by the FREQ option.
NOTE: Users of this module should be aware of their local laws,
regulations, and licensing requirements for transmitting on any
given radio frequency.
},
'References' =>
[
['URL', 'https://github.com/AndrewMohawk/RfCatHelpers']
],
'License' => MSF_LICENSE,
'Author' => ['Craig Smith'],
'Platform' => ['hardware'],
'SessionTypes' => ['hwbridge']
))
register_options([
OptInt.new('FREQ', [true, "Frequency to transmit on"]),
OptInt.new('SECONDS', [false, "Seconds to transmit", 4]),
OptInt.new('BAUD', [false, "Baud rate to use", 4800]),
OptInt.new('POWER', [false, "Power level", 100]),
OptInt.new('INDEX', [false, "USB Index to use", 0])
], self.class)
end
def run
unless is_rf?
print_error("Not an RF Transceiver")
return
end
unless set_index(datastore['INDEX'])
print_error("Couldn't set usb index to #{datastore['INDEX']}")
return
end
set_modulation("ASK/OOK")
set_freq(datastore['FREQ'])
set_sync_mode(0)
set_baud(datastore['BAUD'])
set_channel_spc(24000)
set_mode("idle")
set_power(datastore['POWER'])
print_status("Transmitting on #{datastore['FREQ']} for #{datastore['SECONDS']} seconds...")
set_mode("tx")
sleep(datastore['SECONDS'])
print_status("Finished transmitting")
set_mode("idle")
end
end