首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >suphp如何禁用ls /

suphp如何禁用ls /
EN

Server Fault用户
提问于 2013-06-30 19:26:50
回答 1查看 197关注 0票数 0

使用suphp,我为每个虚拟主机设置了一个php.ini。在php.ini中,我还设置了:

代码语言:javascript
复制
open_basedir = /home/site1

php脚本运行,但是如果我有一个带有ls /我可以看到整个根目录的脚本。

怎么能关闭这个洞的安全?

代码语言:javascript
复制
<VirtualHost *:80>
ServerName site1
ServerAlias www.site1.com

DirectoryIndex index.html index.htm
DocumentRoot /home/site1/

suPHP_Engine on
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php

# THIS READ php.ini
suPHP_ConfigPath /home/site1/

<Directory /home/site1/>

Options -Includes -Indexes -FollowSymLinks -ExecCGI -MultiViews
AllowOverride none
Order allow,deny
Allow from all
 </Directory>
</VirtualHost>
EN

回答 1

Server Fault用户

发布于 2013-06-30 19:30:00

可以禁用外部二进制文件的执行以消除此行为。

更新您可以这样做,您必须编辑您的php.ini

代码语言:javascript
复制
disable_functions=exec,passthru,shell_exec,
        system,proc_open,popen,curl_exec,
        curl_multi_exec,parse_ini_file,show_source 

(为了清晰起见,我包括了行间隔。)

这是原始网址:http://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/519747

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档