diff --git a/.gitignore b/.gitignore index e917ed2..519328f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ files hashlists __pycache__ *.zip -.idea \ No newline at end of file +.idea +venv diff --git a/changelog.md b/changelog.md index 5b473b1..520e3ac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,13 @@ +## v0.4.0 -> v0.x.x + +### Enhancements + +* Adapt to path change of Hashcat which dropped pre-builds for 32-bit. + +### Bugfixes + +* Increased waiting time after full hashlist crack as hashcat quits too fast. + ## v0.3.0 -> v0.4.0 ### Features diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index ac2f123..6efae14 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -20,15 +20,24 @@ def __init__(self, cracker_id, binary_download): self.config = Config() self.io_q = Queue() - # Build cracker executable name by taking basename and adding 32/64 plus extension + # Build cracker executable name by taking basename plus extension self.executable_name = binary_download.get_version()['executable'] k = self.executable_name.rfind(".") - self.executable_name = self.executable_name[:k] + get_bit() + "." + self.executable_name[k + 1:] + self.executable_name = self.executable_name[:k] + "." + self.executable_name[k + 1:] self.cracker_path = "crackers/" + str(cracker_id) + "/" self.callPath = self.executable_name if Initialize.get_os() != 1: self.callPath = "./" + self.callPath + if not os.path.isfile(self.cracker_path + self.callPath): # in case it's not the new hashcat filename, try the old one (hashcat.) + self.executable_name = binary_download.get_version()['executable'] + k = self.executable_name.rfind(".") + self.executable_name = self.executable_name[:k] + get_bit() + "." + self.executable_name[k + 1:] + self.cracker_path = "crackers/" + str(cracker_id) + "/" + self.callPath = self.executable_name + if Initialize.get_os() != 1: + self.callPath = "./" + self.callPath + self.lock = Lock() self.cracks = [] self.first_status = False @@ -208,7 +217,7 @@ def run_loop(self, proc, chunk, task): speed = status.get_speed() initial = True if status.get_state() == 4 or status.get_state() == 5: - time.sleep(1) # we wait for a second so all output is loaded from file + time.sleep(5) # we wait five seconds so all output is loaded from file # reset piping stuff when a chunk is successfully finished self.progressVal = 0 self.usePipe = False @@ -436,9 +445,9 @@ def run_speed_benchmark(self, task): def output_watcher(self, file_path, process): while not os.path.exists(file_path): - time.sleep(1) if process.poll() is not None: return + time.sleep(1) file_handle = open(file_path, encoding="utf-8") end_count = 0 while 1: diff --git a/htpclient/hashcat_status.py b/htpclient/hashcat_status.py index 5e6f70a..f6461fd 100644 --- a/htpclient/hashcat_status.py +++ b/htpclient/hashcat_status.py @@ -44,7 +44,7 @@ def __init__(self, line): index += 2 if line[index] == "UTIL": index += 1 - while len(line) - 1 > index: # -1 because the \r\n is also included in the split + while len(line) - 1 > index: # -1 because the \r\n is also included in the split self.util.append(int(line[index])) index += 1