From 859072089004c960a7406686277e14117d6914a1 Mon Sep 17 00:00:00 2001 From: Meatballs Date: Thu, 4 Jul 2013 10:21:24 +0100 Subject: [PATCH] Use fail_with --- modules/exploits/windows/smb/psexec_psh.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/exploits/windows/smb/psexec_psh.rb b/modules/exploits/windows/smb/psexec_psh.rb index 7ff74eb59d..b11da48106 100644 --- a/modules/exploits/windows/smb/psexec_psh.rb +++ b/modules/exploits/windows/smb/psexec_psh.rb @@ -84,8 +84,8 @@ class Metasploit3 < Msf::Exploit::Remote begin smb_login rescue StandardError => autherror - print_error("#{peer} - Unable to authenticate with given credentials: #{autherror}") - return + disconnect + fail_with(Exploit::Failure::NoAccess, "#{peer} - Unable to authenticate with given credentials: #{autherror}") end # Execute the powershell command begin @@ -93,10 +93,9 @@ class Metasploit3 < Msf::Exploit::Remote vprint_good(command) return psexec(command) rescue StandardError => exec_command_error - print_error("#{peer} - Unable to execute specified command: #{exec_command_error}") - return false + disconnect + fail_with(Exploit::Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}") end - disconnect end end