@@ -102,7 +102,6 @@ class Metasploit3 < Msf::Auxiliary
102
102
# For verbose output, deduplicate repeated characters beyond this threshold
103
103
DEDUP_REPEATED_CHARS_THRESHOLD = 400
104
104
105
-
106
105
def initialize
107
106
super (
108
107
'Name' => 'OpenSSL Heartbeat (Heartbleed) Information Leak' ,
@@ -207,7 +206,6 @@ def run
207
206
208
207
# Main method
209
208
def run_host ( ip )
210
-
211
209
case action . name
212
210
when 'SCAN'
213
211
loot_and_report ( bleed )
@@ -535,11 +533,11 @@ def loot_and_report(heartbeat_data)
535
533
duplicate_pad = ( DEDUP_REPEATED_CHARS_THRESHOLD / 3 ) . round
536
534
537
535
# Remove duplicate characters
538
- abbreviated_data = printable_data . gsub ( /(.)\1 {#{ ( DEDUP_REPEATED_CHARS_THRESHOLD - 1 ) } ,}/ ) { |s |
539
- s [ 0 , duplicate_pad ] +
540
- ' repeated ' + ( s . length - ( 2 * duplicate_pad ) ) . to_s + ' times ' +
541
- s [ -duplicate_pad , duplicate_pad ]
542
- }
536
+ abbreviated_data = printable_data . gsub ( /(.)\1 {#{ ( DEDUP_REPEATED_CHARS_THRESHOLD - 1 ) } ,}/ ) do |s |
537
+ s [ 0 , duplicate_pad ] +
538
+ ' repeated ' + ( s . length - ( 2 * duplicate_pad ) ) . to_s + ' times ' +
539
+ s [ -duplicate_pad , duplicate_pad ]
540
+ end
543
541
544
542
# Show abbreviated data
545
543
vprint_status ( "#{ peer } - Printable info leaked:\n #{ abbreviated_data } " )
@@ -720,7 +718,7 @@ def get_server_hello
720
718
721
719
remaining_data = get_ssl_record
722
720
723
- while remaining_data and remaining_data . length > 0
721
+ while remaining_data && remaining_data . length > 0
724
722
ssl_record_counter += 1
725
723
ssl_unpacked = remaining_data . unpack ( 'CH4n' )
726
724
return nil if ssl_unpacked . nil? or ssl_unpacked . length < 3
@@ -738,7 +736,7 @@ def get_server_hello
738
736
handshakes = parse_handshakes ( ssl_data )
739
737
740
738
# Stop once we receive a SERVER_HELLO_DONE
741
- if handshakes and handshakes . length > 0 and handshakes [ -1 ] [ :type ] == HANDSHAKE_SERVER_HELLO_DONE_TYPE
739
+ if handshakes && handshakes . length > 0 && handshakes [ -1 ] [ :type ] == HANDSHAKE_SERVER_HELLO_DONE_TYPE
742
740
server_done = true
743
741
break
744
742
end
0 commit comments