File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
modules/exploits/windows/smb Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,18 @@ def exploit
231
231
#This is not really useful but will prevent double \\ on the wire :)
232
232
if datastore [ 'SHARE' ] =~ /.[\\ \/ ]/
233
233
simple . connect ( "\\ \\ #{ datastore [ 'RHOST' ] } \\ #{ smbshare } " )
234
- simple . delete ( "\\ #{ fileprefix } \\ #{ filename } " )
234
+ begin
235
+ simple . delete ( "\\ #{ fileprefix } \\ #{ filename } " )
236
+ rescue XCEPT ::ErrorCode => e
237
+ print_error ( "Delete of \\ #{ fileprefix } \\ #{ filename } failed: #{ e . message } " )
238
+ end
235
239
else
236
240
simple . connect ( "\\ \\ #{ datastore [ 'RHOST' ] } \\ #{ smbshare } " )
237
- simple . delete ( "\\ #{ filename } " )
241
+ begin
242
+ simple . delete ( "\\ #{ filename } " )
243
+ rescue XCEPT ::ErrorCode => e
244
+ print_error ( "Delete of \\ #{ filename } failed: #{ e . message } " )
245
+ end
238
246
end
239
247
end
240
248
end
You can’t perform that action at this time.
0 commit comments