Land #6136, rescue SMB error for psexec

This commit is contained in:
William Vu 2015-10-27 09:31:37 -05:00
commit 74353686a3
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
1 changed files with 10 additions and 2 deletions

View File

@ -231,10 +231,18 @@ class Metasploit3 < Msf::Exploit::Remote
#This is not really useful but will prevent double \\ on the wire :)
if datastore['SHARE'] =~ /.[\\\/]/
simple.connect("\\\\#{datastore['RHOST']}\\#{smbshare}")
simple.delete("\\#{fileprefix}\\#{filename}")
begin
simple.delete("\\#{fileprefix}\\#{filename}")
rescue XCEPT::ErrorCode => e
print_error("Delete of \\#{fileprefix}\\#{filename} failed: #{e.message}")
end
else
simple.connect("\\\\#{datastore['RHOST']}\\#{smbshare}")
simple.delete("\\#{filename}")
begin
simple.delete("\\#{filename}")
rescue XCEPT::ErrorCode => e
print_error("Delete of \\#{filename} failed: #{e.message}")
end
end
end
end