关于struts漏洞之---/struts/webconsole.html

使用扫描工具扫描出struts项目存放访问 路径:http:host:port/web//struts/webconsole.html,

刚开始以为是在项目的struts.xml配置文件中开启了开发模式,后来发现无论开启与否,甚至显式的关闭开发模式,这个链接都可以访问,

于是上网看看别人的解决办法,从先解决问题出发,按网上的办法进入如下路径:

struts2-core-*.jar\org\apache\struts2\interceptor\debugging\

删除了里面的所有静态文件,ftl,html,js,css,

再访问就变成404了,问题到此基础解决了,先交差吧,但,是否就只有这个“无奈”的解决方法呢?

于是将视线转向国外,在SO上找到如下两个自称解决办法的“办法”:

struts.xml中添加<constant name="struts.action.excludePattern" value="/struts/webconsole.html" />

web.xml中添加

<security-constraint>
  <web-resource-collection>
    <web-resource-name>OGNLconsole</web-resource-name>
    <url-pattern>*/struts/webconsole.*</url-pattern>
  </web-resource-collection>
</security-constraint>

经测试,这两种都“不能”解决问题,为什么使用双引号呢,因为如果真一点用的都没有,就干脆不用提了,

这两种方法方法都基于一种思想:权限,

第一种方法是想把某些url排除,而第二种方法也是对url进行详细配置,包括权限,

经过改良,第一种改成,必须使用 * ,不能是详细的后缀等形式

<constant name="struts.action.excludePattern" value="/static/.*" />

第二种改成正好相反,必须详细到后缀,不能使用万用格式 *

<security-constraint>
  <web-resource-collection>
    <web-resource-name>OGNLconsole</web-resource-name>
    <url-pattern>/struts/webconsole.
html</url-pattern>
  </web-resource-collection>
  <auth-constraint/>
</security-constraint>

至此,经过改良,已经不需要再对jar包进行修改了,应用的配置功能得以体现。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
192.168.85.1 - - [26/Jun/2022:06:07:07 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 24 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 24 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 24 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 200 12925 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 200 12925 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 200 12925 192.168.85.1 - - [26/Jun/2022:06:07:11 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 200 14 192.168.85.1 - - [26/Jun/2022:06:08:06 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 15 192.168.85.1 - - [26/Jun/2022:06:08:16 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 1227 192.168.85.1 - - [26/Jun/2022:06:10:15 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 79 192.168.85.1 - - [26/Jun/2022:06:13:25 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 404 752 192.168.85.1 - - [26/Jun/2022:06:16:42 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 35 192.168.85.1 - - [26/Jun/2022:06:16:57 -0400] "GET //struts2-showcase/hhh.jsp HTTP/1.1" 403 642 192.168.85.1 - - [26/Jun/2022:06:18:55 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 35 192.168.85.1 - - [26/Jun/2022:06:19:02 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 35 192.168.85.1 - - [26/Jun/2022:06:19:09 -0400] "GET //struts2-showcase/hhh1.jsp HTTP/1.1" 403 642 192.168.85.1 - - [26/Jun/2022:06:19:34 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 400 192.168.85.1 - - [26/Jun/2022:06:20:37 -0400] "POST /struts2-showcase/index.action HTTP/1.1" 500 5 192.168.85.1 - - [26/Jun/2022:06:20:42 -0400] "GET //struts2-showcase/hhh1.jsp HTTP/1.1" 403 642 192.168.85.1 - - [26/Jun/2022:06:20:46 -0400] "GET //struts2-showcase/hhh.jsp HTTP/1.1" 403 642 192.168.85.1 - - [26/Jun/2022:06:20:51 -0400] "GET /struts2-showcase/hhh.jsp HTTP/1.1" 403 642
07-12

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值