moar fail_with's
parent
a193ae42b0
commit
b4b8ac0849
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Reference in New Issue