### 简要描述:
mcms最新版SQL注入6枚打包(可出任意数据)
### 详细说明:
掌易科技的程序员反应相当快啊,确认漏洞当天就修复以后出新版本了,前面在wooyun提的几个漏洞新版的mcms做了相应的处理,发布了新版v_3.1.2.enterprise,再来研究研究。
在文件上传的地方存在过滤不严的情况,前台就有多处可以上传的地方,而且每个上传点都有2个参数存在注入,这里打包提交吧。
下面以用户头象上传点进行说明
注入2枚:/statichttps://images.seebug.org/upload/uploadify.php 这里是文件上传,mcms对用户的文件类型等做了不错的处理,但是忘记了使用sqlxss()方法来处理下注入问题了。这里有2个参数dir和filename,过滤不完全,可造成注入,我们看看是如何注入的。
看看代码/statichttps://images.seebug.org/upload/uploadify.php
```
$result = array();
$data=array();
if (!$upload -> upload()) {
$result = $upload -> getErrorMsg();
$data['code']=1;
$data['msg']=$result;
} else {
$result = $upload -> getUploadFileInfo();
$file=$result[0];
unset($file['type']);unset($file['key']);
$fields['file_md5']=$file['hash'];
$fields['file_oname']=pathinfo($file['name'], PATHINFO_FILENAME);
$fields['file_name']=pathinfo($file['savename'], PATHINFO_FILENAME);
$fields['file_extension']=$file['extension'];
$fields['file_size']=$file['size'];
$fields['create_time']=time();
$fields['file_url']=DOMAIN_UPLOAD.substr($file['savepath'],4).$file['savename'];
$dbm->single_insert(TB_PRE.'file',$fields);
```
上面代码中$fields['file_oname']和$fields['file_url']这两个参数存在注入。$fields['file_oname']通过pathinfo($file['name'], PATHINFO_FILENAME);得到,没有经过处理,可注入;$fields['file_url']是由$file['savepath']等组合而成,而$file['savepath']则是由用户POST的dir参数组成了,也没有经过防注处理,因此,这2个参数都存在注入。
下面以filename为例进行证明
因为是time-based blind 注入,猜测管理员用户名的第一个字母时,若错误,延迟2s左右,如下图
[<img src="https://images.seebug.org/upload/201503/04003143250a6f706db890023ddee76cf1d046ef.jpg" alt="猜测错误副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201503/04003143250a6f706db890023ddee76cf1d046ef.jpg)
若正确,延迟3s左右,如下图
[<img src="https://images.seebug.org/upload/201503/04003156e12371c12b186c9cf40afbc53d6b380d.jpg" alt="猜测成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201503/04003156e12371c12b186c9cf40afbc53d6b380d.jpg)
由下图可以证明dir也存在注入
[<img src="https://images.seebug.org/upload/201503/04003207f0c55202f33c4750ba0e6d918c8fc32d.jpg" alt="dir猜测成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201503/04003207f0c55202f33c4750ba0e6d918c8fc32d.jpg)
按上面的方法依次做下去(burp intruder或者自己写个脚本跑),可测试管理员用户名为:mcmsadmin,密码为: f6fdffe48c908deb0f4c3bd36c032e72
### 漏洞证明:
见 详细说明
暂无评论