diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index 06f900b..900c850 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -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 diff --git a/htpclient/hashcat_status.py b/htpclient/hashcat_status.py index a4369fe..ba8ca75 100644 --- a/htpclient/hashcat_status.py +++ b/htpclient/hashcat_status.py @@ -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. @@ -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') @@ -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 @@ -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