CentOS Linux系统如何查找webshell后门,有哪些搜索常用命令

CentOS Linux系统如何查找webshell后门,有哪些搜索常用命令

在检测webshell后门时,我们一般会判断文件修改的内容、时间、匹配的对应内容等信息。Windows系统有特定的软件,如:D盾,支持win2003/win2008/win2012/win2016等系统,为IIS设计的一个主动防御的保护软件,以内外保护的方式防止网站和服务器给入侵,在正常运行各类网站的情况下,越少的功能,服务器越安全的理念而设计! 限制了常见的入侵方法,让服务器更安全!

 

Linux系统我们利用find命令、grep命令进行查找

 

# find ./ -name “*.php” |xargs egrep “phpspy|c99sh|milw0rm|eval(gunerpress|eval(base64_decoolcode|spider_bc))” > /tmp/php.txt

 

将查找的结果写入/tmp/php.txt文件,我们可以查看该文件得到结果

 

grep -r –include=*.php ‘[^a-z]eval($_POST’ . > /tmp/eval.txt

 

将查找的结果写入/tmp/eval.txt文件,我们可以查看该文件得到结果

 

grep -r –include=*.php ‘file_put_contents(.*$_POST[.*]);’ . > /tmp/file_put_contents.txt

 

将查找的结果写入/tmp/file_put_contents.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{} ;

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容