PHP脚本Webshell防御

创云数据官方 云虚拟主机相关 2016-09-07 1,017 次浏览 没有评论

1.防止php木马执行webshell

打开safe_mode,

在,php.ini中设置

disable_functions= passthru,exec,shell_exec,system

二者选一即可,也可都选

2.防止php木马读写文件目录

在php.ini中的

disable_functions= passthru,exec,shell_exec,system

后面加上php处理文件的函数

主要有

fopen,mkdir,rmdir,chmod,unlink,dir

fopen,fread,fclose,fwrite,file_exists

closedir,is_dir,readdir.opendir

fileperms.copy,unlink,delfile

即成为

disable_functions= passthru,exec,shell_exec,system,fopen,mkdir,rmdir,chmod,unlink,dir

,fopen,fread,fclose,fwrite,file_exists

,closedir,is_dir,readdir.opendir

,fileperms.copy,unlink,delfile

ok,大功告成,php木马拿我们没辙了,^_^

遗憾的是这样的话,利用文本数据库的那些东西就都不能用了。

发表评论

回顶部