如何阻止 Apache 列出我的用户目录的内容

发布于 2024-08-13 16:00:52 字数 416 浏览 11 评论 0原文

我最近在我的网站上运行了一些渗透测试软件,并惊讶地发现它报告我的一个目录列表可以公开访问。

这是可用的 root 用户的目录。

http://www.example.com/~root/

页面内容结果:

Index of /~root

    * Parent Directory
    * cgi-bin/

< em>平台:我正在使用 Linux 上的 Symfony 和 Apache 创建 PHP 网站。

这是我可以通过 Apache 配置的东西吗?

I recently ran some penetration testing software on my web site and was surprised for it to report that one of my directory listings was publicly accessible.

It is the directory of the root user which is available.

http://www.example.com/~root/

Results in this page content:

Index of /~root

    * Parent Directory
    * cgi-bin/

Platform: I am creating PHP websites, with Symfony on Linux with Apache.

Is this something that I can configure through Apache?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨后咖啡店 2024-08-20 16:00:52

您可以在该目录中创建一个 .htaccess 文件,或者在 Apache 配置中创建一个 ... 块来指定:


Options -Indexes

请参阅 < a href="http://httpd.apache.org/docs/1.3/mod/core.html#options" rel="nofollow noreferrer">Apache 选项指令文档 了解更多详细信息。

You could create a .htaccess file in that directory, or have a <directory>...</directory> block in your Apache configuration that specifies:


Options -Indexes

See the Apache options directive documentation for more details.

节枝 2024-08-20 16:00:52

Apache 中有一个命令可以让它显示索引。

Options +Indexes

删除这个,重新启动。这将使该 url 显示 403 Forbidden。

There is a command in Apache that will make it show indexes.

Options +Indexes

Remove this, restart. This will make that url show a 403 Forbidden.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文