From bf17452e42672abcf268ee911aeccc0a230fd9b3 Mon Sep 17 00:00:00 2001 From: bandrel Date: Fri, 4 May 2018 16:02:15 -0400 Subject: [PATCH 1/3] automated check for OSX vs Linux --- wordlist_optimizer.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wordlist_optimizer.py b/wordlist_optimizer.py index 768e0e0..b10f9a4 100755 --- a/wordlist_optimizer.py +++ b/wordlist_optimizer.py @@ -5,9 +5,6 @@ import os import subprocess import shutil -splitlen_bin = "hashcat-utils/bin/splitlen.app" -rli_bin = "hashcat-utils/bin/rli.app" - # Help def usage(): print("usage: python %s " % sys.argv[0]) @@ -32,8 +29,15 @@ def main(): except IndexError: usage() sys.exit() - - # Get list of wordlists from argument + + if sys.platform == 'darwin': + splitlen_bin = "hashcat-utils/bin/splitlen.app" + rli_bin = "hashcat-utils/bin/rli.app" + else: + splitlen_bin = "hashcat-utils/bin/splitlen.bin" + rli_bin = "hashcat-utils/bin/rli.bin" + + # Get list of wordlists from argument for wordlist in input_list: print(wordlist.strip()) From afce942a0071fcc32f62a6f526b3cd79327298e6 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 4 May 2018 16:56:03 -0400 Subject: [PATCH 2/3] minor correction to fix Dictionary attack --- hate_crack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hate_crack.py b/hate_crack.py index 82ed2d6..466cf63 100755 --- a/hate_crack.py +++ b/hate_crack.py @@ -110,7 +110,7 @@ def hcatDictionary(hcatHashType, hcatHashFile): global hcatDictionaryCount global hcatProcess hcatProcess = subprocess.Popen( - "{hcatPath} -m {hcatHashType} {hash_file} --remove -o {hash_file}.out {optimized_wordlists}/* " + "{hcatBin} -m {hcatHashType} {hash_file} --remove -o {hash_file}.out {optimized_wordlists}/* " "-r {hcatPath}/rules/best64.rule {tuning} --potfile-path={hate_path}/hashcat.pot".format( hcatPath=hcatPath, hcatBin=hcatBin, From b8b73fdb78cba22a27dc44541abf32fb3ad05307 Mon Sep 17 00:00:00 2001 From: bandrel Date: Fri, 4 May 2018 16:59:49 -0400 Subject: [PATCH 3/3] automated check for OSX vs Linux --- config.json | 6 +----- hate_crack.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index a18947f..9c3c920 100644 --- a/config.json +++ b/config.json @@ -3,9 +3,5 @@ "hcatBin": "hashcat", "hcatTuning": "--force", "hcatWordlists": "/Passwords/wordlists", - "hcatOptimizedWordlists": "/Passwords/optimized_wordlists", - "_comment": "Change extension to .bin for Linux and .app for OSX", - "hcatExpanderBin": "expander.app", - "hcatCombinatorBin": "combinator.app", - "hcatPrinceBin": "pp64.app" + "hcatOptimizedWordlists": "/Passwords/optimized_wordlists" } \ No newline at end of file diff --git a/hate_crack.py b/hate_crack.py index 466cf63..b6024bb 100755 --- a/hate_crack.py +++ b/hate_crack.py @@ -30,9 +30,16 @@ with open(hate_path + '/config.json') as config: hcatTuning = config_parser['hcatTuning'] hcatWordlists = config_parser['hcatWordlists'] hcatOptimizedWordlists = config_parser['hcatOptimizedWordlists'] - hcatExpanderBin = config_parser['hcatExpanderBin'] - hcatCombinatorBin = config_parser['hcatCombinatorBin'] - hcatPrinceBin = config_parser['hcatPrinceBin'] + +if sys.platform == 'darwin': + hcatExpanderBin = "expander.app" + hcatCombinatorBin = "combinator.app" + hcatPrinceBin = "pp64.app" +else: + hcatExpanderBin = "expander.bin" + hcatCombinatorBin = "combinator.bin" + hcatPrinceBin = "pp64.bin" + # hashcat biniary checks for systems that install hashcat binary in different location than the rest of the hashcat files if os.path.isfile(hcatBin):