Correct error check logic
parent
443a51bbf5
commit
a0f47f6b2b
|
@ -206,7 +206,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
wp_login_token = get_html_value(response.body, 'input', 'wpLoginToken', 'value')
|
wp_login_token = get_html_value(response.body, 'input', 'wpLoginToken', 'value')
|
||||||
|
|
||||||
unless wp_login_token
|
if wp_login_token.blank?
|
||||||
fail_with(Failure::UnexpectedReply, "Couldn't find login token. Is URI set correctly?")
|
fail_with(Failure::UnexpectedReply, "Couldn't find login token. Is URI set correctly?")
|
||||||
else
|
else
|
||||||
print_good("Retrieved login CSRF token.")
|
print_good("Retrieved login CSRF token.")
|
||||||
|
@ -259,7 +259,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
wp_upload = get_html_value(upload_file.body, 'input', 'wpUpload', 'value')
|
wp_upload = get_html_value(upload_file.body, 'input', 'wpUpload', 'value')
|
||||||
title = get_html_value(upload_file.body, 'input', 'title', 'value')
|
title = get_html_value(upload_file.body, 'input', 'title', 'value')
|
||||||
|
|
||||||
if upload_csrf && wp_edit_token
|
if upload_csrf && !wp_edit_token.blank?
|
||||||
print_good("Retrieved upload CSRF token.")
|
print_good("Retrieved upload CSRF token.")
|
||||||
elsif upload_csrf
|
elsif upload_csrf
|
||||||
fail_with(Failure::UnexpectedReply, "Couldn't find upload token. Is URI set correctly?")
|
fail_with(Failure::UnexpectedReply, "Couldn't find upload token. Is URI set correctly?")
|
||||||
|
@ -296,7 +296,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
print_good("File uploaded to #{location}")
|
print_good("File uploaded to #{location}")
|
||||||
else
|
else
|
||||||
if upload.body.include? 'not a permitted file type'
|
if upload.body.include? 'not a permitted file type'
|
||||||
fail_with(Failure::NotVulnerable, "Wiki is not configured for DjVu files.")
|
fail_with(Failure::NotVulnerable, "Wiki is not configured for target files.")
|
||||||
else
|
else
|
||||||
fail_with(Failure::UnexpectedReply, "Failed to upload file.")
|
fail_with(Failure::UnexpectedReply, "Failed to upload file.")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue