khalilasharen

hash-spit

May 10th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.67 KB | None | 0 0
  1. #!/usr/bin/python
  2. # hash-spit.py v1.1
  3. # , .
  4. # _.._ -+-* * _. __ _.;_/ _ ._ _
  5. # (_][ ) | | |(_]_) (_]| \(_)[ | )
  6. # ._|
  7. # . . _, . . . _, .
  8. # _| _.._.;_/ _.|.| _| _ _| _ ._ ._. _ _| _. _.|.| _| _
  9. # (_](_][ | \(_.|_| (_](/, and (_](/,[_)[ (/,(_](_](_.|_| (_](/,
  10. # |
  11. # hash bruteforcer (use string generator & dict list)
  12. # (md5, sha1, sha224, sha256, sha384, sha512)
  13. #
  14. # [Crochemore-Perrin algorithm]
  15. # bidirection generate string ex:
  16. # [0,1,2,3,4,5,6,7,8,9]
  17. # ---------> <---------
  18. # start end start
  19. #
  20. # i use this technique to increase the probability and effectiveness
  21. # discover string searching.
  22. #
  23. # Author: 5ynL0rd <http://5ynl0rd.depredac0de.net>
  24. # thanks to community: antijasakom.org, darkc0de.com & depredac0de.net
  25. # thanks to person: d3hydr8, gat3w4y, shamus, cyberchrome, renzo,
  26. # pyfla, si_pemula, g4pt3k, acayz, tr4c3r, dbuqr,
  27. # boys_rvn1609.
  28. # 03 March 2010
  29. #------------------------------------------------------------------------
  30.  
  31. import string, os, time, sys, hashlib
  32. from itertools import product
  33.  
  34. def banner():
  35. if os.name == "posix":
  36. os.system("clear")
  37. else:
  38. os.system("cls")
  39. header = '''
  40. ___________
  41. |.---------.|
  42. || ||
  43. ||HASH-SPIT|| hash-spit.py v1.0a
  44. || || ``````````````````
  45. |'---------'| hash bruteforcer using string generator
  46. `)__ ____(' (md5,sha1,sha224,sha256,sha384,sha512)
  47. [=== -- o ]--.
  48. __'---------'__ \ http://5ynl0rd.depredac0de.net
  49. [::::::::::: :::] )
  50. `""'"""""'""""`/T\\
  51. \\_/ Author: 5ynL0rd
  52. +-------------------------------------------------------------+\n'''
  53. for i in header:
  54. print "\b%s"%i,
  55. sys.stdout.flush()
  56. time.sleep(0.005)
  57.  
  58. def synL0rd_perm(s,n):
  59. x = (s,)*n
  60. return product(*x)
  61.  
  62. def format():
  63. print '''[+] Select generator:
  64. 0) a-z (abcdefghijklmnopqrstuvwxyz)
  65. 1) 0-9 (0123456789)
  66. 2) A-Z (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
  67. 3) !-~ (!"#$%&\\\'()*+,-./:;<=>?@[\\\\]^_`{|}~)
  68. 4) a-z and 0-9
  69. 5) a-z and A-Z
  70. 6) a-z and !-~
  71. 7) a-z and A-Z and 0-9
  72. 8) a-z and A-Z and !-~
  73. 9) all'''
  74.  
  75. if "__main__" == __name__:
  76. banner()
  77. found = False
  78. lengthmin2 = 0
  79. format()
  80. try:
  81. gen = input(" choose number options [1,2,..10]: ")
  82. except:
  83. print "[-] Error input!"
  84. sys.exit(1)
  85. else:
  86. if gen > 9 or gen < 0:
  87. print "[-] Error input!"
  88. sys.exit(1)
  89. lengthmin1 = input("[+] length min: ")
  90. lengthmin2 = lengthmin1
  91. lengthmax = input("[+] length max: ")
  92. if lengthmin1 > lengthmax:
  93. print "[-] Error input!"
  94. sys.exit(1)
  95. cipher = raw_input("[+] insert hash: ")
  96. if len(cipher) == 32:
  97. hashtype = "MD5 HASH"
  98. if len(cipher) == 40:
  99. hashtype = "SHA1 HASH"
  100. if len(cipher) == 56:
  101. hashtype = "SHA224 HASH"
  102. if len(cipher) == 64:
  103. hashtype = "SHA256 HASH"
  104. if len(cipher) == 96:
  105. hashtype = "SHA384 HASH"
  106. if len(cipher) == 128:
  107. hashtype = "SHA512 HASH"
  108. num0 = list(string.ascii_lowercase)
  109. num1 = list(string.digits)
  110. num2 = list(string.ascii_uppercase)
  111. num3 = list(string.punctuation)
  112. num4 = num0+num1
  113. num5 = num0+num2
  114. num6 = num0+num3
  115. num7 = num0+num2+num1
  116. num8 = num0+num2+num3
  117. full = num0+num2+num1+num3
  118. listnum = [num0,num1,num2,num3,num4,num5,num6,num7,num8,full]
  119. print "[o] CRACKING %s! Please wait...\n"%hashtype
  120. while lengthmin1 <= lengthmax or lengthmin2 <= lengthmax:
  121. ch3cksum = synL0rd_perm(listnum[gen],lengthmin2)
  122. center2 = (listnum[gen])[len(listnum[gen])/2]*lengthmin2
  123. listnum[gen].reverse()
  124. gat3w4y = synL0rd_perm(listnum[gen],lengthmin1)
  125. center1 = (listnum[gen])[len(listnum[gen])/2]*lengthmin1
  126. print "\r",
  127. while found == False:
  128. resgen1 = string.join(gat3w4y.next(),"")
  129. resgen2 = string.join(ch3cksum.next(),"")
  130. if len(cipher) == 32:
  131. spit1 = hashlib.md5(resgen1).hexdigest()
  132. spit2 = hashlib.md5(resgen2).hexdigest()
  133. if len(cipher) == 40:
  134. spit1 = hashlib.sha1(resgen1).hexdigest()
  135. spit2 = hashlib.sha1(resgen2).hexdigest()
  136. if len(cipher) == 56:
  137. spit1 = hashlib.sha224(resgen1).hexdigest()
  138. spit2 = hashlib.sha224(resgen2).hexdigest()
  139. if len(cipher) == 64:
  140. spit1 = hashlib.sha256(resgen1).hexdigest()
  141. spit2 = hashlib.sha256(resgen2).hexdigest()
  142. if len(cipher) == 96:
  143. spit1 = hashlib.sha384(resgen1).hexdigest()
  144. spit2 = hashlib.sha384(resgen2).hexdigest()
  145. if len(cipher) == 128:
  146. spit1 = hashlib.sha512(resgen1).hexdigest()
  147. spit2 = hashlib.sha512(resgen2).hexdigest()
  148. print "\r %s | %s"%(resgen1,resgen2),
  149. sys.stdout.flush
  150. if cipher == spit1:
  151. print "\n\n[+] PASSWORD CRACKED! = %s\n"%resgen1
  152. found = True
  153. sys.exit(0)
  154. if cipher == spit2:
  155. print "\n\n[+] PASSWORD CRACKED! = %s\n"%resgen2
  156. found = True
  157. sys.exit(0)
  158. if center1 == resgen1 and center2 == resgen2:
  159. lengthmin2 += 1
  160. lengthmin1 += 1
  161. print "\n\n[-] PASSWORD NOT FOUND... Try again later\n"
Advertisement
Add Comment
Please, Sign In to add comment