From 8bbbdabfb81d9d5fd838fd329a4d8ad3cf8a0ddf Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 21 Jan 2019 22:46:05 +0100 Subject: [PATCH 1/4] increased waiting time for submitting cracks on hashlist full crack closes s3inlc/hashtopolis#538 --- changelog.md | 6 ++++++ htpclient/hashcat_cracker.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 5b473b1..5629386 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +## v0.4.0 -> v0.x.x + +### 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..1e98a1a 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -208,7 +208,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 From 639a6bce4e8478ffb69c4ca10151a1071f4c1867 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 21 Jan 2019 23:11:58 +0100 Subject: [PATCH 2/4] fixed correct polling of process on output watcher closes s3inlc/hashtopolis#538 --- htpclient/hashcat_cracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index 1e98a1a..1c51aa2 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -436,9 +436,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: From 73875afea4486759ffae08a9ae13692aece3fbf1 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 24 Jun 2019 08:13:24 +0200 Subject: [PATCH 3/4] setting hashcat. as default for the cracker binary location --- .gitignore | 3 ++- changelog.md | 4 ++++ htpclient/hashcat_cracker.py | 13 +++++++++++-- htpclient/hashcat_status.py | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) 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 5629386..520e3ac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ ## 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. diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index 1c51aa2..4fdd9e7 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.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 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 From 772d5b7f1a0937db8b5b3d2878f9bc8378540e86 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Mon, 24 Jun 2019 14:46:57 +0200 Subject: [PATCH 4/4] fixed check for existence of new hashcat binary name --- htpclient/hashcat_cracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index 4fdd9e7..6efae14 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -29,7 +29,7 @@ def __init__(self, cracker_id, binary_download): if Initialize.get_os() != 1: self.callPath = "./" + self.callPath - if not os.path.isfile(self.callPath): # in case it's not the new hashcat filename, try the old one (hashcat.) + 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:]