Linux本身相对Win来讲安全点,因为好多人不会命令,这就是优点啊!但网站现在开源的这么多,所以漏洞也相对较多,一不小心网站被上传木马也是常有的事情。
收集和整理了一下利用find命令来查找一下是否网站被种木马了,无非是根据木马的特征代码来配对。
find ./ -name "*.php" |xargs egrep "phpspy|c99sh|milw0rm|eval\(gunerpress|eval\(base64_decode|spider_bc"> /tmp/php.txt
grep -r –include=*.php '[^a-z]eval($_POST' . > /tmp/eval.txt
grep -r –include=*.php 'file_put_contents(.*$_POST\[.*\]);' . > /tmp/file_put_contents.txt
find ./ -name "*.php" -type f -print0 | xargs -0 egrep "(phpspy|c99sh|milw0rm|eval\(gzuncompress\(base64_decode|eval\(base64_decode|spider_bc|gzinflate)" | awk -F: '{print $1}' | sort | uniq
查找最近一天被修改的PHP文件
find -mtime -1 -type f -name \*.php
修改网站php文件权限,只读
find -type f -name \*.php -exec chmod 444 {} \;
修改网站目录权限
find ./ -type d -exec chmod 555{} \;
按字母顺序浏览:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
→我们致力于为广大网民解决所遇到的各种电脑技术问题 如果您认为本词条还有待完善,请 编辑词条
上一篇无法识别USB可移动硬盘
下一篇WindowsXP系统假死机