Use fail_with

unstable
Meatballs 2013-07-04 10:21:24 +01:00
parent 3eab7107b8
commit 8590720890
1 changed files with 4 additions and 5 deletions

View File

@ -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