它是安全的拒绝访问.ini文件在.htaccess?它是、文件、安全、ini

2023-09-02 00:50:02 作者:梦港

我有一个.ini文件,在我的PHP应用程序水务局的敏感信息。我使用.htaccess文件拒绝访问到它:

I have a .ini file with sensitive information in my php wab app. I denied access to it using a .htaccess file:

<files my.ini>
  order deny,allow
  deny from all
</files>

我没有获得htdocs目录以外的文件夹,这样我就可以不动.ini文件出了可浏览的领土。

I don't have access to folders outside of htdocs, so I can't move the .ini file out of browsable territory.

是我的解决方案安全吗?

Is my solution safe?

推荐答案

本的.htaccess将阻止Web访问。不过,如果你使用一个共享的主机环境中,有可能对其他用户访问您的INI。如果它是一个(虚拟专用)服务器上,你该服务器你是安全的唯一用户。

The .htaccess will block access from the web. However, if you're using a shared hosting environment, it might be possible for other users to access your ini. If its on a (virtual private) server and you're the only user for that server you're safe.

在的情况下共同主办这取决于服务器配置。 欲了解更多信息阅读:PHP在共享宿主环境安全性

In case of shared hosting it depends on server configuration. For more info read: PHP Security in a shared hosting environment

您可以暂时安装 PHPShell 并浏览服务器的文件系统检查,如果你的服务器是脆弱的。 (需要一些命令行的知识)

You can temporarily install PHPShell and browse through the server filesystem to check if your server is vulnerable. (requires some commandline knowledge)

 
精彩推荐
图片推荐