测试版本是v3.0.0 RELEASE 20160518。由于全局包含了一个文件require_once(dirname(__FILE__) . '/safety.php');
然而这个正则还无法绕过$args_arr=array(
'xss'=>"[\\'\\\"\\;\\*\\].*\\bon[a-zA-Z]{3,15}[\\s\\r\\n\\v\\f]*\\=|\\b(?:expression)\\(|\\
'other'=>"\\.\\.[\\\\\\/].*\\%00([^0-9a-fA-F]|$)|%00[\\'\\\"\\.]");
所以请算起相当的鸡肋了。
漏洞文件admin/shophelp.phpif ($_REQUEST['act'] == 'update')
{
/* 权限判断 */
admin_priv('shophelp_manage');
/* 检查重名 */
if ($_POST['title'] != $_POST['old_title'] )
{
$exc_article->is_only('title', $_POST['title'], $_LANG['articlename_exist'], $_POST['id']);
}
/* 更新 */
if ($exc_article->edit("title = '$_POST[title]', cat_id = '$_POST[cat_id]', article_type = '$_POST[article_type]', content = '$_POST[FCKeditor1]'", $_POST['id']))
{
/* 清除缓存 */
clear_cache_files();
$link[0]['text'] = $_LANG['back_list'];
$link[0]['href'] = 'shophelp.php?act=list_article&cat_id='.$_POST['cat_id'];
sys_msg(sprintf($_LANG['articleedit_succeed'], $_POST['title']), 0, $link);
admin_log($_POST['title'], 'edit', 'shophelp');
}
}
只是需要post进去的title跟old_title不一致,就进入了is_only的处理,继续跟下函数is_only
admin\includes\cls_exchange.phpfunction is_only($col, $name, $id = 0, $where='')
{
$sql = 'SELECT COUNT(*) FROM ' .$this->table. " WHERE $col = '$name'";
$sql .= empty($id) ? '' : ' AND ' . $this->id . " <> '$id'";
$sql .= empty($where) ? '' : ' AND ' .$where;
return ($this->db->getOne($sql) == 0);
}
对其中对$id没有做任何处理,直接就导致了注入。好吧,其实采用这个函数的都存在这个问题
查看执行的语句
仔细查看了下,发现updatexml貌似没有在其中,所以还是可以继续出内容的