* Enhanced version of php directory scanning monitoring
*
* @version 1.0
*
The following variables need to be set manually before use
*
**/
/*== =================== Program configuration=====================*/
$pass="test ";//Set password
$jkdir="."; //Set the directory for monitoring and scanning. The current directory is '.' and the upper-level directory is '..'. You can also set an absolute path without adding a slash after it. , the default is the current directory
$logfilename="./m.log";//Set the path to store the log, which can be placed anywhere
$exclude=array('data','images');//Exclude the directory
$danger='eval|cmd|passthru|gzuncompress';//Set the dangerous function to be found to determine whether it is a Trojan file
$suffix='php|inc';//Set the suffix of the file to be scanned
/*== =================== End of configuration=====================*/
$filename=$ _GET['filename'];
$check=$_GET['check'];
$jumpoff=false;
$url = $_SERVER['PHP_SELF'];
$thisfile = end(explode('/',$ url));
$jump="{$thisfile}|".implode('|',$exclude);
$jkdir_num=$file_num=$danger_num=0;
define('M_PATH',$jkdir);
define('M_LOG',$logfilename);
if ($check=='check')
{
$safearr = explode("|",$jump);
$start_time=microtime(true);
safe_check($ jkdir);
$end_time=microtime(true);
$total=$end_time-$start_time;
$file_num=$file_num-$jkdir_num;
$message= "Number of files:".$file_num;
$message.= " Number of folders: ".$jkdir_num;
$message.= " Number of suspicious files: ".$danger_num;
$message.= " Execution time: ".$total;
echo $message;
}else{
if ($_GET['m']=="del") Delete();//Process file deletion
//Read file content
if(isset($_GET['readfile'])){
//Output view Password, after the password is verified correctly, the file content will be output
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn