@@ -14,12 +14,22 @@ def initialize(info = {})
1414 'Description' => %q{
1515 Post Module for HWBridge RFTranscievers. Brute forces AM OOK or raw
1616 binary signals. This is a port of the rfpwnon tool by Corey Harding.
17- (https://github.com/exploitagency/github-rfpwnon/blob/master/rfpwnon.py)
1817 } ,
1918 'License' => MSF_LICENSE ,
20- 'Author' => [ 'Craig Smith' ] ,
19+ 'Author' => [
20+ 'Corey Harding' , # rfpwnon
21+ 'Craig Smith' , # metasploit
22+ ] ,
23+ 'References' => [
24+ [ 'URL' , 'https://github.com/exploitagency/github-rfpwnon/blob/master/rfpwnon.py' ] ,
25+ ] ,
2126 'Platform' => [ 'hardware' ] ,
22- 'SessionTypes' => [ 'hwbridge' ]
27+ 'SessionTypes' => [ 'hwbridge' ] ,
28+ 'Notes' => {
29+ 'Stability' => [ CRASH_SAFE ] ,
30+ 'SideEffects' => [ PHYSICAL_EFFECTS ] ,
31+ 'Reliability' => [ ]
32+ }
2333 )
2434 )
2535 register_options ( [
@@ -40,7 +50,7 @@ def initialize(info = {})
4050 @brutechar = '01'
4151 end
4252
43- # @param key [String] binary/trinary represntation
53+ # @param key [String] binary/trinary representation
4454 # @return [Array] ByteArray
4555 def convert_ook ( key )
4656 pwm_str_key = ''
@@ -59,6 +69,7 @@ def convert_ook(key)
5969 return pwm_str_key . scan ( /.{1,8}/ ) . collect { |x | x . to_i ( 2 ) . chr }
6070 end
6171
72+ # rubocop:disable Naming/MethodParameterName
6273 def debruijn_bytes ( k , n )
6374 @a = [ 0 ]
6475 @sequence = [ ]
@@ -80,16 +91,16 @@ def debruijn(t, p, k, n)
8091 end
8192 end
8293 end
94+ # rubocop:enable Naming/MethodParameterName
8395
8496 def run
85- unless is_rf?
86- print_error ( 'Not an RF Transceiver' )
87- return
88- end
97+ fail_with ( Failure ::BadConfig , 'Not an RF Transceiver' ) unless is_rf?
98+
8999 unless set_index ( datastore [ 'INDEX' ] )
90- print_error ( "Couldn't set usb index to #{ datastore [ 'INDEX' ] } " )
100+ print_error ( "Couldn't set USB index to #{ datastore [ 'INDEX' ] } " )
91101 return
92102 end
103+
93104 if datastore [ 'TRI' ]
94105 @zeropwm = '10001000'
95106 @onepwm = '11101110'
@@ -115,7 +126,6 @@ def run
115126
116127 startn = 0
117128 endy = 512
118- brutepackettmp = ''
119129 addr = 512
120130 if datastore [ 'TRI' ]
121131 endy = 128
@@ -125,6 +135,7 @@ def run
125135 endy = datastore [ 'BINLENGTH' ]
126136 addr = 1
127137 end
138+
128139 # Transmit
129140 while startn < brutepacket . length
130141 ( 0 ..datastore [ 'REPEAT' ] - 1 ) . each do |_i |
@@ -156,6 +167,7 @@ def run
156167 endy = endy + addr - datastore [ 'BINLENGTH' ]
157168 end
158169 end
170+
159171 print_status ( 'Done' )
160172 set_mode ( 'IDLE' )
161173 end
0 commit comments