Linux中shell命令查找PHP木马方法介绍
发布时间:2022-06-22 13:25:33 所属栏目:Linux 来源:互联网
导读:在linux中如果我们要查找木马可以使用几句命令就能快速查出来了,当然下面的代码只是根据php木马的特点来进行查找的哦,下面PHP粉丝网小伙伴就为各位同学介绍一下吧. 一句话查找PHP木马,代码如下: # find ./ -name *.php |xargs egrep phpspy|c99sh|milw0rm|
在linux中如果我们要查找木马可以使用几句命令就能快速查出来了,当然下面的代码只是根据php木马的特点来进行查找的哦,下面PHP粉丝网小伙伴就为各位同学介绍一下吧. 一句话查找PHP木马,代码如下: # find ./ -name "*.php" |xargs egrep "phpspy|c99sh|milw0rm|eval\(gunerpress|eval\(base64_decoolcode|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_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 {} \; --phpfensi.com # find ./ -type d -exec chmod 555{} \; 常见的一句话后门,代码如下: grep -r --include=*.php '[^a-z]eval($_POST' . > grep.txt grep -r --include=*.php 'file_put_contents(.*$_POST\[.*\]);' . > grep.txt 把搜索结果写入文件,下载下来慢慢分析,其他特征木马、后门类似,有必要的话可对全站所有文件来一次特征查找,上传图片肯定有也捆绑的,来次大清洗. 禁用不常用函数,将用不到的权限又比较大的php函数在php.ini文件里禁掉,修改方法如下: disable_functions = system,exec,shell_exec ……… (编辑:张家口站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux-networking – 在Docker中运行nuttcp时出现分段错误
- linux – 使用30GB数据备份Web服务器的最佳方法是什么?
- 告诉你如何通过 chroot 恢复 Arch Linux 系统
- Linux不能用root账号登录系统怎么办
- Fresh Red Hat Enterprise Linux无法使用yum安装httpd
- Linux中内存监控内存泄露和回收内存的方法
- Linux Kernel 5.7-rc5发布,更多变化但不必担忧
- linux – df显示已使用的负值
- Linux下如何装载windows分区的FAT32 FAT16文件系统
- linux系统nginx php-fpm安装php memcache扩展
站长推荐