diabliyo

sha1cracker.c

Sep 12th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.13 KB | None | 0 0
  1. /*
  2. ..:: Elite-Mexicana ::.. ~~ Redes, Seguridad y Codigo Abierto ~~
  3. Coder: Diabliyo <darkdiabliyo@hotmail.com>
  4.  
  5. Fichero: explota.c
  6. Source: Lenguaje C
  7. SO: Sistemas Unis ( cualquier distro )
  8.  
  9. ~~~ Rebienta Passwords v1.0 en C ~~~
  10. Programa que utiliza Bruteforcing para explotar password introducirdo por le usuario.
  11. Mas que nada es un algoritmo basico en el cual se realizan comparaciones desde 1 caracter hasta 5 caracteres.
  12.  
  13. Este crackeador de passwords solo lustra la forma de como conseguir un password realizando bruteforcing :D,
  14. unicamente soporta cadenas hasta maximo 6 caracteres :D... de 0-9, A-Z y a-z :D
  15.  
  16. http://www.iespana.es/darkdiabliyo/index.php
  17.  
  18. Codigo Fuente para Unix ;).
  19. Slackware, el mejor !!!
  20. */
  21.  
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. #include <time.h>
  26.  
  27. #define N 7
  28.  
  29. void inicializar( char *pwd );
  30.  
  31. void inicializar( char *pwd )
  32.     {
  33.     int i;
  34.    
  35.     for( i=0; i<N; i++, *pwd++ )
  36.         *pwd='\0';
  37.     }
  38.  
  39. int main()
  40.     {
  41.     char bruteforcing[]={ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
  42.     int a[N], c[N];
  43.     char cad[N], pwd[N];
  44.     clock_t reloj1, reloj2;
  45.     float tiempo;
  46.  
  47.     system( "clear" );
  48.     inicializar( pwd );
  49.     printf( "Buffer de Pass: %i", sizeof(pwd)-1 );
  50.     printf( "\nPassword a Explotar: " );
  51.     scanf( "%s", cad );
  52.  
  53.     reloj1= clock(); /*captura tiempo de inicio*/
  54.     for( a[0]=N, c[0]=0; c[0]<=sizeof(bruteforcing); c[0]++ )
  55.         {
  56.         for( a[1]=a[0]-1, c[1]=0; c[1]<=sizeof(bruteforcing); c[1]++ )
  57.             {
  58.             for( a[2]=a[1]-1, c[2]=0; c[2]<=sizeof(bruteforcing); c[2]++ )
  59.                 {
  60.                 for( a[3]=a[2]-1, c[3]=0; c[3]<=sizeof(bruteforcing); c[3]++ )
  61.                     {
  62.                     for( a[4]=a[3]-1, c[4]=0; c[4]<=sizeof(bruteforcing); c[4]++ )
  63.                         {
  64.                         for( a[5]=a[4]-1, c[5]=0; c[5]<=sizeof(bruteforcing); c[5]++ )
  65.                             {
  66.                             for( a[6]=a[5]-1, c[6]=0; c[6]<=sizeof(bruteforcing); c[6]++ )
  67.                                 {
  68.                                 for( a[7]=a[6]-1, c[7]=0; c[7]<=sizeof(bruteforcing); c[7]++ )
  69.                                     {
  70.                                     if( !strcmp( cad, pwd ) )
  71.                                         {
  72.                                         reloj2= clock(); /*captura tiempo de fin*/
  73.                                         tiempo= ((float)reloj1-(float)reloj2)/CLOCKS_PER_SEC;
  74.                                         printf( "\n\n\t*****************************************" );
  75.                                         printf( "\n\t*\tPassword Reventado es: %s\t*\n", pwd );
  76.                                         printf( "\n\t*\tTiempo: %.2f segundos\t*\n", tiempo );
  77.                                         printf( "\t*****************************************\n\n" );
  78.                                         getchar();
  79.                                         exit(0);
  80.                                         }
  81.                                     pwd[a[7]]=bruteforcing[c[7]];
  82.                                     }
  83.                                 pwd[a[6]]=bruteforcing[c[6]];
  84.                                 }
  85.                             pwd[a[5]]=bruteforcing[c[5]];
  86.                             /*printf( "\nCalando combinacion: %s", pwd );*/
  87.                             }
  88.                         pwd[a[4]]=bruteforcing[c[4]];
  89.                         }
  90.                     pwd[a[3]]=bruteforcing[c[3]];
  91.                     }
  92.                 pwd[a[2]]=bruteforcing[c[2]];
  93.                 }
  94.             pwd[a[1]]=bruteforcing[c[1]];
  95.             }
  96.         pwd[a[0]]=bruteforcing[c[0]];
  97.         }
  98.     printf( "\n\nPassword No Encontrado" );
  99.     getchar();
  100.     return 0;
  101.     }
Add Comment
Please, Sign In to add comment