Skip to content

Commit 9e5c24a

Browse files
committed
Address some Ruby style issues
1 parent bc3ac1e commit 9e5c24a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/fuzzers/ntp/ntp_protocol_fuzzer.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# encoding: UTF-8
12
##
23
# This module requires Metasploit: http//metasploit.com/download
34
# Current source: https://github.com/rapid7/metasploit-framework
@@ -8,7 +9,6 @@
89
require 'securerandom'
910

1011
class Metasploit3 < Msf::Auxiliary
11-
1212
include Msf::Auxiliary::Fuzzer
1313
include Msf::Exploit::Remote::Udp
1414
include Msf::Auxiliary::Scanner
@@ -73,7 +73,7 @@ def check_and_set(setting)
7373
unsupported_things = instance_variable_get("@#{var_name}") - Rex::Proto::NTP.const_get(const_name)
7474
fail "Unsupported #{thing}: #{unsupported_things}" unless unsupported_things.empty?
7575
else
76-
instance_variable_set("@#{var_name}", Rex::Proto::NTP::const_get(const_name))
76+
instance_variable_set("@#{var_name}", Rex::Proto::NTP.const_get(const_name))
7777
end
7878
end
7979

@@ -116,7 +116,7 @@ def fuzz_private(host)
116116
print_status("#{host}:#{rport} fuzzing version #{version} private messages (mode 7)")
117117
@mode_7_implementations.each do |implementation|
118118
@mode_7_request_codes.each do |request_code|
119-
request = Rex::Proto::NTP.ntp_private(version, implementation, request_code, "\x00"*188)
119+
request = Rex::Proto::NTP.ntp_private(version, implementation, request_code, "\x00" * 188)
120120
what = "#{request.size}-byte version #{version} mode 7 imp #{implementation} req #{request_code} message"
121121
vprint_status("#{host}:#{rport} probing with #{request.size}-byte #{what}")
122122
responses = probe(host, datastore['RPORT'].to_i, request)
@@ -179,7 +179,7 @@ def fuzz_version_mode(host, short)
179179
def probe(host, port, message)
180180
replies = []
181181
udp_sock.sendto(message, host, port, 0)
182-
while (r = udp_sock.recvfrom(65535, datastore['WAIT'] / 1000.0) and r[1])
182+
while (r = udp_sock.recvfrom(65535, datastore['WAIT'] / 1000.0) && r[1])
183183
replies << r
184184
end
185185
replies

0 commit comments

Comments
 (0)