fastadmin 相关安全配置
开发阶段请给予项目全部的777权限。
生产环境首先全部设置为555权限,
runtime目录设置为755权限
public/uploads目录设置为755权限并禁用PHP脚本执行
nginx如何禁止指定目录php脚本执行权限 nginx不允许某个目录执行php怎么设置
nginx如何禁止指定目录php脚本执行权限,nginx不允许某个目录执行php怎么设置,有些目录比如上传目录(uploads)是不能运行执行php的,要不网站就会出现漏洞,有被攻破的危险
具体代码如下:
location ~* ^/(upload|uploads|images|static)/.*.(php|php5)$ {
deny all;
}
里面的目录可以替换成自己需要禁止脚本的目录
注意这一段代码一定要放在下面的代码之前:
include enable-php-73.conf;(这个是你调用的php版本)
其他病毒文件搜索
find / -iname “*.php” | xargs grep -H -n “eval\(base64_decode”
寻找PHP(网站)挂马,后门
发布时间:2017-06-07
一
php后门木马常用的函数大致上可分为四种类型:
-
执行系统命令: system, passthru, shell_exec, exec, popen, proc_open
-
代码执行与加密: eval, assert, call_user_func,base64_decode, gzinflate, gzuncompress, gzdecode, str_rot13
-
文件包含与生成: require, require_once, include, include_once, file_get_contents, file_put_contents, fputs, fwrite
-
.htaccess: SetHandler, auto_prepend_file, auto_append_file
二
想找一个 关键词是“hellow word” 在哪些文件中有,我们用grep命令
grep --color -i -r -n “hellow word” /data/www/
这样就能搜索出来 文件中包含关键词的文件
–color是关键词标红
-i是不区分大小写
-r是包含子目录的搜索
-d skip忽略子目录
可以用以上命令查找网站项目里的带有挂马的文件
三