[php]代码库
#!/usr/bin/perl
use File::Find;<p></p> <p>sub clean_file {
my $file = shift;
my $tmp = $file.".tmp";</p> <p> print "clean file $file ...\n";
open(FILE, $file) or die "can not open $file\n";
open(TMP, ">$tmp") or die "can not open $tmp\n";
while(
<file>
){
my $line = $_;
$line =~ s/^.*aWYoZnVuY3Rpb25fZXhpc.*$/
<!--?php/; # 此处的正则表达式根据需要修改注入代码的指纹即可<br /--> $line =~ s/\r\n$/\n/;
print TMP $line;
}
close(FILE);
close(TMP);
</file></p> <p> system("mv $tmp $file");
}</p> <p>sub process {
my $file = $File::Find::name;
if ($file =~/\.(php)$/i){
clean_file($file);
}
}</p>