from tkinter import * import hashlib import math from datetime import datetime import logging import threading import time from timeit import default_timer as timer def crack(): ######## DISABLE BUTTON b1.config(state="disabled") # SET CRACKING t3.delete(0, END) t3.insert(END, "CRACKING MD5...") # CLEAR OLD RESULT t2.delete(0, END) #GET MD5 VALUE mdhash = t1.get().strip() #START CODE numstart = 0 numend = 1000000000000 #2147483647 #DEFINE LEX lex = [" ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"] # GET LEX SIZE numbase = len(lex) # INIT VARS res = 0 powres = 0 mant = 0 num = 0 num2 = 0 found = False #TIME SPAN STUFF start = timer() # MAIN LOOP num2 = numstart while num2 < numend: num2 = num2 + 1 num = num2 mant = math.floor(math.log(num,numbase)) strres = "" while mant >= 0: powres = pow(numbase, mant) res = math.floor(num / powres) strres = strres + lex[res] num = num - math.floor(res * powres) mant = mant - 1 #GENERATE MD5 FROM TRY md1 = hashlib.md5(strres.encode()) md2 = md1.hexdigest() #CHECK TO SEE IF TRY IS SAME AS INPUT if md2 == mdhash: #PRINT FOOTER, FOUND #TIME SPAN STUFF end = timer() time_dif = round((end - start) / 60,2) t3.delete(0, END) t3.insert(END, "RESULT FOUND, IN " + str(time_dif) + " MINUTES") t2.delete(0, END) t2.insert(END, strres) found = True if found == True: break #PRINT FOOTER, NOT FOUND if found == False: t3.delete(0, END) t3.insert(END, "RESULT NOT FOUND!") t2.delete(0, END) t2.insert(END, strres) ######## ENABLE BUTTON b1.config(state="normal") def runCrack(): thread1 = threading.Thread(target=crack) thread1.start() win = Tk() win.title("MD5 CRACKER - ROSTISLAV PERSION") win.geometry("510x280") win.configure(background='black') win.resizable(0, 0) # CREATE LABELS lbl1=Label(win, text='MD5 HASH:',fg = "green",bg = "black",font=("Courier", 8)) lbl2=Label(win, text='CRACKED MD5:',fg = "green",bg = "black",font=("Courier", 8)) lbl3=Label(win, text='STATUS:',fg = "green",bg = "black",font=("Courier", 8)) # CREATE TEXT BOXES t1=Entry() t1.configure(background='black',foreground='white',font=("Courier", 8)) t1.insert(END,"033bd94b1168d7e4f0d644c3c95e35bf") t2=Entry() t2.configure(background='black',foreground='white',font=("Courier", 8)) t3=Entry() t3.configure(background='black',foreground='white',font=("Courier", 8)) # PLACE FIRST lbl1.place(x=50, y=50) t1.place(x=150, y=50, width=300) # PLACE SECOND lbl2.place(x=50, y=100) t2.place(x=150, y=100, width=300) # PLACE THIRD lbl3.place(x=50, y=150) t3.place(x=150, y=150, width=300) # BUTTON STUFF b1=Button(win, text='CRACK MD5 HASH', command=runCrack) b1.configure(background='black',foreground='green',font=("Courier", 8)) b1.place(x=50, y=200) # SET READY STATUS t3.delete(0, END) t3.insert(END, "READY...") win.mainloop()