EG Information
Training Missions
Knowledge Bank
|
|
Enigma Group's Code Bank
sha1crack.plBy: toast - Date Submitted: 2009-05-17 04:54:27 #!/usr/bin/perl #=======================================================================# # This is a modified version of md5crack.pl availble from # # ttp://www.securiteam.com/tools/5OP0F0UKKG.html deigned to crack # # SHA1 hashes # # SHA1 Hash Bruteforce # # By: toast # # This is like I mentioned a modified version of MD5 Hash # # Bruteforce Kit availible from # # http://www.securiteam.com/tools/5OP0F0UKKG.html # # I did type it up myself but I used MD5 Hash Bruteforce Kit as a # # model and template. # # Written under Slackware linux tested and working # # ======================================================================# $tmr = '1'; if ($tmr<=0){ die "Set tmr to a value >=1 !n";}; use Digest ::SHA1 qw(sha1_hex ); use Time ::HiRes qw(gettimeofday ); if ($ARGV[0]=~"A") { $alph = "QWERTYUIOPASDFGHJKLZXCVBNM";} if ($ARGV[0]=~"a") { $alph = $alph. "qwertyuiopasdfghjklzxcvbnm";} if ($ARGV[0]=~"s") { $alph = $alph. "1234567890";} if ($ARGV[0]=~"d") { $alph = $alph. "`~!@#$%^&*()-_=+[]\{}|;:,.<>/? ";} if ($alph eq "" or $ARGV[3] eq "") {usage();}; if (length($ARGV[3]) != 40) { die "That is not a valid SHA1 hashn";}; print "Select charset for attack: '$alph'n"; print "Going to crack '$ARGV[3]'n"; for (my $t=$ARGV[1];$t<=$ARGV[2];$t++){crack($t);} sub usage{ print "nSHA1 Hash Bruteforce Kitn"; print "perl sha1crack.pl <charset> <mincount> <maxcount> <SHA1 to crack>n"; print " Charset can be: [Aasd]n"; print " A = {'A','b','c',...}n"; print " a = {'a','b','c',..}n"; print " s = {'0','1','2','3',...}n"; print " d = {'`','~','!','@','#',...}n"; print "Example for cracking SHA1 hashn"; print "perl sha1crack.pl Aa 1 5 4e7afebcfbae000b22c7c85e5560f89a2a0280b4n"; print " This will try to crack the hash useing only with capitol alphas and lowercase alphasn"; print " and only those between one and five characters long.n"; print " perl sha1crack.pl Aasd 1 7 f18200a905e60dcc22c37cb39b29844ee5320550n"; print " This will try to crack the hash useing all the charactersn"; print " but will only try cracking passwords between one and seven characters longn"; } sub crack{ @rawstring = (); for (my $i =0;$i<$charset;$i++){ $rawstring[i] = 0;} $start = gettimeofday(); do{ for (my $i =0;$i<$charset;$i++){ if ($rawstring[$i] > length($alph)-1){ if ($i==$charset-1){ print "Bruteforcing done with $charset chars. No results.n"; $cnt=0; } $rawstring[$i+1]++; $rawstring[$i]=0; } } #========================================================================# $ret = ""; for (my $i =0;$i<$charset;$i++){ $ret = $ret . substr($alph,$rawstring[$i],1);} $hash = sha1_hex($ret); $cnt++; $stop = gettimeofday(); if ($stop-$start>$tmr){ print "$cnt hashes\second.tLast pass '$ret'n"; $cnt=0; $start = gettimeofday(); } print "$ARGV[3] != $hash ($ret)n"; if ($ARGV[3] eq $hash){ die "n Password is -> $retn"; } #========================================================================# $rawstring[0]++; } while($rawstring[$charset-1]<length($alph)); } sub checkhash{ $ret = ""; for (my $i =0;$i<$charset;$i++){ $ret = $ret . substr($alph,$rawstring[$i],1);} $hash = sha1_hex($ret); $cnt++; $stop = gettimeofday(); if ($stop-$start>$tmr){ print "$cnt hashes\second.tLast pass '$ret'n"; $cnt=0; $start = gettimeofday(); } if ($ARGV[3] eq $hash){ die "nPassward is -> $retn"; } }
|
| Return to
perl category list |
|
|
Who's Online
479 Guests, 101 Users asapong, CollapsingWalls, Diznablo, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, rabbidmind, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, Nasrudin, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Ios, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo, sharpie392, Y34RZ3R0 |
| |
|
|
|
|
|