From 64372177b87d261f24dc4f2d93fca6d357697baf Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Mon, 16 Mar 2026 11:42:18 -0400 Subject: [PATCH] fix: fall back to cwd for potfile when ~/.hashcat does not exist When hashcat is not installed via the standard method, ~/.hashcat/ does not exist. Fall back to hashcat.potfile in the current working directory instead of referencing a path that does not exist. --- hate_crack/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hate_crack/main.py b/hate_crack/main.py index 0b82b82..ea0c928 100755 --- a/hate_crack/main.py +++ b/hate_crack/main.py @@ -295,7 +295,11 @@ hcatRules: list[str] = [] # Default: use ~/.hashcat/hashcat.potfile (explicitly passed to hashcat). # Disable override with config `hcatPotfilePath: ""` or CLI `--no-potfile-path`. if "hcatPotfilePath" not in config_parser: - hcatPotfilePath = os.path.expanduser("~/.hashcat/hashcat.potfile") + _default_pot = os.path.expanduser("~/.hashcat/hashcat.potfile") + if os.path.isfile(_default_pot) or os.path.isdir(os.path.dirname(_default_pot)): + hcatPotfilePath = _default_pot + else: + hcatPotfilePath = os.path.join(os.getcwd(), "hashcat.potfile") else: _raw_pot = (config_parser.get("hcatPotfilePath") or "").strip() if _raw_pot == "":