Fixed exception handeling. No longer using rescure StandardError

bug/bundler_fix
Royce Davis 2013-01-17 19:02:13 -06:00
parent f7571d89de
commit 00a9c72595
1 changed files with 172 additions and 173 deletions

View File

@ -28,8 +28,8 @@ module Exploit::Remote::Psexec
outfile.close
simple.disconnect("\\\\#{ip}\\#{smbshare}")
return output
rescue StandardError => output_error
print_error("Error getting command output. #{output_error.class}. #{output_error}.")
rescue Rex::Proto::SMB::Exceptions::ErrorCode => output_error
print_error("#{peer} - The file #{file} doesn't exist. #{output_error}.")
return nil
end
end
@ -185,14 +185,13 @@ module Exploit::Remote::Psexec
if !@dropped_files
return
end
@dropped_files.delete_if do |file|
begin
@dropped_files.delete_if do |file|
file_rm(file)
print_good("#{peer} - Deleted #{file}")
rescue StandardError => file_rm_error
print_error("#{peer} - Unable to delte #{file}. #{file_rm_error}")
return
end
rescue ::Exception => cleanup_error
print_error("#{peer} - Unable to delte #{file}. #{cleanup_error}")
end
end