Path: blob/master/modules/post/hardware/rftransceiver/transmitter.rb
19851 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::Hardware::RFTransceiver::RFTransceiver78def initialize(info = {})9super(10update_info(11info,12'Name' => 'RF Transceiver Transmitter',13'Description' => %q{14This module powers an HWBridge-connected radio transceiver,15effectively transmitting on the frequency set by the FREQ option.1617NOTE: Users of this module should be aware of their local laws,18regulations, and licensing requirements for transmitting on any19given radio frequency.20},21'References' => [22['URL', 'https://github.com/AndrewMohawk/RfCatHelpers']23],24'License' => MSF_LICENSE,25'Author' => ['Craig Smith'],26'Platform' => ['hardware'],27'SessionTypes' => ['hwbridge'],28'Notes' => {29'Stability' => [CRASH_SAFE],30'SideEffects' => [PHYSICAL_EFFECTS],31'Reliability' => []32}33)34)35register_options([36OptInt.new('FREQ', [true, 'Frequency to transmit on']),37OptInt.new('SECONDS', [false, 'Seconds to transmit', 4]),38OptInt.new('BAUD', [false, 'Baud rate to use', 4800]),39OptInt.new('POWER', [false, 'Power level', 100]),40OptInt.new('INDEX', [false, 'USB Index to use', 0])41])42end4344def run45fail_with(Failure::BadConfig, 'Not an RF Transceiver') unless is_rf?4647unless set_index(datastore['INDEX'])48print_error("Couldn't set USB index to #{datastore['INDEX']}")49return50end5152set_modulation('ASK/OOK')53set_freq(datastore['FREQ'])54set_sync_mode(0)55set_baud(datastore['BAUD'])56set_channel_spc(24000)57set_mode('idle')58set_power(datastore['POWER'])5960print_status("Transmitting on #{datastore['FREQ']} for #{datastore['SECONDS']} seconds...")61set_mode('tx')62sleep(datastore['SECONDS'])63print_status('Finished transmitting')64set_mode('idle')65end66end676869