elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] MD5 Crack 0.2
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] MD5 Crack 0.2  (Leído 1,412 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] MD5 Crack 0.2
« en: 16 Junio 2012, 20:21 pm »

Simple script para crackear un hash MD5 mediante un diccionario.

Código
  1. #!usr/bin/perl
  2. #MD5 Crack 0.2
  3. #Coded By Doddy H
  4. #Test with
  5. #098f6bcd4621d373cade4e832627b4f6 : test
  6. #cc03e747a6afbbcbf8be7668acfebee5 : test.123
  7. #1943b8b39ca8df2919faff021e0aca98 : testar
  8. #177dac170d586383bcc889602b2bb788 : testar.123
  9.  
  10. use Digest::MD5 qw(md5_hex);
  11.  
  12. head();
  13. while (1) {
  14.    print qq(
  15.  
  16. [++] Options
  17.  
  18. [+] 1 : Crack hash
  19. [+] 2 : Crack hashes
  20.  
  21. );
  22.    print "\n[+] Option : ";
  23.    chomp( my $op = <stdin> );
  24.  
  25.    if ( $op eq "1" ) {
  26.        print "\n[+] MD5 : ";
  27.        chomp( my $md5 = <stdin> );
  28.        print "\n[+] Salt : ";
  29.        chomp( my $salt = <stdin> );
  30.        print "\n[+] Wordlist : ";
  31.        chomp( my $wordlist = <stdin> );
  32.        crackhash( $md5, $salt, $wordlist );
  33.    }
  34.    elsif ( $op eq "2" ) {
  35.        print "\n[+] File : ";
  36.        chomp( my $md5 = <stdin> );
  37.        print "\n[+] Salt : ";
  38.        chomp( my $salt = <stdin> );
  39.        print "\n[+] Wordlist : ";
  40.        chomp( my $wordlist = <stdin> );
  41.        crackhashes( $md5, $salt, $wordlist );
  42.    }
  43.    else {
  44.        print "\n\n[-] Bad option\n";
  45.    }
  46.  
  47. }
  48. copyright();
  49.  
  50. sub crackhashes {
  51.  
  52.    my ( $file, $salt, $wordlist ) = @_;
  53.    my @hashes = openwordlist($file);
  54.  
  55.    my $formar;
  56.  
  57.    for my $md5 (@hashes) {
  58.        chomp $md5;
  59.        my $formar = $md5;
  60.  
  61.        if ( ver_length($md5) ) {
  62.  
  63.            my @words = openwordlist($wordlist);
  64.  
  65.            print "[+] Cracking ....\n\n";
  66.  
  67.            for my $word (@words) {
  68.                chomp $word;
  69.  
  70.                my $formardos;
  71.  
  72.                if ( $salt eq "" ) {
  73.                    $formardos = md5_hex($word);
  74.                }
  75.                else {
  76.                    $formardos = md5_hex( $word . $salt );
  77.  
  78.                }
  79.  
  80.                if ( $formar eq $formardos ) {
  81.                    print "\n\a[+] Cracked : " . $formar . ":" . $word . "\n";
  82.                    savefile( "md5-found.txt", $formar . ":" . $word );
  83.                    last;
  84.                }
  85.                else {
  86.                    print $formar. " =! " . $formardos . "\n";
  87.                }
  88.            }
  89.        }
  90.        else {
  91.            print "\n[-] Hash invalid";
  92.            last;
  93.        }
  94.    }
  95. }
  96.  
  97. sub crackhash {
  98.  
  99.    my ( $md5, $salt, $wordlist ) = @_;
  100.    my $formar = $md5;
  101.  
  102.    if ( ver_length($md5) ) {
  103.  
  104.        my @words = openwordlist($wordlist);
  105.  
  106.        print "[+] Cracking ....\n\n";
  107.  
  108.        for my $word (@words) {
  109.            chomp $word;
  110.  
  111.            my $formardos;
  112.  
  113.            if ( $salt eq "" ) {
  114.                $formardos = md5_hex($word);
  115.            }
  116.            else {
  117.                $formardos = md5_hex( $word . $salt );
  118.            }
  119.  
  120.            if ( $formar eq $formardos ) {
  121.                print "\n\a[+] Cracked : " . $formar . ":" . $word . "\n";
  122.                savefile( "md5-found.txt", $formar . ":" . $word );
  123.                copyright();
  124.            }
  125.            else {
  126.                print $formar. " =! " . $formardos . "\n";
  127.            }
  128.        }
  129.  
  130.    }
  131.    else {
  132.        print "\n[-] Hash invalid";
  133.    }
  134.  
  135. }
  136.  
  137. sub ver_length {
  138.    return true if length( $_[0] ) == 32;
  139. }
  140.  
  141. sub openwordlist {
  142.  
  143.    my ( $file, $tipo ) = @_;
  144.  
  145.    print "\n[+] Opening file\n\n";
  146.  
  147.    unless ( -f $file ) {
  148.        print "\n[-] File not found\n";
  149.        copyright();
  150.    }
  151.  
  152.    open( FILE, $file );
  153.    my @words = <FILE>;
  154.    close FILE;
  155.  
  156.    print "[+] Words Found : " . int(@words) . "\n\n";
  157.  
  158.    return @words;
  159.  
  160. }
  161.  
  162. sub repes {
  163.    my @limpio;
  164.    foreach $test (@_) {
  165.        push @limpio, $test unless $repe{$test}++;
  166.    }
  167.    return @limpio;
  168. }
  169.  
  170. sub savefile {
  171.    open( SAVE, ">>" . $_[0] );
  172.    print SAVE $_[1] . "\n";
  173.    close SAVE;
  174. }
  175.  
  176. sub head {
  177.    print qq(
  178.  
  179.  
  180. @     @  @@@@    @@@@@     @@@@  @@@@@     @     @@@@  @   @
  181. @     @  @   @   @        @    @ @    @    @    @    @ @  @  
  182. @@   @@  @    @  @        @      @    @   @ @   @      @ @  
  183. @@   @@  @    @  @@@@     @      @    @   @ @   @      @@    
  184. @ @ @ @  @    @  @   @    @      @@@@@   @   @  @      @@    
  185. @ @ @ @  @    @      @    @      @    @  @   @  @      @ @  
  186. @  @  @  @    @      @    @      @    @  @@@@@  @      @  @  
  187. @  @  @  @   @   @   @    @    @ @    @ @     @ @    @ @   @
  188. @     @  @@@@     @@@      @@@@  @    @ @     @  @@@@  @    @
  189.  
  190.  
  191.  
  192. );
  193. }
  194.  
  195. sub copyright {
  196.    print "\n\n-- == (C) Doddy Hackman 2012\n\n";
  197.    <stdin>;
  198.    exit(1);
  199. }
  200.  
  201. #The End ?
  202.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
perl
Scripting
nobo 0 3,206 Último mensaje 22 Febrero 2005, 07:49 am
por nobo
Perl
Scripting
zhynar_X 2 2,237 Último mensaje 12 Enero 2008, 04:36 am
por GroK
-=PERL=-
Scripting
D4RIO 1 5,727 Último mensaje 25 Febrero 2008, 17:27 pm
por D4RIO
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 3,845 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl Tk] MD5 Crack 0.2
Scripting
BigBear 0 1,730 Último mensaje 16 Junio 2012, 20:21 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines