Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AKHACKER-program4hack committed Mar 30, 2021
1 parent 764d1fe commit b72a768
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Pull Requests](https://img.shields.io/github/issues-pr/AKHACKER-program4hack/elliot)

The faster and time saving md5 hash cracker
Save time by saving session
Save time by saving session.

<img src="elliotgithub.jpg">

Expand Down Expand Up @@ -34,7 +34,7 @@ optional arguments:
```
# Session saving

If You use sessions,the tools will save the session after every 5 minute.I hope this update make you more happy
Use ```-n``` for saving iterations while cracking md5 hash
example :
```
Expand Down
30 changes: 23 additions & 7 deletions elliot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse
import os
import sys

import time

lower = string.ascii_lowercase
upper = string.ascii_uppercase
Expand All @@ -17,6 +17,12 @@
defaultwordlist = "wordlist/rockyou.txt"


def timer(start, end):
hours, rem = divmod(end-start, 3600)
minutes, seconds = divmod(rem, 60)
return "{:0>2}:{:0>2}:{:05.2f}".format(int(hours), int(minutes), seconds)


def resumecrack(sessionfile):
if os.path.exists(sessionfile):
try:
Expand All @@ -35,7 +41,6 @@ def resumecrack(sessionfile):
min_lenght, max_lenght = data[2].split(" ")
current_i = data[3]


current = data[4][:1]
c = data[5].find(current)

Expand All @@ -56,22 +61,29 @@ def resumecrack(sessionfile):


def customcrack(chrs, min_lenght, max_length, hashtocrack, outputfile, sessionfile=None):
check = bool(re.match(r"([a-fA-F\d]{32}$)",hashtocrack))
check = bool(re.match(r"([a-fA-F\d]{32}$)", hashtocrack))
if check:
try:
starting_time = time.time()
for n in range(min_lenght, max_length + 1):
for x in itertools.product(chrs, repeat=n):
password = "".join(x)
# print(first_bits)
try:
print(
f"\rtrying password : {password}", end='\r', flush=True)
hash = hashlib.md5(password.encode("UTF-8")).hexdigest()
hash = hashlib.md5(
password.encode("UTF-8")).hexdigest()
if hash == hashtocrack:
print("\r\nPassword : " + str(password))
with open(outputfile, "w") as ou:
ou.write(password)
break
if sessionfile != None and "00:05:00" in timer(starting_time, time.time()):
with open(sessionfile, "w") as file:
file.write(
f"incremental\n{hashtocrack}\n{min_lenght} {max_length}\n{n}\n{password}\n{characters}\n{outputfile}")
starting_time = time.time()
except Exception as error:
print(error)
sys.exit()
Expand All @@ -80,14 +92,13 @@ def customcrack(chrs, min_lenght, max_length, hashtocrack, outputfile, sessionfi
with open(sessionfile, "w") as file:
file.write(
f"incremental\n{hashtocrack}\n{min_lenght} {max_length}\n{n}\n{password}\n{characters}\n{outputfile}")
file.close()
sys.exit()
else:
print(hashtocrack + " is not the md5 hash")


def ext(wordlist, hashtocrack, outputfile, linetoresume=None, sessionfile=None):
check = bool(re.match(r"([a-fA-F\d]{32}$)",hashtocrack))
check = bool(re.match(r"([a-fA-F\d]{32}$)", hashtocrack))
if check:
try:
with open(wordlist, "r") as file:
Expand All @@ -101,7 +112,7 @@ def ext(wordlist, hashtocrack, outputfile, linetoresume=None, sessionfile=None):
if "No such file" in str(error):
print("[*_*] No such file")
sys.exit()

starting_time = time.time()
for password in data:
linenumber = data.index(password)
try:
Expand All @@ -114,6 +125,11 @@ def ext(wordlist, hashtocrack, outputfile, linetoresume=None, sessionfile=None):
with open(outputfile, "w") as ou:
ou.write(password)
break
if sessionfile != None and "00:05:00" in timer(starting_time,time.time()):
with open(sessionfile, "w")as file:
file.write(
f"wordlist\n{hashtocrack}\n{wordlist}\n{linenumber}\n{outputfile}")
starting_time = time.time()
except Exception as error:
print(error)
sys.exit()
Expand Down

0 comments on commit b72a768

Please sign in to comment.