Skip to content

Commit ce3f9e2

Browse files
committed
Fix minor style issues
1 parent 557dffd commit ce3f9e2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

modules/auxiliary/scanner/ssl/openssl_heartbleed.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class Metasploit3 < Msf::Auxiliary
102102
# For verbose output, deduplicate repeated characters beyond this threshold
103103
DEDUP_REPEATED_CHARS_THRESHOLD = 400
104104

105-
106105
def initialize
107106
super(
108107
'Name' => 'OpenSSL Heartbeat (Heartbleed) Information Leak',
@@ -207,7 +206,6 @@ def run
207206

208207
# Main method
209208
def run_host(ip)
210-
211209
case action.name
212210
when 'SCAN'
213211
loot_and_report(bleed)
@@ -535,11 +533,11 @@ def loot_and_report(heartbeat_data)
535533
duplicate_pad = (DEDUP_REPEATED_CHARS_THRESHOLD / 3).round
536534

537535
# 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
543541

544542
# Show abbreviated data
545543
vprint_status("#{peer} - Printable info leaked:\n#{abbreviated_data}")
@@ -720,7 +718,7 @@ def get_server_hello
720718

721719
remaining_data = get_ssl_record
722720

723-
while remaining_data and remaining_data.length > 0
721+
while remaining_data && remaining_data.length > 0
724722
ssl_record_counter += 1
725723
ssl_unpacked = remaining_data.unpack('CH4n')
726724
return nil if ssl_unpacked.nil? or ssl_unpacked.length < 3
@@ -738,7 +736,7 @@ def get_server_hello
738736
handshakes = parse_handshakes(ssl_data)
739737

740738
# 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
742740
server_done = true
743741
break
744742
end

0 commit comments

Comments
 (0)