漏洞利用前提:magic_quotes_gpc = off
更多工具在: http://www.isafe.cc/
flow. php頁面的goods_number變量沒有過濾導致字符型型注入,本漏洞利用前提是magic_quotes_gpc=off,關鍵代碼如下:
elseif ($_REQUEST['step'] == 'update_cart')
{
if (isset($_POST['goods_number']) && is_array($_POST['goods_number']))
{
flow_update_cart($_POST['goods_number']);
}
show_message($_LANG['update_cart_notice'], $_LANG['back_to_cart'], 'flow.php');
exit;
}
...................................
function flow_update_cart($arr)
{
/* 處理 */
foreach ($arr AS $key => $val)
{
$val = intval(make_semiangle($val));
if ($val <= 0)
{
continue;
}
//查詢:
$sql = "SELECT `goods_id`, `goods_attr_id`, `product_id`, `extension_code` FROM" .$GLOBALS['ecs']->table('cart').
" WHERE rec_id='$key' AND session_id='" . SESS_ID . "'";
$goods = $GLOBALS['db']->getRow($sql);
很明顯當"step=update_cart"時,goods_numberm沒有過濾導致字符型注入漏洞,所以構造如下參數,即可獲取管理員密碼的哈希