一、漏洞描述:
WEB-INF/web.xml 部署描述符文件描述了如何在 Servlet 容器(如 Tomcat)中部署 Web 应用程序。通常,此文件应该无法访问。但是,Acunetix WS能够通过使用各种编码和目录遍历变体来读取此文件的内容。
由 Java EE 审计发现
二、漏洞影响:
配置文件将泄露敏感信息,这些信息将帮助恶意用户准备更高级的攻击。
三、修复漏洞:
限制对此文件的访问。
四、修复步骤:
直接删除docs目录和examples目录
rm -rf xxx
修改默认错误页面
vim conf/web.xml
在文件的末尾添加以下配置:
<error-page>
<error-code>400</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
自定义错误页面
vim error.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>网页无法访问</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="404/error_all.css?t=201303212934">
</head>
<body class="error-404">
<div id="doc_main">
<section class="bd clearfix">
<div class="module-error">
<div class="error-main clearfix">
<div class="label"></div>
<div class="info">
<h3 class="title">您所访问的页面有问题</h3>
<div class="reason">
<p>可能的原因:</p >
<p>URL失效了</p >
</div>
</div>
</div>
</div>
</section>
</div>
</body></html>
重启Tomcat