|
| 1 | +# encoding: UTF-8 |
1 | 2 | ##
|
2 | 3 | # This module requires Metasploit: http//metasploit.com/download
|
3 | 4 | # Current source: https://github.com/rapid7/metasploit-framework
|
|
8 | 9 | require 'securerandom'
|
9 | 10 |
|
10 | 11 | class Metasploit3 < Msf::Auxiliary
|
11 |
| - |
12 | 12 | include Msf::Auxiliary::Fuzzer
|
13 | 13 | include Msf::Exploit::Remote::Udp
|
14 | 14 | include Msf::Auxiliary::Scanner
|
@@ -73,7 +73,7 @@ def check_and_set(setting)
|
73 | 73 | unsupported_things = instance_variable_get("@#{var_name}") - Rex::Proto::NTP.const_get(const_name)
|
74 | 74 | fail "Unsupported #{thing}: #{unsupported_things}" unless unsupported_things.empty?
|
75 | 75 | 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)) |
77 | 77 | end
|
78 | 78 | end
|
79 | 79 |
|
@@ -116,7 +116,7 @@ def fuzz_private(host)
|
116 | 116 | print_status("#{host}:#{rport} fuzzing version #{version} private messages (mode 7)")
|
117 | 117 | @mode_7_implementations.each do |implementation|
|
118 | 118 | @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) |
120 | 120 | what = "#{request.size}-byte version #{version} mode 7 imp #{implementation} req #{request_code} message"
|
121 | 121 | vprint_status("#{host}:#{rport} probing with #{request.size}-byte #{what}")
|
122 | 122 | responses = probe(host, datastore['RPORT'].to_i, request)
|
@@ -179,7 +179,7 @@ def fuzz_version_mode(host, short)
|
179 | 179 | def probe(host, port, message)
|
180 | 180 | replies = []
|
181 | 181 | 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]) |
183 | 183 | replies << r
|
184 | 184 | end
|
185 | 185 | replies
|
|
0 commit comments