如何阻止 Apache 列出我的用户目录的内容
我最近在我的网站上运行了一些渗透测试软件,并惊讶地发现它报告我的一个目录列表可以公开访问。
这是可用的 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.
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在该目录中创建一个
.htaccess
文件,或者在 Apache 配置中创建一个...
块来指定:请参阅 < 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:See the Apache options directive documentation for more details.
Apache 中有一个命令可以让它显示索引。
删除这个,重新启动。这将使该 url 显示 403 Forbidden。
There is a command in Apache that will make it show indexes.
Remove this, restart. This will make that url show a 403 Forbidden.