From 34c5eac5500dc921e50c7e6b3efcd7055b38726f Mon Sep 17 00:00:00 2001 From: jsteube Date: Sat, 16 Sep 2017 12:53:45 +0200 Subject: [PATCH] Fixed the use of --veracrypt-pim option. It was completely ignored without showing an error --- docs/changes.txt | 1 + extra/tab_completion/hashcat.sh | 6 ++-- src/interface.c | 54 ++++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b1243bd65..f27ab1f9d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -39,6 +39,7 @@ - Fixed the parsing of DCC2 hashes by allowing the "#" character within the user name - Fixed the parsing of descrypt hashes if the hashes do have non-standard characters within the salt - Fixed the output of --show when used together with the collider modes -m 9710, 9810 or 10410 +- Fixed the use of --veracrypt-pim option. It was completely ignored without showing an error - Fixed the version number used in the restore file header ## diff --git a/extra/tab_completion/hashcat.sh b/extra/tab_completion/hashcat.sh index 9fd3968dd..636eb9b44 100644 --- a/extra/tab_completion/hashcat.sh +++ b/extra/tab_completion/hashcat.sh @@ -189,8 +189,8 @@ _hashcat () local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H' local SHORT_OPTS="-m -a -V -v -h -b -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O" - local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" - local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --weak-hash-threshold --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --gpu-temp-retain --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" + local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" + local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --weak-hash-threshold --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --gpu-temp-retain --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" @@ -372,7 +372,7 @@ _hashcat () return 0 ;; - --truecrypt-keyfiles) + --truecrypt-keyfiles|--veracrypt-keyfiles) # first: remove the quotes such that file matching is possible local cur_part0=$(echo "${cur}" | grep -Eo '^("|'"'"')') diff --git a/src/interface.c b/src/interface.c index 9c0f3d46a..77147410f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -24392,7 +24392,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) if (hc_path_read (source_file) == false) { - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized OpenCL kernel not support for this hash-mode, falling back to pure kernel", source_file); + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized OpenCL kernel not support, falling back to pure kernel", source_file); } else { @@ -25048,6 +25048,7 @@ u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx) int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx) { + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const user_options_t *user_options = hashcat_ctx->user_options; char *optional_param1 = NULL; @@ -25096,6 +25097,57 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx) free (keyfiles); } + if (user_options->veracrypt_pim) + { + // we can access salt directly here because in VC it's always just one salt not many + + const hashes_t *hashes = hashcat_ctx->hashes; + + salt_t *salts_buf = hashes->salts_buf; + + salt_t *salt = &salts_buf[0]; + + switch (hashconfig->hash_mode) + { + case 13711: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13712: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13713: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13721: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13722: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13723: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13731: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13732: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13733: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13741: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + case 13742: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + case 13743: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + case 13751: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13752: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13753: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000); + break; + case 13761: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + case 13762: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + case 13763: salt->salt_iter = user_options->veracrypt_pim * 2048; + break; + } + } + return 0; }