EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


sha1crack.pl

By: toast  -  Date Submitted: 2009-05-17 04:54:27

  1. #!/usr/bin/perl
  2. #=======================================================================#
  3. # This is a modified version of md5crack.pl availble from #
  4. # ttp://www.securiteam.com/tools/5OP0F0UKKG.html deigned to crack #
  5. # SHA1 hashes #
  6. # SHA1 Hash Bruteforce #
  7. # By: toast #
  8. # This is like I mentioned a modified version of MD5 Hash #
  9. # Bruteforce Kit availible from #
  10. # http://www.securiteam.com/tools/5OP0F0UKKG.html #
  11. # I did type it up myself but I used MD5 Hash Bruteforce Kit as a #
  12. # model and template. #
  13. # Written under Slackware linux tested and working #
  14. # ======================================================================#
  15. $tmr = '1';
  16.  
  17. if ($tmr<=0){ die "Set tmr to a value >=1 !\n";};
  18. use Digest::SHA1 qw(sha1_hex);
  19. use Time::HiRes qw(gettimeofday);
  20.  
  21. if ($ARGV[0]=~"A") {
  22. $alph = "QWERTYUIOPASDFGHJKLZXCVBNM";}
  23. if ($ARGV[0]=~"a") {
  24. $alph = $alph. "qwertyuiopasdfghjklzxcvbnm";}
  25. if ($ARGV[0]=~"s") {
  26. $alph = $alph. "1234567890";}
  27. if ($ARGV[0]=~"d") {
  28. $alph = $alph. "`~!@#\$%^&*()-_=+[]\\{}|;:,.<>/?\ ";}
  29.  
  30. if ($alph eq "" or $ARGV[3] eq "") {usage();};
  31. if (length($ARGV[3]) != 40) { die "That is not a valid SHA1 hash\n";};
  32.  
  33. print "Select charset for attack: '$alph\'\n";
  34. print "Going to crack '$ARGV[3]'\n";
  35.  
  36. for (my $t=$ARGV[1];$t<=$ARGV[2];$t++){crack($t);}
  37.  
  38. sub usage{
  39. print "\nSHA1 Hash Bruteforce Kit\n";
  40. print "Usage\n";
  41. print "perl sha1crack.pl <charset> <mincount> <maxcount> <SHA1 to crack>\n";
  42. print " Charset can be: [Aasd]\n";
  43. print " A = {'A','b','c',...}\n";
  44. print " a = {'a','b','c',..}\n";
  45. print " s = {'0','1','2','3',...}\n";
  46. print " d = {'`','~','!','@','#',...}\n";
  47. print "Example for cracking SHA1 hash\n";
  48. print "perl sha1crack.pl Aa 1 5 4e7afebcfbae000b22c7c85e5560f89a2a0280b4\n";
  49. print " This will try to crack the hash useing only with capitol alphas and lowercase alphas\n";
  50. print " and only those between one and five characters long.\n";
  51. print " perl sha1crack.pl Aasd 1 7 f18200a905e60dcc22c37cb39b29844ee5320550\n";
  52. print " This will try to crack the hash useing all the characters\n";
  53. print " but will only try cracking passwords between one and seven characters long\n";
  54. die "exiting\n";
  55. }
  56. sub crack{
  57. $charset = shift;
  58. @rawstring = ();
  59. for (my $i =0;$i<$charset;$i++){ $rawstring[i] = 0;}
  60. $start = gettimeofday();
  61. do{
  62. for (my $i =0;$i<$charset;$i++){
  63. if ($rawstring[$i] > length($alph)-1){
  64. if ($i==$charset-1){
  65. print "Bruteforcing done with $charset chars. No results.\n";
  66. $cnt=0;
  67. return 0;
  68. }
  69. $rawstring[$i+1]++;
  70. $rawstring[$i]=0;
  71. }
  72. }
  73. #========================================================================#
  74. $ret = "";
  75. for (my $i =0;$i<$charset;$i++){ $ret = $ret . substr($alph,$rawstring[$i],1);}
  76. $hash = sha1_hex($ret);
  77. $cnt++;
  78. $stop = gettimeofday();
  79. if ($stop-$start>$tmr){
  80. $cnt = int($cnt/$tmr);
  81. print "$cnt hashes\\second.\tLast pass '$ret\'\n";
  82. $cnt=0;
  83. $start = gettimeofday();
  84. }
  85. print "$ARGV[3] != $hash ($ret)\n";
  86. if ($ARGV[3] eq $hash){
  87. die "\n Password is -> $ret\n";
  88. }
  89. #========================================================================#
  90. $rawstring[0]++;
  91. }
  92. while($rawstring[$charset-1]<length($alph));
  93. }
  94.  
  95. sub checkhash{
  96. $charset = shift;
  97. $ret = "";
  98. for (my $i =0;$i<$charset;$i++){ $ret = $ret . substr($alph,$rawstring[$i],1);}
  99. $hash = sha1_hex($ret);
  100. $cnt++;
  101. $stop = gettimeofday();
  102. if ($stop-$start>$tmr){
  103. $cnt = int($cnt/$tmr);
  104. print "$cnt hashes\\second.\tLast pass '$ret\'\n";
  105. $cnt=0;
  106. $start = gettimeofday();
  107. }
  108. if ($ARGV[3] eq $hash){
  109. die "\nPassward is -> $ret\n";
  110. }
  111. }
