Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ files
hashlists
__pycache__
*.zip
.idea
.idea
venv
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 13 additions & 4 deletions htpclient/hashcat_cracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<bit>.<ext>)
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion htpclient/hashcat_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down