struts漏洞修复(升级到2.3.15)

测试方法
访问地址:http://Host/login.action?redirect:http://www.baidu.com,是否跳转到百度
 
或者:是否弹出计算器
http://Host/login.action?('\43_memberAccess[\'allowStaticMethodAccess\']')(meh)=true&(aaa)(('\43context[\'xwork.MethodAccessor.denyMethodExecution\']\u003d\43foo')('\\43foo\u003dnew\u0020java.lang.Boolean("false")'))&(asdf)(('@java.lang.Runtime@getRuntime().exec("calc")')(a))=1
 
 

漏洞修复步骤:

需要升级以下包:
struts2-core-2.3.15.1.jar

struts2-spring-plugin-2.3.15.1.jar

xwork-core-2.3.15.1.jar

commons-lang3-3.1.jar

ognl-3.0.6.jar


删除webwork.jar包,去除其他相应的旧版本的jar包,保留commons-lang的旧版本

 

2、修改web.xml文件中的Struts2过滤器配置如下:

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

 

3.struts配置文件重复

Unable to load configuration. - bean - jar:file:/E:/tomcat-7.0.11/webapps/struts/WEB-INF/lib/struts2-core-2.2.3.jar!/struts-default.xml:
项目中已经存在struts-default.xml,和struts2-core-2.2.3.jar包下的struts-default.xml文件冲突,要删除其中一个文件;

 

 

转载自:
http://eddysoft.iteye.com/blog/1911561http://nassir.iteye.com/blog/1910100http://security.ctocio.com.cn/100/11466600_4.shtml

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值