webshell后门我相信大家都见过,站长也都清理过木马。今天分享一个快速查找的办法:
木马里面常用的php函数:
set_time_limit
(禁止报错)
定义和用法
error_reporting()
函数跪地你给应该报告何种 PHP 错误。
error_reporting()
函数能够在运行时设置 error_reporting
指令。
PHP 有诸多错误级别,使用该函数可以设置在脚本运行时的级别。如果没有设置可选参数 level,error_reporting() 仅会返回当前的错误报告级别。
实例:
<?php
// 关闭错误报告
error_reporting(0);
// 报告 runtime 错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// 报告所有错误
error_reporting(E_ALL);
// 等同 error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// 报告 E_NOTICE 之外的所有错误
error_reporting(E_ALL & ~E_NOTICE);
?>
error_reporting
(永不过期)
bool set_time_limit ( int $seconds )
设置允许脚本运行的时间,单位为秒。如果超过了此设置,脚本返回一个致命的错误。默认值为30秒,或者是在php.ini的max_execution_time被定义的值,如果此值存在。
当此函数被调用时,set_time_limit()会从零开始重新启动超时计数器。换句话说,如果超时默认是30秒,在脚本运行了了25秒时调用 set_time_limit(20),那么,脚本在超时之前可运行总时间为45秒。
参数
seconds
最大的执行时间,单位为秒。如果设置为0(零),没有时间方面的限制。
返回值
成功时返回 TRUE,失败时返回 FALSE 。
查找语句:
find . -type f -name '*.php'|xargs grep 'set_time_limit'
find . -type f -name '*.php'|xargs grep 'error_reporting'
password='heiyan'
木马的密码为heiyan
find . -type f -name '*.php'|xargs grep 'heiyan'
查找文件中包含heiyan的文件
function httpcopy
意思同上下
find . -type f -name '*.php'|xargs grep 'function httpcopy'
tiangou748
木马密码为tiangou748
find . -type f -name '*.php'|xargs grep 'tiangou748'
查找文件中包含密码的文件。
error_reporting(0);$sr=
find . -type f -name '*.php'|xargs grep '$sr='
phpc.sinaapp.com
find . -type f -name '*.php'|xargs grep 'phpc.sinaapp.com' | awk -F: '{print $1}' | xargs rm -rf
find . -name \* -type f -print | xargs grep "hostname" | awk -F: '{print $1}' | xargs rm -rf