Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion htpclient/hashcat_cracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ def run_loop(self, proc, chunk, task):
else:
identifier, line = item
if identifier == 'OUT':
status = HashcatStatus(line.decode())
# sometime after the release of hashcat 7.1.2 the PROGRESS values both got decreased by the --skip amount
# This keeps track of this offset and adds it back, to preserve the old bevahiour
version_tuple = tuple(int(s) for s in self.version_string.split('.'))
if chunk['skip'] and version_tuple >= (7,2):
status = HashcatStatus(line.decode(), skip=chunk['skip'])
else:
status = HashcatStatus(line.decode())
if status.is_valid():
self.statusCount += 1

Expand Down
7 changes: 4 additions & 3 deletions htpclient/hashcat_status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class HashcatStatus:
def __init__(self, line):
def __init__(self, line, skip=0):
"""
Initializes the HashcatStatus object by parsing a machine-readable
status line from Hashcat.
Expand All @@ -20,6 +20,7 @@ def __init__(self, line):
self.temp = []
self.power = []
self.unknown_fields = False
self.skip = skip

try:
fields = line.strip().split('\t')
Expand Down Expand Up @@ -89,7 +90,7 @@ def is_valid(self):
return self.status >= 0

def get_progress(self):
return self.progress[0]
return self.progress[0] + self.skip

def get_state(self):
return self.status - 1
Expand All @@ -101,7 +102,7 @@ def get_temps(self):
return self.temp

def get_progress_total(self):
return self.progress[1]
return self.progress[1] + self.skip

def get_all_util(self):
return self.util
Expand Down