测试版本是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)\\(|\\<script[\\s\\\\\\/]|\\b(?:eval|alert|prompt|msgbox)\\s*\\(|url\\((?:\\#|data|javascript)", 'sql'=>"[^\\{\\s]{1}(\\s|\\b)+(?:select\\b|update\\b|insert(?:(\\/\\*.*?\\*\\/)|(\\s)|(\\+))+into\\b).+?(?:from\\b|set\\b)|[^\\{\\s]{1}(\\s|\\b)+(?:create|delete|drop|truncate|rename|desc)(?:(\\/\\*.*?\\*\\/)|(\\s)|(\\+))+(?:table\\b|from\\b|database\\b)|into(?:(\\/\\*.*?\\*\\/)|\\s|\\+)+(?:dump|out)file\\b|\\bsleep\\([\\s]*[\\d]+[\\s]*\\)|benchmark\\(([^\\,]*)\\,([^\\,]*)\\)|(?:declare|set|select)\\b.*@|union\\b.*(?:select|all)\\b|(?:select|update|insert|create|delete|drop|grant|truncate|rename|exec|desc|from|table|database|set|where)\\b.*(charset|ascii|bin|char|uncompress|concat|concat_ws|conv|export_set|hex|instr|left|load_file|locate|mid|sub|substring|oct|reverse|right|unhex)\\(|(?:master\\.\\.sysdatabases|msysaccessobjects|msysqueries|sysmodules|mysql\\.db|sys\\.database_name|information_schema\\.|sysobjects|sp_makewebtask|xp_cmdshell|sp_oamethod|sp_addextendedproc|sp_oacreate|xp_regread|sys\\.dbms_export_extension)", 'other'=>"\\.\\.[\\\\\\/].*\\%00([^0-9a-fA-F]|$)|%00[\\'\\\"\\.]");
所以请算起相当的鸡肋了。
漏洞文件admin/shophelp.php
if ($_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.php
function 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); }