轉載自: https://blog.csdn.net/weixin_43837718/article/details/98726253
一、概要
漏洞描述:默認錯誤頁面,默認索引頁面,示例JSP和/或示例servlet安裝在遠程Apache Tomcat服務器上。應刪除這些文件,因為它們可能有助於攻擊者發現有關遠程Tomcat安裝或主機本身的信息。
漏洞風險:中
修復建議:刪除默認索引頁並刪除示例JSP和servlet。按照Tomcat或OWASP說明更換或修改默認錯誤頁面。
二、解決辦法
1、直接刪除docs目錄和examples目錄;
2、修改默認錯誤頁面;
<1>.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>
<2>.自定義錯誤頁面
vim /root/apache-tomcat-8.5.35/webapps/ROOT/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">Sorry,你所訪問的頁面有問題哦</h3> <div class="reason"> <p>可能的原因:</p > <p>1.手寫有問題。</p > <p>2.URL失效了?</p > </div> </div> </div> </div> </section> </div> </body> </html>
重啟tomcat就好了;