PHP Forum - Coding Board
Juli 15, 2018, 11:42:49 *
Willkommen Gast. Bitte einloggen oder registrieren.

Einloggen mit Benutzername, Passwort und Sitzungslänge
News:
 
   Übersicht   Hilfe Suche Einloggen Registrieren  
Seiten: [1]
  Drucken  
Autor Thema: [Perl] MD5 Cracker by fred  (Gelesen 111 mal)
0 Mitglieder und 1 Gast betrachten dieses Thema.
fred777
Sr. Member
****
Beiträge: 265


390271540
Profil anzeigen WWW E-Mail
« am: Juli 15, 2009, 12:34:33 »

Naja, ist gestern entstanden, er knackt MD5 Hashs per Bruteforce oder Wordlist..
Was noch hinzukommen wird ist:
+ Listenimportierung
+ Suche in Online-Datenbanken

Funktioniert auch wunderbar bis jetzt Smiley

Code:
[hide]
Code:

#!usr/bin/perl

#Use moduls and variables                                                                                        
use Digest::MD5 qw(md5_hex);                            
my ($word,@words,$line,$res,$leng,$charset,$hash,$mincount,$maxcount,$ret,$cnt,$choise,$lim,$i,@Raws);

#It looks cool :>
system("cls");
print q {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~           MD5 Hash Cracker            
~                                      
~ + cracking with wordlists            
~ + cracking with bruteforce            
~
~ + use charset aAdx for bruting                                      
~ + coded by fred777 and thx to iman
~        
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
};
#Select your first choise, the method
print "Use wordlists or bruteforce [W or B]: ";
chomp($res =<STDIN>);

##########################################################
# The wordlist modul
##########################################################
if ($res eq &quot;W&quot; | $res eq &quot;w&quot;)
{
print &quot;\n\nPlease insert MD5 Hash: &quot;;
chomp($hash = <STDIN>);
$leng = length($hash);
if($leng!=32)
{
print &quot;\nIts not a valid md5 hash..\n\n&quot;;
exit;
system(&quot;Pause&quot;);
}


print &quot;Please insert path: &quot;;
chomp(my $path = <STDIN>);


# search hash in a foreach loop
open(WORD, &quot;$path&quot;) || die &quot;\nError, its a bad path\n&quot;;
foreach(<WORD>)
{
chomp;
$line = md5_hex($_);
if($line =~ $hash)
{
print &quot;\n\nCracked word: $_ \n\n&quot;;
}


}
}
##########################################################
# The bruteforce modul
##########################################################
if ($res eq &quot;B&quot; | $res eq &quot;b&quot;)
{

print &quot;\nPlease insert hash: &quot;;
chomp($hash=<STDIN>);
if (length($hash) != 32)
{
print &quot;\nIts not a valid md5 hash..\n\n&quot;;
exit;
system(&quot;Pause&quot;);
}
# Choose counts and charsets
print &quot;Charset eingeben: &quot;;
chomp($charset=<STDIN>);
print &quot;mincount: &quot;;
chomp($mincount=<STDIN>);
print &quot;maxcount: &quot;;
chomp($maxcount=<STDIN>);

if ($charset=~&quot;a&quot;) {
$choise = &quot;abcdefghijklmnopqrstuvwxyz&quot;;}
if ($charset=~&quot;A&quot;) {
$choise = $choise. &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;}
if ($charset=~&quot;d&quot;) {
$choise = $choise.&quot;1234567890&quot;;}
if ($charset=~&quot;x&quot;) {
$choise = $choise. &quot;!§\&quot;\$%&/()=?`*+~'#-_|<>°^´\}][{ .:,;&quot;;}


for (my $tim=$mincount;$tim<=$maxcount;$tim++){
crack ($tim);
}

# The cracking CORE
sub crack{
$lim = shift;
@Raws = ();
for ($i =0;$i<$lim;$i++){ $Raws[i] = 0;}
do{
for ($i =0;$i<$lim;$i++)
{
if ($Raws[$i] > length($choise)-1)
{
if ($i==$lim-1)
{
print &quot;\nNo Results, please change your settings..\n&quot;;
$cnt=0;
return false;
}
$Raws[$i+1]++;
$Raws[$i]=0;
}
}

$ret = &quot;&quot;;
for (my $i =0;$i<$lim;$i++){ $ret = $ret . substr($choise,$Raws[$i],1);}
$word = md5_hex($ret);
$cnt++;
            print &quot; -$word $ret\n&quot;;
if ($hash eq $word)
{
die &quot;\ncracked word: $ret\n&quot;;
}


$Raws[0]++;
}
while($Raws[$lim-1]<length($choise));
}

}
print &quot;\n\n&quot;;
system(&quot;Pause&quot;);

[/hide]
Gespeichert

"\x68\x6e\x2r\x73\x68" // push dword 68732f6eh
"\x68\x2f\x2f\x62\x69" // push dword 69622f7fh
Seiten: [1]
  Drucken  
 
Gehe zu:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines | New Look by Nolt Prüfe XHTML 1.0 Prüfe CSS