File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
modules/exploits/windows/smb Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ def smb_eternalblue(process_name, grooms)
187
187
print_status ( "Receiving response from exploit packet" )
188
188
code , raw = smb1_get_response ( sock )
189
189
190
+ if code . nil?
191
+ print_error ( "Did not receive a response from exploit packet" )
192
+ end
193
+
190
194
if code == 0xc000000d #STATUS_INVALID_PARAMETER (0xC000000D)
191
195
print_good ( "ETERNALBLUE overwrite completed successfully (0xC000000D)!" )
192
196
end
@@ -226,6 +230,10 @@ def smb1_anonymous_connect_ipc()
226
230
227
231
code , raw , response = smb1_get_response ( sock )
228
232
233
+ if code . nil?
234
+ raise RubySMB ::Error ::UnexpectedStatusCode , "No response to login request"
235
+ end
236
+
229
237
unless code == 0 # WindowsError::NTStatus::STATUS_SUCCESS
230
238
raise RubySMB ::Error ::UnexpectedStatusCode , "Error with anonymous login"
231
239
end
@@ -290,6 +298,7 @@ def smb1_free_hole(start)
290
298
291
299
def smb1_get_response ( sock )
292
300
raw = sock . get_once
301
+ return nil unless raw
293
302
response = RubySMB ::SMB1 ::SMBHeader . read ( raw [ 4 ..-1 ] )
294
303
code = response . nt_status
295
304
return code , raw , response
You can’t perform that action at this time.
0 commit comments