S2-045漏洞利用工具&解决方案

简单的重复造一个轮子,漏洞危害蛮大的

影响版本:Struts 2.3.5 - Struts 2.3.31,Struts 2.5 - Struts 2.5.10

仅供学习测试使用,严禁非法操作!

下载链接

 

修复建议:

1.很官方的解释 升级struts2版本

2.做过滤器

获取Content-Type的值,如果包含了某些特征进行过滤pass(治标不治本,有被绕过的可能)  //当时写的也被证实了,确实存在绕过S2-046,所以大家尽量升级。

类似:(网上随意找,仅供参考思路)

protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,FilterChain chain) throws ServletException, IOException {
    String contentType=request.getContentType();
    if(contentType!=null&&contentType.indexOf("ognl")!=-1){  //特征字符
        System.out.println(contentType);
        return;
    }else{  
        chain.doFilter(request, response);
    }
}

 

posted @ 2017-03-07 18:53  sevck  阅读(9108)  评论(4编辑  收藏  举报