Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from hashlib import *
- from itertools import product
- import sys
- def from_words(w):
- ret = []
- ret.append(''.join(x.upper() for x in w))
- if len(w) == 2:
- ret.append(w[0].title() + w[1])
- ret.append(w[0].title() + w[1].title())
- ret.append(w[0] + w[1].title())
- ret.append(w[0] + w[1])
- return ret
- if len(w) == 3:
- ret.append(w[0] + w[1] + w[2])
- ret.append(w[0] + w[1] + w[2].title())
- ret.append(w[0] + w[1].title() + w[2])
- ret.append(w[0] + w[1].title() + w[2].title())
- ret.append(w[0].title() + w[1] + w[2])
- ret.append(w[0].title() + w[1] + w[2].title())
- ret.append(w[0].title() + w[1].title() + w[2])
- ret.append(w[0].title() + w[1].title() + w[2].title())
- return ret
- if len(w) == 4:
- ret.append(w[0] + w[1] + w[2] + w[3])
- ret.append(w[0] + w[1] + w[2] + w[3].title())
- ret.append(w[0] + w[1] + w[2].title() + w[3])
- ret.append(w[0] + w[1] + w[2].title() + w[3].title())
- ret.append(w[0] + w[1].title() + w[2] + w[3])
- ret.append(w[0] + w[1].title() + w[2] + w[3].title())
- ret.append(w[0] + w[1].title() + w[2].title() + w[3])
- ret.append(w[0] + w[1].title() + w[2].title() + w[3].title())
- ret.append(w[0].title() + w[1] + w[2] + w[3])
- ret.append(w[0].title() + w[1] + w[2] + w[3].title())
- ret.append(w[0].title() + w[1] + w[2].title() + w[3])
- ret.append(w[0].title() + w[1] + w[2].title() + w[3].title())
- ret.append(w[0].title() + w[1].title() + w[2] + w[3])
- ret.append(w[0].title() + w[1].title() + w[2] + w[3].title())
- ret.append(w[0].title() + w[1].title() + w[2].title() + w[3])
- ret.append(w[0].title() + w[1].title() + w[2].title() + w[3].title())
- return ret
- print("massimo 4 parole")
- return
- hashes = [["gIZnu8AXeCa9IH","61e2870f803df3706d16af40154831f99cf77dfddea08a553a2ce48bb9e7d482"],
- ["xhhNgqEIdbVoXJd","019350074919e8b16136249e33c60a3bce643c85a7618e56ca83be7986e47a10"],
- ["S6hQzOLI2vWtgm5","e7e08d3198433df47d07245edfade7eb5f7921b67edc31ee868ea8fd634b5c15"],
- ["K3aRH1AkSvBNGfw","4a0f3fb95c8d855b630cb43dbb5d5bf893d579adb6c54c15a8adfac8dc5a3032"],
- ["doP0D4pXhSIp3Lw","9fbaa10591217928dfc67e982dc130eefa49bd86611ebb1e912400fab8b96995"]]
- keywords =["peter","brown","london","lucy","ben","steven","amy","garfield","tom","tallaght","dublin","ireland",
- "greenwich","stonehenge","davos","arosa","hamlet","william","shakespeare","goethe","faust","downing","notre","cat",
- "architecture","landscape","swiss","alps","sun","king","design","urban","university","old","royal","naval","college",
- "amesbury","richmond","park","hastings","circular","bryant","smith","hut","andre","louis","france","andrew","jackson",
- "designer","american","fishing","bream","tench","rudd","carp","hiking","read"]
- for i in range(100):
- keywords.append(str(i))
- keywords = sorted(keywords, key = len)
- index = 1
- tot = len(keywords)**2
- testedHashes = 0
- print("[*] Testing 2 words")
- print("\n")
- for a in range(len(keywords)):
- for b in range(len(keywords)):
- if (a < 99 and b < 99) or (a > 99 and b > 99):
- index += 1
- continue
- s1 = keywords[a]
- s2 = keywords[b]
- if (len(s1) + len(s2)) > 18:
- index += 1
- continue
- l = from_words([s1,s2])
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- index += 1
- for j in l:
- for salt in hashes:
- if sha256(salt[0] + j).hexdigest() == salt[1]:
- for w in range(10):
- open("out.txt","w").write(j)
- print(j,sha256(j).hexdigest())
- exit()
- tot = len(keywords)**3
- index = 0
- print("[*] Testing 3 words")
- print("\n")
- for a in range(len(keywords)):
- for b in range(len(keywords)):
- for c in range(len(keywords)):
- 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):
- index += 1
- continue
- s1 = keywords[a]
- s2 = keywords[b]
- s3 = keywords[c]
- if (len(s1) + len(s2) + len(s3)) > 18:
- index += 1
- continue
- l = from_words([s1,s2,s3])
- index += 1
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- for j in l:
- for salt in hashes:
- if sha256(salt[0] + j).hexdigest() == salt[1]:
- for w in range(10):
- open("out.txt","w").write(j)
- print(j,sha256(j).hexdigest())
- exit()
- tot = len(keywords)**4
- index = 0
- print("[*] Testing 4 words")
- print("\n")
- for a in range(len(keywords)):
- for b in range(len(keywords)):
- for c in range(len(keywords)):
- for d in range(len(keywords)):
- 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):
- index += 1
- continue
- s1 = keywords[a]
- s2 = keywords[b]
- s3 = keywords[c]
- s4 = keywords[d]
- if (len(s1) + len(s2) + len(s3) + len(s4)) > 18:
- index += 1
- continue
- l = from_words([s1,s2,s3,s4])
- index += 1
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- for j in l:
- for salt in hashes:
- if sha256(salt[0] + j).hexdigest() == salt[1]:
- for w in range(10):
- open("out.txt","w").write(j)
- print(j,sha256(j).hexdigest())
- exit()
- '''
- print("[*] Testing 2 words")
- print("\n")
- for s1 in keywords:
- for s2 in keywords:
- if (len(s1) + len(s2)) > 18:
- index += 1
- continue
- l = from_words([s1,s2])
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- index += 1
- for j in l:
- for i in range(100):
- psw = j + str(i)
- if sha256(psw).hexdigest() in hashes:
- for w in range(10):
- open("out.txt","w").write(psw)
- print(psw,sha256(psw).hexdigest())
- exit()
- tot = range(len(keywords))**3
- index = 0
- print("[*] Testing 3 words")
- print("\n")
- for s1 in keywords:
- for s2 in keywords:
- for s3 in keywords:
- if (len(s1) + len(s2) + len(s3)) > 18:
- index += 1
- continue
- l = from_words([s1,s2,s3])
- index += 1
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- for j in l:
- for i in range(100):
- psw = j + str(i)
- if sha256(psw).hexdigest() in hashes:
- for wx in range(10):
- open("out.txt","w").write(psw)
- print(psw,sha256(psw).hexdigest())
- exit()
- tot = range(len(keywords))**4
- index = 0
- print("[*] Testing 4 words")
- print("\n")
- for s1 in keywords:
- for s2 in keywords:
- for s3 in keywords:
- for s4 in keywords:
- if (len(s1) + len(s2) + len(s3) + len(s4)) > 18:
- index += 1
- continue
- l = from_words([s1,s2,s3,s4])
- index += 1
- testedHashes += len(l) * 100
- sys.stdout.write("\033[F")
- print("--> %d [%d/%d %lf%%] %d hashes have been tested" % (len(l),index,tot,(float(float(index)/tot)) * 100,testedHashes))
- for j in l:
- for i in range(100):
- psw = j + str(i)
- if sha256(psw).hexdigest() in hashes:
- for wx in range(10):
- open("out.txt","w").write(psw)
- print(psw,sha256(psw).hexdigest())
- exit()
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement