Wait a second before deleting the file, catch an exception on delete, combined these reduce some of the issues around psexec

git-svn-id: file:///home/svn/framework3/trunk@7954 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-12-23 04:02:59 +00:00
parent 0a0ddc35d0
commit 92c703ba6f
1 changed files with 9 additions and 3 deletions

View File

@ -264,9 +264,15 @@ class Metasploit3 < Msf::Exploit::Remote
print_status("Error: #{e}")
end
print_status("Deleting \\#{filename}...")
simple.connect("ADMIN$")
simple.delete("\\#{filename}")
begin
print_status("Deleting \\#{filename}...")
select(nil, nil, nil, 1.0)
simple.connect("ADMIN$")
simple.delete("\\#{filename}")
rescue ::Interrupt
raise $!
rescue ::Exception
end
handler
disconnect