From 22e8f1cb48a5bd3f1d0b319e62b3a24fba709af5 Mon Sep 17 00:00:00 2001 From: Corey Harding Date: Thu, 20 Jul 2017 05:09:00 -0400 Subject: [PATCH] HWBRIDGE RFTRANSCEIVER ADD LOWBALL SUPPORT --- .../post/hardware/rftransceiver/rftransceiver.rb | 10 ++++++++++ .../extensions/rftransceiver/rftransceiver.rb | 4 ++++ .../console/command_dispatcher/rftransceiver.rb | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/lib/msf/core/post/hardware/rftransceiver/rftransceiver.rb b/lib/msf/core/post/hardware/rftransceiver/rftransceiver.rb index 5ecb336ec3..7bc09175f9 100644 --- a/lib/msf/core/post/hardware/rftransceiver/rftransceiver.rb +++ b/lib/msf/core/post/hardware/rftransceiver/rftransceiver.rb @@ -278,6 +278,16 @@ module RFTransceiver return_success(r) end + # + # Sets lowball. Ensure you set the frequency first before using this + # @return [Boolean] success value + def set_lowball + return false unless is_rf? + self.index ||= 0 + r = client.rftransceiver.set_lowball(self.index) + return_success(r) + end + # # Set power level # @param level [Integer] Power level diff --git a/lib/rex/post/hwbridge/extensions/rftransceiver/rftransceiver.rb b/lib/rex/post/hwbridge/extensions/rftransceiver/rftransceiver.rb index 9ef945f8d8..eae14ba6fc 100644 --- a/lib/rex/post/hwbridge/extensions/rftransceiver/rftransceiver.rb +++ b/lib/rex/post/hwbridge/extensions/rftransceiver/rftransceiver.rb @@ -186,6 +186,10 @@ class RFTransceiver < Extension client.send_request("/rftransceiver/#{idx}/set_number_preamble?num=#{num}") end + def set_lowball(idx) + client.send_request("/rftransceiver/#{idx}/set_lowball") + end + def set_maxpower(idx) client.send_request("/rftransceiver/#{idx}/set_maxpower") end diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb index f2f3b4ec26..d8885e8a6d 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb @@ -34,6 +34,7 @@ class Console::CommandDispatcher::RFtransceiver 'deviation' => 'sets the deviation', 'sync_word' => 'sets the sync word', 'preamble' => 'sets the preamble number', + 'lowball' => 'sets lowball' 'power' => 'sets the power level', 'maxpower' => 'sets max power' } @@ -528,6 +529,20 @@ class Console::CommandDispatcher::RFtransceiver print_success(r) end + def cmd_lowball_help + print_line("Lowball is frequency dependent. Set frequency first") + end + + def cmd_lowball(*args) + self.idx ||= 0 + if args.length.positive? + cmd_lowball_help + return + end + r = client.rftransceiver.set_lowball(idx) + print_success(r) + end + def cmd_maxpower_help print_line("Max power is frequency dependent. Set frequency first") end