diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index 4b3e512..1a23255 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -31,6 +31,15 @@ def __init__(self, cracker_id, binary_download): if Initialize.get_os() != 1: self.callPath = "./" + self.callPath + # Symlink hashcat.osx in macOS + if not os.path.isfile(self.cracker_path + "hashcat.osx"): # in case it's not the + if Initialize.get_os() == 2: # macOS + try: + output = subprocess.check_output("ln -s $(which hashcat) hashcat.osx", shell=True, cwd=self.cracker_path) + except subprocess.CalledProcessError as e: + logging.error("Error during version detection: " + str(e)) + sleep(5) + 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(".") diff --git a/htpclient/initialize.py b/htpclient/initialize.py index 839b60b..1ea0085 100644 --- a/htpclient/initialize.py +++ b/htpclient/initialize.py @@ -118,6 +118,22 @@ def __update_information(self): devices.append(line) else: # OS X + logging.info("Check if Homebrew is installed...") + output = subprocess.check_output("type brew", shell=True) + output = output.decode(encoding='utf-8').replace("\r\n", "\n").split("\n") + for line in output: + line = line.rstrip("\r\n ") + if "not found" in line: + log_error_and_exit("Please install Homebrew first. Visit https://brew.sh for instructions.") + + logging.info("Check if hashcat is installed via Homebrew...") + output = subprocess.check_output("brew info hashcat", shell=True) + output = output.decode(encoding='utf-8').replace("\r\n", "\n").split("\n") + for line in output: + line = line.rstrip("\r\n ") + if line == "Not installed": + log_error_and_exit("Please install hashcat via Homebrew first: brew install hashcat") + output = subprocess.check_output("system_profiler -detaillevel mini", shell=True) output = output.decode(encoding='utf-8').replace("\r\n", "\n").split("\n") for line in output: