@@ -53,10 +53,10 @@ def initialize
53
53
register_advanced_options (
54
54
[
55
55
OptString . new ( 'VERSIONS' , [ false , 'Specific versions to fuzz (csv)' , '2,3,4' ] ) ,
56
- OptString . new ( 'MODES' , [ false , 'Modes to fuzz (csv)' , nil ] ) ,
57
- OptString . new ( 'MODE_6_OPERATIONS' , [ false , 'Mode 6 operations to fuzz (csv)' , nil ] ) ,
58
- OptString . new ( 'MODE_7_IMPLEMENTATIONS' , [ false , 'Mode 7 implementations to fuzz (csv)' , nil ] ) ,
59
- OptString . new ( 'MODE_7_REQUEST_CODES' , [ false , 'Mode 7 request codes to fuzz (csv)' , nil ] )
56
+ OptString . new ( 'MODES' , [ false , 'Modes to fuzz (csv)' ] ) ,
57
+ OptString . new ( 'MODE_6_OPERATIONS' , [ false , 'Mode 6 operations to fuzz (csv)' ] ) ,
58
+ OptString . new ( 'MODE_7_IMPLEMENTATIONS' , [ false , 'Mode 7 implementations to fuzz (csv)' ] ) ,
59
+ OptString . new ( 'MODE_7_REQUEST_CODES' , [ false , 'Mode 7 request codes to fuzz (csv)' ] )
60
60
] , self . class )
61
61
end
62
62
@@ -68,7 +68,7 @@ def check_and_set(setting)
68
68
thing = setting . upcase
69
69
const_name = thing . to_sym
70
70
var_name = thing . downcase
71
- if datastore . key? ( thing )
71
+ if datastore [ thing ]
72
72
instance_variable_set ( "@#{ var_name } " , datastore [ thing ] . split ( /[^\d ]/ ) . select { |v | !v . empty? } . map { |v | v . to_i } )
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?
@@ -178,7 +178,11 @@ def fuzz_version_mode(host, short)
178
178
# Sends +message+ to +host+ on UDP port +port+, returning all replies
179
179
def probe ( host , port , message )
180
180
replies = [ ]
181
- udp_sock . sendto ( message , host , port , 0 )
181
+ begin
182
+ udp_sock . sendto ( message , host , port , 0 )
183
+ rescue ::Errno ::EISCONN
184
+ udp_sock . write ( message )
185
+ end
182
186
reply = udp_sock . recvfrom ( 65535 , datastore [ 'WAIT' ] / 1000.0 )
183
187
while reply && reply [ 1 ]
184
188
replies << reply
0 commit comments