【问题标题】:Hidden directory detected apache 2.4隐藏目录检测到 apache 2.4
【发布时间】:2018-05-12 03:19:12
【问题描述】:

我在 apache 2.4 中发现了一个与安全相关的问题。当我试图在浏览器 url 中点击以下链接时-

  • http://example.com/aux/
  • http://example.com/cgi-bin/
  • http://example.com/com2/
  • http://example.com/com1/
  • 我得到:-

    禁止 403 您无权访问此服务器上的 /com2。

    如何从 403 权限被拒绝重定向到 402 页面未找到?

    【问题讨论】:

      标签: apache apache2.4


      【解决方案1】:

      多种方式之一:

      AliasMatch ^/(aux|cgi-bin|com1|com2)/ /doesnotexist
      

      【讨论】:

        【解决方案2】:

        对于非 SSL(保留在 httpd.confIfModule mod_rewrite.c 内)

        RewriteRule /(com[1-9]|aux|con)/?$ /404 [L,NC]
        

        对于 SSL(保留在 httpd-ssl.confVirtualHost 内)

        RewriteRule /(com[1-9]|aux|con)/?$ /404 [L,NC]
        

        【讨论】:

          猜你喜欢
          • 2013-10-26
          • 2017-07-18
          • 1970-01-01
          • 1970-01-01
          • 2021-03-14
          • 1970-01-01
          • 1970-01-01
          • 2020-10-03
          • 2014-12-16
          相关资源
          最近更新 更多