changed if not to unless

master
Shelby Pace 2019-04-09 13:43:54 -05:00
parent b56e171172
commit 4018d47b65
No known key found for this signature in database
GPG Key ID: B2F3A8B476406857
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ class MetasploitModule < Msf::Exploit::Remote
if res && res.code == 200 if res && res.code == 200
source_tokens = res.body.scan(/turba\/add\.php\?source=(.+)"/).flatten source_tokens = res.body.scan(/turba\/add\.php\?source=(.+)"/).flatten
if not source_tokens.empty? unless source_tokens.empty?
form_tokens = res.body.scan(/name="turba_form_addcontact_formToken" value="(.+)"/).flatten form_tokens = res.body.scan(/name="turba_form_addcontact_formToken" value="(.+)"/).flatten
return source_tokens[0], form_tokens[0], res.get_cookies return source_tokens[0], form_tokens[0], res.get_cookies
end end
@ -108,7 +108,7 @@ class MetasploitModule < Msf::Exploit::Remote
vprint_status("Authenticating using #{username}:#{password}") vprint_status("Authenticating using #{username}:#{password}")
cookie = horde_login(username, password) cookie = horde_login(username, password)
fail_with(Failure::NoAccess, 'Unable to login. Verify USERNAME/PASSWORD or TARGETURI.') if cookie.nil? fail_with(Failure::NoAccess, 'Unable to login. Verify USERNAME/PASSWORD or TARGETURI.') if cookie.nil? || cookie.empty?
vprint_good("Authenticated to Horde.") vprint_good("Authenticated to Horde.")
tokens = get_tokens(cookie) tokens = get_tokens(cookie)