Return to perl category list

Who Visited EnigmaGroup Today?

1510 Guests, 297 Users (189 Spiders)
drag0n, alexelixir, spartanvedicrishi, r0z4, Abhinav2107, theanonymous21, greatg, mongrel88, CreedoFiegree, bivaEmilltite, posthuman01, Taireegaddita, Taicadine, c_a13, hizImmoli, scifics, slchill, KELATALFTUS, kynapse, Tonyui, Hackpad, Epilioptiop, VireekadiaFap, Mamorite, IodindDog, brunoriversyhn, Effomeidonize, ReottphoffBom, arktek, burgeoningneophyte, TradaGreant, SlayingDragons, Waldlyeps, Arsenal, CJ_Omaha, Ryuske, thethird3y3, todayadvila, pwnpwnlolz, NeetaexomYgom, ookami-namikaze, dot_Cipher, Unotohumsmush, SaubymorRoyab, loltyg, Ausome1, Rik, hrangel, cyber-guard, Meonkzt, mori, 31415926, optioniLele, intorerse, FlifobbyFloks, Ios, saraf, Røgue, cossyDrybrich, IvanDimitriev, havisham, KIKNWING, fitz, fleeloCycle, hackboy302, strudels, CootoDorbeeft, gymnediny, hustleman9tv, comando300, Ysri13, thatoneguy, Paran0id, whoami, Pitanteerve, Reapon, cls777, myfabregas, Afrika, suetekh, somebody777, floontiny, Frudopvia, jasonbourne, zombiehack640, CloverCipher, spoosh, Fraubbova, rulebreaker, dncjor, obencefoozy, Fintyoptots, viRuleNt, NipPaineHainy, TheHarrisonW, Jamesgo, TheGanjator, psychomarine, 1421carter, tingle65, claudius, Feld Grau, Partisan, Gunslinger, gydeqqzpn, yshiau, Zaccarato, chromoSone, priovasashCor, ellisp, GothicLogic, keetone, M0rdak, UsedDeteKef, nhorton, archestraty, HatriteBeft, JC06dc5, alpha1, spg, dark_void, wakazi, mtroscheck, TheCheeseDemon, ach.n30, sahariar, hervelegeraf, Psiber_Syn, hackaday, Mod777, neompenly, pollolololo, SnoopSky, Cigmimifs, DrOptix, ProloG-Shaman, unicornrainbow, cheapnikeshoxog, bobsters, foofthoorgo, polemarchos, avacraft, spencerwilliams23, lotato, ryanjcrook, dollerolf, robintenboden, rospark, WexEmbet, BeefSupreme, Hessesian, whydoyoulook, cdpirate, DnA-Ender, CaNcEr, zheincnoob, Vengeance987, justforfun363, RawTeefecycle, Squissesk, aVoid, SaMTHG, neodude, Marion1p, Ops, ddxc, BlAd373, Klosse, khamhou, samsatHD80, PauffPubadvic, AnnaNoult, SexyCreerve, newb1, robster1977, Blizer, Dudleypagrove, Mr_KaLiMaN, FirewallPenetrator, GMo, Seasharp, mrchicken1, Zaxem, N4g4c3N, MaxMeier, Ian, sander.ashwin, Predatorc, lonely.connection, ElEnfermado, wavyd, dirkdanblue, cve916, kalak55, a1los, jell0, Exclaw, veceattainc, Muselele, Mr Pacifist, stylish007, zach, litbk, closednetwork99, soroimmuror, memoryshot, PlaneReaction, Wamemanytex38, DieAble, d0seN_36b, jeremy.whitson, lol, nefeolnb, Noticon, statix, anandoump, RomeoG, advilapyday, snorapa, Gkjt, autotuneuser, beanulpinee, 2142, kiklopas, door51, Pizza, deepakkumar, makler2004, M4rcy, Xargos, bdkoenig, Blavatsky, m4f10, Huasca, itsme, xu_lain, Nikhil, ChewBigRed, samxoxo, incicaMaidits, toudioria, Chidokage, Jigoku, cesecyclelm, schn1ffl3r, sam20000, learning, kentora, San Marino, Nightraven, zanydouner, FrofErrodslot, FatalEror, wheaties, akki, AlexDiru, unclejos666, override101, blink_212, uncowstientee, lilkpoigogs, Innonaenupt607, Killshot, ZheIncKnight, ActictGlync, acarseflalk, ___, trashsporn, Memartent, Zoorsornaks, z3z3, heyhey123, Ghajnm, usaliaPels, Ordeptpen, pelly, quellense, Szuba, nmobin27, lamb, x1rt4m, ToutousaRulty, vipervince2002, mannavard1611, BinaryShinigami, Duchdund, afgnumgt, Anatissa, darkfire1515, bennyblanco5000, Mmmett50, ToryLogsEsoff, impalwinona, Kelsfednege, ensubbrut, ant0601, Alpha0mega
 
Enigma Group