Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.06 KB | None | 0 0
  1. from hashlib import *
  2. from itertools import product
  3. import sys
  4.  
  5.  
  6. def from_words(w):
  7. ret = []
  8. ret.append(''.join(x.upper() for x in w))
  9. if len(w) == 2:
  10. ret.append(w[0].title() + w[1])
  11. ret.append(w[0].title() + w[1].title())
  12. ret.append(w[0] + w[1].title())
  13. ret.append(w[0] + w[1])
  14. return ret
  15. if len(w) == 3:
  16. ret.append(w[0] + w[1] + w[2])
  17. ret.append(w[0] + w[1] + w[2].title())
  18. ret.append(w[0] + w[1].title() + w[2])
  19. ret.append(w[0] + w[1].title() + w[2].title())
  20. ret.append(w[0].title() + w[1] + w[2])
  21. ret.append(w[0].title() + w[1] + w[2].title())
  22. ret.append(w[0].title() + w[1].title() + w[2])
  23. ret.append(w[0].title() + w[1].title() + w[2].title())
  24. return ret
  25. if len(w) == 4:
  26. ret.append(w[0] + w[1] + w[2] + w[3])
  27. ret.append(w[0] + w[1] + w[2] + w[3].title())
  28. ret.append(w[0] + w[1] + w[2].title() + w[3])
  29. ret.append(w[0] + w[1] + w[2].title() + w[3].title())
  30. ret.append(w[0] + w[1].title() + w[2] + w[3])
  31. ret.append(w[0] + w[1].title() + w[2] + w[3].title())
  32. ret.append(w[0] + w[1].title() + w[2].title() + w[3])
  33. ret.append(w[0] + w[1].title() + w[2].title() + w[3].title())
  34. ret.append(w[0].title() + w[1] + w[2] + w[3])
  35. ret.append(w[0].title() + w[1] + w[2] + w[3].title())
  36. ret.append(w[0].title() + w[1] + w[2].title() + w[3])
  37. ret.append(w[0].title() + w[1] + w[2].title() + w[3].title())
  38. ret.append(w[0].title() + w[1].title() + w[2] + w[3])
  39. ret.append(w[0].title() + w[1].title() + w[2] + w[3].title())
  40. ret.append(w[0].title() + w[1].title() + w[2].title() + w[3])
  41. ret.append(w[0].title() + w[1].title() + w[2].title() + w[3].title())
  42. return ret
  43. print("massimo 4 parole")
  44. return
  45.  
  46.  
  47.  
  48.  
  49. hashes = [["gIZnu8AXeCa9IH","61e2870f803df3706d16af40154831f99cf77dfddea08a553a2ce48bb9e7d482"],
  50. ["xhhNgqEIdbVoXJd","019350074919e8b16136249e33c60a3bce643c85a7618e56ca83be7986e47a10"],
  51. ["S6hQzOLI2vWtgm5","e7e08d3198433df47d07245edfade7eb5f7921b67edc31ee868ea8fd634b5c15"],
  52. ["K3aRH1AkSvBNGfw","4a0f3fb95c8d855b630cb43dbb5d5bf893d579adb6c54c15a8adfac8dc5a3032"],
  53. ["doP0D4pXhSIp3Lw","9fbaa10591217928dfc67e982dc130eefa49bd86611ebb1e912400fab8b96995"]]
  54.  
  55. keywords =["peter","brown","london","lucy","ben","steven","amy","garfield","tom","tallaght","dublin","ireland",
  56. "greenwich","stonehenge","davos","arosa","hamlet","william","shakespeare","goethe","faust","downing","notre","cat",
  57. "architecture","landscape","swiss","alps","sun","king","design","urban","university","old","royal","naval","college",
  58. "amesbury","richmond","park","hastings","circular","bryant","smith","hut","andre","louis","france","andrew","jackson",
  59. "designer","american","fishing","bream","tench","rudd","carp","hiking","read"]
  60.  
  61. for i in range(100):
  62. keywords.append(str(i))
  63. keywords = sorted(keywords, key = len)
  64.  
  65. index = 1
  66. tot = len(keywords)**2
  67. testedHashes = 0
  68.  
  69.  
  70. print("[*] Testing 2 words")
  71. print("\n")
  72. for a in range(len(keywords)):
  73. for b in range(len(keywords)):
  74. if (a < 99 and b < 99) or (a > 99 and b > 99):
  75. index += 1
  76. continue
  77. s1 = keywords[a]
  78. s2 = keywords[b]
  79. if (len(s1) + len(s2)) > 18:
  80. index += 1
  81. continue
  82. l = from_words([s1,s2])
  83. testedHashes += len(l) * 100
  84. sys.stdout.write("\033[F")
  85. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  86. index += 1
  87. for j in l:
  88. for salt in hashes:
  89. if sha256(salt[0] + j).hexdigest() == salt[1]:
  90. for w in range(10):
  91. open("out.txt","w").write(j)
  92. print(j,sha256(j).hexdigest())
  93. exit()
  94.  
  95. tot = len(keywords)**3
  96. index = 0
  97. print("[*] Testing 3 words")
  98. print("\n")
  99. for a in range(len(keywords)):
  100. for b in range(len(keywords)):
  101. for c in range(len(keywords)):
  102. if (a < 99 and b < 99) or (a < 99 and c < 99) or (b < 99 and c < 99) or (a > 99 and b > 99 and c > 99):
  103. index += 1
  104. continue
  105. s1 = keywords[a]
  106. s2 = keywords[b]
  107. s3 = keywords[c]
  108. if (len(s1) + len(s2) + len(s3)) > 18:
  109. index += 1
  110. continue
  111. l = from_words([s1,s2,s3])
  112. index += 1
  113. testedHashes += len(l) * 100
  114. sys.stdout.write("\033[F")
  115. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  116. for j in l:
  117. for salt in hashes:
  118. if sha256(salt[0] + j).hexdigest() == salt[1]:
  119. for w in range(10):
  120. open("out.txt","w").write(j)
  121. print(j,sha256(j).hexdigest())
  122. exit()
  123.  
  124. tot = len(keywords)**4
  125. index = 0
  126. print("[*] Testing 4 words")
  127. print("\n")
  128. for a in range(len(keywords)):
  129. for b in range(len(keywords)):
  130. for c in range(len(keywords)):
  131. for d in range(len(keywords)):
  132. if (a < 99 and b < 99) or (a < 99 and c < 99) or (a < 99 and d < 99) or (b <99 and c < 99) or (b < 99 and d < 99) or (c < 99 and d < 99) or (a > 99 and b > 99 and c > 99 and d > 99):
  133. index += 1
  134. continue
  135. s1 = keywords[a]
  136. s2 = keywords[b]
  137. s3 = keywords[c]
  138. s4 = keywords[d]
  139. if (len(s1) + len(s2) + len(s3) + len(s4)) > 18:
  140. index += 1
  141. continue
  142. l = from_words([s1,s2,s3,s4])
  143. index += 1
  144. testedHashes += len(l) * 100
  145. sys.stdout.write("\033[F")
  146. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  147. for j in l:
  148. for salt in hashes:
  149. if sha256(salt[0] + j).hexdigest() == salt[1]:
  150. for w in range(10):
  151. open("out.txt","w").write(j)
  152. print(j,sha256(j).hexdigest())
  153. exit()
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. '''
  161. print("[*] Testing 2 words")
  162. print("\n")
  163. for s1 in keywords:
  164. for s2 in keywords:
  165. if (len(s1) + len(s2)) > 18:
  166. index += 1
  167. continue
  168. l = from_words([s1,s2])
  169. testedHashes += len(l) * 100
  170. sys.stdout.write("\033[F")
  171. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  172. index += 1
  173. for j in l:
  174. for i in range(100):
  175. psw = j + str(i)
  176. if sha256(psw).hexdigest() in hashes:
  177. for w in range(10):
  178. open("out.txt","w").write(psw)
  179. print(psw,sha256(psw).hexdigest())
  180. exit()
  181.  
  182. tot = range(len(keywords))**3
  183. index = 0
  184. print("[*] Testing 3 words")
  185. print("\n")
  186. for s1 in keywords:
  187. for s2 in keywords:
  188. for s3 in keywords:
  189. if (len(s1) + len(s2) + len(s3)) > 18:
  190. index += 1
  191. continue
  192. l = from_words([s1,s2,s3])
  193. index += 1
  194. testedHashes += len(l) * 100
  195. sys.stdout.write("\033[F")
  196. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  197. for j in l:
  198. for i in range(100):
  199. psw = j + str(i)
  200. if sha256(psw).hexdigest() in hashes:
  201. for wx in range(10):
  202. open("out.txt","w").write(psw)
  203. print(psw,sha256(psw).hexdigest())
  204. exit()
  205.  
  206. tot = range(len(keywords))**4
  207. index = 0
  208. print("[*] Testing 4 words")
  209. print("\n")
  210. for s1 in keywords:
  211. for s2 in keywords:
  212. for s3 in keywords:
  213. for s4 in keywords:
  214. if (len(s1) + len(s2) + len(s3) + len(s4)) > 18:
  215. index += 1
  216. continue
  217. l = from_words([s1,s2,s3,s4])
  218. index += 1
  219. testedHashes += len(l) * 100
  220. sys.stdout.write("\033[F")
  221. print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
  222. for j in l:
  223. for i in range(100):
  224. psw = j + str(i)
  225. if sha256(psw).hexdigest() in hashes:
  226. for wx in range(10):
  227. open("out.txt","w").write(psw)
  228. print(psw,sha256(psw).hexdigest())
  229. exit()
  230. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement