打开php.ini,查找disable_functions,按如下设置禁用一些函数
disable_functions =phpinfo,exec,passthru,shell_exec,system,...name \*.php -exec chmod 444 {} \;
find -type d -exec chmod 555 {} \;
注:当然要排除上传目录、缓存目录等;
同时最好禁止chmod函数...PHP配置
禁用危险函数:
dl,eval,exec,passthru,system,popen,shell_exec,proc_open,proc_terminate,curl_exec,curl_multi_exec...查找近2天被修改过的文件:
find -mtime -2 -type f -name \*.php
注意:攻击者可能会通过touch函数来修改文件时间属性来避过这种查找,所以touch必须禁止
最后要及时补上