下面是我的服务器上禁用的函数,其中phpinfo是有争议的,因为禁用了这个的话,某些比较另类的软件会对系统环境判断错误,所以建议需要的时候还是先放开,装好了以后再禁了它。

disable_functions = phpinfo,system,exec,shell_exec,passthru,error_log,dl,sys_getloadavg,pfsockopen,openlog,syslog,readlink,symlink,link,leak,popen,escapeshellcmd,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,escapeshellarg,pcntl_exec,show_source,highlight_file,ini_restore,apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,virtual,mb_send_mail,set_time_limit,max_execution_time,php_uname,disk_free_space,diskfreespace,stream_copy_to_stream

 

设置了这些以后,基本上所有PHP后门、webshell、木马什么的全都没用了。

作者 听涛

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注