moar fail_with's

bug/bundler_fix
Christian Mehlmauer 2015-04-16 21:26:37 +02:00
parent a193ae42b0
commit b4b8ac0849
No known key found for this signature in database
GPG Key ID: BCFF4FA966BC32C7
4 changed files with 6 additions and 7 deletions

View File

@ -64,11 +64,11 @@ class Metasploit3 < Msf::Auxiliary
})
if res.nil?
fail_with("Server didn't respond in an expected way")
fail_with(Failure::UnexpectedReply, "Server didn't respond in an expected way")
end
if res.code == 200
fail_with("Authentication failed with username #{username}")
fail_with(Failure::NoAccess, "Authentication failed with username #{username}")
end
return cookie + ';' + res.get_cookies
@ -97,4 +97,3 @@ class Metasploit3 < Msf::Auxiliary
print_good("The injection worked, log in with #{username} and a blank password")
end
end

View File

@ -100,7 +100,7 @@ class Metasploit3 < Msf::Auxiliary
print_status("#{peer} - Parsing response...")
unless parse_csv(res.body, ',')
unless parse_csv(res.body, ';')
fail_with("#{peer} - Failed to parse response, the CSV was invalid")
fail_with(Failure::UnexpectedReply, "#{peer} - Failed to parse response, the CSV was invalid")
end
end

View File

@ -89,7 +89,7 @@ class Metasploit3 < Msf::Exploit::Local
if write_file(plist_path, item)
print_good("LaunchAgent added: #{plist_path}")
else
fail_with("Error writing LaunchAgent item to #{plist_path}")
fail_with(Failure::UnexpectedReply, "Error writing LaunchAgent item to #{plist_path}")
end
if run_now?
@ -154,7 +154,7 @@ class Metasploit3 < Msf::Exploit::Local
print_good("Backdoor stored to #{backdoor_path}")
cmd_exec("chmod +x #{backdoor_path.shellescape}")
else
fail_with("Error dropping backdoor to #{backdoor_path}")
fail_with(Failure::UnexpectedReply, "Error dropping backdoor to #{backdoor_path}")
end
end
end

View File

@ -40,7 +40,7 @@ class Metasploit3 < Msf::Post
# Run Method for when run command is issued
def run
fail_with("Insufficient Privileges: must be running as root to dump the hashes") unless root?
fail_with(Failure::BadConfig, "Insufficient Privileges: must be running as root to dump the hashes") unless root?
# iterate over all users
users.each do |user|