linux后门文件检测

最近被木马搞疯了,不过还好有阿里云提醒,不过阿里云也可能有遗漏的地方,但是木马这东西如果以前就没注意,想找到源头还是有点困难的。所以,是时候来次大清洗了。
查找PHP木马

# find ./ -name “*.php” |xargs egrep “phpspy|c99sh|milw0rm|eval(gunerpress|eval(base64_decoolcode|spider_bc))” > /tmp/php.txt
//最常见的一句话木马eval($_POST[这里一般没有固定值]);,写入然后将结果写入eval.txt文件里再进行大扫除
# grep -r --include=*.php  '[^a-z]eval($_POST' . > eval.txt
# grep -r --include=*.php  'file_put_contents(.*$_POST\[.*\]);' . > grep.txt
# find ./ -name “*.php” -type f -print0 | xargs -0 egrep “(phpspy|c99sh|milw0rm|eval(gzuncompress(base64_decoolcode|eval(base64_decoolcode|spider_bc|gzinflate)” | awk -F: ‘{print $1}’ | sort | uniq

查找最近一天被修改的PHP文件

# find -mtime -1 -type f -name *.php

修改网站的权限

# find -type f -name *.php -exec chmod 444 {} ;
# find ./ -type d -exec chmod 555{} ;

猜你喜欢

转载自blog.csdn.net/zhou120189162/article/details/79354636