• Apache Tomcat默认文件漏洞


    转载自: 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就好了;

  • 相关阅读:
    NOIP201105铺地毯
    50148155HYF旅游
    连通性判断
    传递消息1
    找朋友
    5796: 最短Hamilton路径(状压dp)
    2283: A Mini Locomotive(01背包)
    2616: Cow Frisbee Team(01背包)
    2593: Secret Message(字典树)
    Stammering Aliens(二分+Hash 卡过)
  • 原文地址:https://www.cnblogs.com/huaixiaonian/p/14326410.html
Copyright © 2020-2023  润新知