mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-04-28 12:03:11 -07:00
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.
This commit is contained in:
@@ -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 == "":
|
||||
|
||||
Reference in New Issue
Block a user