Prepare for on-the-fly keyboard layout substituations required to crack booting TrueCrypt/VeraCrypt volumes

pull/1785/head
Jens Steube 6 years ago
parent 9afed4b88d
commit 5d5ac1c935

@ -1308,6 +1308,7 @@ typedef struct tc
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf[16];
u32 keyboard_layout[256];
u32 signature;
} tc_t;

@ -20,6 +20,29 @@
#include "inc_truecrypt_crc32.cl"
#include "inc_truecrypt_xts.cl"
DECLSPEC void keyboard_map (u32 w[4], __local u32 *s_keyboard_layout)
{
w[0] = (s_keyboard_layout[(w[0] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[0] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[0] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[0] >> 24) & 0xff] << 24);
w[1] = (s_keyboard_layout[(w[1] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[1] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[1] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[1] >> 24) & 0xff] << 24);
w[2] = (s_keyboard_layout[(w[2] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[2] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[2] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[2] >> 24) & 0xff] << 24);
w[3] = (s_keyboard_layout[(w[3] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[3] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[3] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[3] >> 24) & 0xff] << 24);
}
DECLSPEC u32 u8add (const u32 a, const u32 b)
{
const u32 a1 = (a >> 0) & 0xff;
@ -83,14 +106,29 @@ DECLSPEC void hmac_ripemd160_run_V (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x
__kernel void m06211_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global tc_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max)
{
const u64 gid = get_global_id (0);
const u64 lid = get_local_id (0);
const u64 lsz = get_local_size (0);
/**
* base
* keyboard layout shared
*/
const u64 gid = get_global_id (0);
__local u32 s_keyboard_layout[256];
for (MAYBE_VOLATILE u32 i = lid; i < 256; i += lsz)
{
s_keyboard_layout[i] = esalt_bufs[digests_offset].keyboard_layout[i];
}
barrier (CLK_LOCAL_MEM_FENCE);
if (gid >= gid_max) return;
/**
* base
*/
u32 w0[4];
u32 w1[4];
u32 w2[4];
@ -113,6 +151,11 @@ __kernel void m06211_init (__global pw_t *pws, __global const kernel_rule_t *rul
w3[2] = pws[gid].i[14];
w3[3] = pws[gid].i[15];
keyboard_map (w0, s_keyboard_layout);
keyboard_map (w1, s_keyboard_layout);
keyboard_map (w2, s_keyboard_layout);
keyboard_map (w3, s_keyboard_layout);
w0[0] = u8add (w0[0], esalt_bufs[digests_offset].keyfile_buf[ 0]);
w0[1] = u8add (w0[1], esalt_bufs[digests_offset].keyfile_buf[ 1]);
w0[2] = u8add (w0[2], esalt_bufs[digests_offset].keyfile_buf[ 2]);

@ -20,6 +20,29 @@
#include "inc_truecrypt_crc32.cl"
#include "inc_truecrypt_xts.cl"
DECLSPEC void keyboard_map (u32 w[4], __local u32 *s_keyboard_layout)
{
w[0] = (s_keyboard_layout[(w[0] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[0] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[0] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[0] >> 24) & 0xff] << 24);
w[1] = (s_keyboard_layout[(w[1] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[1] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[1] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[1] >> 24) & 0xff] << 24);
w[2] = (s_keyboard_layout[(w[2] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[2] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[2] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[2] >> 24) & 0xff] << 24);
w[3] = (s_keyboard_layout[(w[3] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[3] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[3] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[3] >> 24) & 0xff] << 24);
}
DECLSPEC u32 u8add (const u32 a, const u32 b)
{
const u32 a1 = (a >> 0) & 0xff;
@ -83,14 +106,29 @@ DECLSPEC void hmac_ripemd160_run_V (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x
__kernel void m06212_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global tc_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max)
{
const u64 gid = get_global_id (0);
const u64 lid = get_local_id (0);
const u64 lsz = get_local_size (0);
/**
* base
* keyboard layout shared
*/
const u64 gid = get_global_id (0);
__local u32 s_keyboard_layout[256];
for (MAYBE_VOLATILE u32 i = lid; i < 256; i += lsz)
{
s_keyboard_layout[i] = esalt_bufs[digests_offset].keyboard_layout[i];
}
barrier (CLK_LOCAL_MEM_FENCE);
if (gid >= gid_max) return;
/**
* base
*/
u32 w0[4];
u32 w1[4];
u32 w2[4];
@ -113,6 +151,11 @@ __kernel void m06212_init (__global pw_t *pws, __global const kernel_rule_t *rul
w3[2] = pws[gid].i[14];
w3[3] = pws[gid].i[15];
keyboard_map (w0, s_keyboard_layout);
keyboard_map (w1, s_keyboard_layout);
keyboard_map (w2, s_keyboard_layout);
keyboard_map (w3, s_keyboard_layout);
w0[0] = u8add (w0[0], esalt_bufs[digests_offset].keyfile_buf[ 0]);
w0[1] = u8add (w0[1], esalt_bufs[digests_offset].keyfile_buf[ 1]);
w0[2] = u8add (w0[2], esalt_bufs[digests_offset].keyfile_buf[ 2]);

@ -20,6 +20,29 @@
#include "inc_truecrypt_crc32.cl"
#include "inc_truecrypt_xts.cl"
DECLSPEC void keyboard_map (u32 w[4], __local u32 *s_keyboard_layout)
{
w[0] = (s_keyboard_layout[(w[0] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[0] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[0] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[0] >> 24) & 0xff] << 24);
w[1] = (s_keyboard_layout[(w[1] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[1] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[1] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[1] >> 24) & 0xff] << 24);
w[2] = (s_keyboard_layout[(w[2] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[2] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[2] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[2] >> 24) & 0xff] << 24);
w[3] = (s_keyboard_layout[(w[3] >> 0) & 0xff] << 0)
| (s_keyboard_layout[(w[3] >> 8) & 0xff] << 8)
| (s_keyboard_layout[(w[3] >> 16) & 0xff] << 16)
| (s_keyboard_layout[(w[3] >> 24) & 0xff] << 24);
}
DECLSPEC u32 u8add (const u32 a, const u32 b)
{
const u32 a1 = (a >> 0) & 0xff;
@ -83,14 +106,29 @@ DECLSPEC void hmac_ripemd160_run_V (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x
__kernel void m06213_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global tc_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max)
{
const u64 gid = get_global_id (0);
const u64 lid = get_local_id (0);
const u64 lsz = get_local_size (0);
/**
* base
* keyboard layout shared
*/
const u64 gid = get_global_id (0);
__local u32 s_keyboard_layout[256];
for (MAYBE_VOLATILE u32 i = lid; i < 256; i += lsz)
{
s_keyboard_layout[i] = esalt_bufs[digests_offset].keyboard_layout[i];
}
barrier (CLK_LOCAL_MEM_FENCE);
if (gid >= gid_max) return;
/**
* base
*/
u32 w0[4];
u32 w1[4];
u32 w2[4];
@ -113,6 +151,11 @@ __kernel void m06213_init (__global pw_t *pws, __global const kernel_rule_t *rul
w3[2] = pws[gid].i[14];
w3[3] = pws[gid].i[15];
keyboard_map (w0, s_keyboard_layout);
keyboard_map (w1, s_keyboard_layout);
keyboard_map (w2, s_keyboard_layout);
keyboard_map (w3, s_keyboard_layout);
w0[0] = u8add (w0[0], esalt_bufs[digests_offset].keyfile_buf[ 0]);
w0[1] = u8add (w0[1], esalt_bufs[digests_offset].keyfile_buf[ 1]);
w0[2] = u8add (w0[2], esalt_bufs[digests_offset].keyfile_buf[ 2]);

@ -7,6 +7,8 @@
- Added support for using --stdout in brain-client mode
- Added new option --stdin-timeout-abort, to set how long hashcat should wait for stdin input before aborting
- Added new option --kernel-threads to manually override the automatically-calculated number of threads
- Added new option --truecrypt-keyboard-layout to map users keyboard layout, required to crack system boot volumes
- Added new option --veracrypt-keyboard-layout to map users keyboard layout, required to crack system boot volumes
##
## Algorithms

@ -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 -S -z"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --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 --kernel-threads --nvidia-spin-damp --hwmon-disable --hwmon-temp-abort --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 --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
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 --markov-hcstat2 --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 --kernel-threads --nvidia-spin-damp --hwmon-temp-abort --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 --brain-host --brain-password --brain-port --brain-session --brain-whitelist-session --stdin-timeout-abort"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --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 --kernel-threads --nvidia-spin-damp --hwmon-disable --hwmon-temp-abort --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-keyboard-layout --truecrypt-keyfiles --veracrypt-keyboard-layout --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
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 --markov-hcstat2 --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 --kernel-threads --nvidia-spin-damp --hwmon-temp-abort --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-keyboard-layout --truecrypt-keyfiles --veracrypt-keyboard-layout --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-host --brain-password --brain-port --brain-session --brain-whitelist-session --stdin-timeout-abort"
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
@ -308,6 +308,12 @@ _hashcat ()
return 0
;;
--truecrypt-keyboard-layout|--veracrypt-keyboard-layout)
local files=$(ls -d ${cur}* 2> /dev/null | grep '.*\.hckmap$' 2> /dev/null)
COMPREPLY=($(compgen -W "${files}" -- ${cur})) # or $(compgen -f -X '*.+('${HIDDEN_FILES_AGGRESIVE}')' -- ${cur})
return 0
;;
-1|-2|-3|-4|--custom-charset1|--custom-charset2|--custom-charset3|--custom-charset4)
local mask=${BUILD_IN_CHARSETS}

@ -322,6 +322,7 @@ typedef struct tc
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf[16];
u32 keyboard_layout[256];
u32 signature;
} tc_t;

@ -711,13 +711,15 @@ typedef enum user_options_map
IDX_STATUS_TIMER = 0xff3f,
IDX_STDOUT_FLAG = 0xff40,
IDX_STDIN_TIMEOUT_ABORT = 0xff41,
IDX_TRUECRYPT_KEYFILES = 0xff42,
IDX_USERNAME = 0xff43,
IDX_VERACRYPT_KEYFILES = 0xff44,
IDX_VERACRYPT_PIM = 0xff45,
IDX_TRUECRYPT_KEYBOARD_LAYOUT = 0xff42,
IDX_TRUECRYPT_KEYFILES = 0xff43,
IDX_USERNAME = 0xff44,
IDX_VERACRYPT_KEYBOARD_LAYOUT = 0xff45,
IDX_VERACRYPT_KEYFILES = 0xff46,
IDX_VERACRYPT_PIM = 0xff47,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff46,
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff48,
IDX_WORKLOAD_PROFILE = 'w',
} user_options_map_t;
@ -1761,7 +1763,9 @@ typedef struct user_options
char *restore_file_path;
char **rp_files;
char separator;
char *truecrypt_keyboard_layout;
char *truecrypt_keyfiles;
char *veracrypt_keyboard_layout;
char *veracrypt_keyfiles;
const char *custom_charset_1;
const char *custom_charset_2;

@ -427,8 +427,9 @@ install_make_shared_root:
install_docs: install_make_shared_root
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/docs
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/charsets
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/docs
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/layouts
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/masks
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/rules
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra
@ -443,10 +444,12 @@ install_docs: install_make_shared_root
$(INSTALL) -m 644 extra/tab_completion/hashcat.sh $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
$(INSTALL) -m 644 extra/tab_completion/howto.txt $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
$(INSTALL) -m 755 extra/tab_completion/install $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
$(FIND) docs/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) docs/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) charsets/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) charsets/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) docs/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) docs/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) layouts/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) layouts/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) masks/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) masks/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
$(FIND) rules/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;

@ -302,6 +302,27 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
strncpy ((char *) plain_ptr, (char *) temp_ptr, sizeof (plain_buf));
}
// we do some kernel internal substituations, so we need to do that here as well, if it cracks
// truecrypt and veracrypt boot only
if ((hashconfig->hash_mode == 6241)
|| (hashconfig->hash_mode == 6242)
|| (hashconfig->hash_mode == 6243)
|| (hashconfig->hash_mode == 13741)
|| (hashconfig->hash_mode == 13742)
|| (hashconfig->hash_mode == 13743)
|| (hashconfig->hash_mode == 13761)
|| (hashconfig->hash_mode == 13762)
|| (hashconfig->hash_mode == 13763))
{
tc_t *tc = (tc_t *) hashes->esalts_buf;
for (int i = 0; i < plain_len; i++)
{
plain_ptr[i] = (u8) tc->keyboard_layout[plain_ptr[i]];
}
}
// crackpos
u64 crackpos = 0;

@ -21,6 +21,7 @@
#include "shared.h"
#include "opencl.h"
#include "interface.h"
#include "filehandling.h"
#include "ext_lzma.h"
static const char *ST_PASS_HASHCAT_PLAIN = "hashcat";
@ -2627,6 +2628,86 @@ static int input_tokenizer (u8 *input_buf, int input_len, token_t *token)
return PARSER_OK;
}
static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *filename, u32 *keyboard_layout)
{
char *line_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
FILE *fp = fopen (filename, "r");
if (fp == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", filename, strerror (errno));
return false;
}
u32 verifyF[256] = { 0 };
u32 verifyT[256] = { 0 };
while (!feof (fp))
{
const size_t line_len = fgetl (fp, line_buf);
if (line_len == 0) continue;
token_t token;
token.token_cnt = 2;
token.len_min[0] = 1;
token.len_max[0] = 1;
token.sep[0] = '=';
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH;
token.len_min[1] = 1;
token.len_max[1] = 1;
token.sep[1] = '=';
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH;
const int rc_tokenizer = input_tokenizer ((u8 *) line_buf, line_len, &token);
if (rc_tokenizer != PARSER_OK)
{
event_log_error (hashcat_ctx, "%s: Syntax error: %s", filename, line_buf);
free (line_buf);
return false;
}
const u8 from = token.buf[0][0];
const u8 to = token.buf[1][0];
keyboard_layout[from] = to;
verifyF[from]++;
verifyT[to]++;
}
fclose (fp);
free (line_buf);
for (int i = 0x20; i < 0x7f; i++)
{
if (verifyF[i] > 1)
{
event_log_error (hashcat_ctx, "%s: Mapping error: defined '%c' too often in from section", filename, i);
return false;
}
if (verifyT[i] > 1)
{
event_log_error (hashcat_ctx, "%s: Mapping error: defined '%c' too often in to section", filename, i);
return false;
}
}
return true;
}
static bool parse_and_store_generic_salt (u8 *out_buf, int *out_len, const u8 *in_buf, const int in_len, MAYBE_UNUSED hashconfig_t *hashconfig)
{
u32 tmp_u32[(64 * 2) + 1] = { 0 };
@ -6944,6 +7025,11 @@ int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
for (int i = 0; i < 256; i++)
{
tc->keyboard_layout[i] = i;
}
memcpy (tc->salt_buf, buf, 64);
memcpy (tc->data_buf, buf + 64, 512 - 64);
@ -29146,112 +29232,140 @@ int hashconfig_get_salt_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_ke
int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
const user_options_t *user_options = hashcat_ctx->user_options;
char *optional_param1 = NULL;
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->truecrypt_keyfiles) optional_param1 = user_options->truecrypt_keyfiles;
if (user_options->veracrypt_keyfiles) optional_param1 = user_options->veracrypt_keyfiles;
if (optional_param1)
// truecrypt and veracrypt only
if (((hashconfig->hash_mode >= 6200) && (hashconfig->hash_mode <= 6299))
|| ((hashconfig->hash_mode >= 13700) && (hashconfig->hash_mode == 13799)))
{
const hashes_t *hashes = hashcat_ctx->hashes;
void *esalts_buf = hashes->esalts_buf;
hashes_t *hashes = hashcat_ctx->hashes;
char *tcvc_keyfiles = optional_param1;
tc_t *tc = (tc_t *) hashes->esalts_buf;
u32 *keyfile_buf = ((tc_t *) esalts_buf)->keyfile_buf;
char *optional_param1 = NULL;
char *keyfiles = hcstrdup (tcvc_keyfiles);
if (user_options->truecrypt_keyfiles) optional_param1 = user_options->truecrypt_keyfiles;
if (user_options->veracrypt_keyfiles) optional_param1 = user_options->veracrypt_keyfiles;
if (keyfiles == NULL) return -1;
if (optional_param1)
{
char *tcvc_keyfiles = optional_param1;
char *saveptr = NULL;
char *keyfiles = hcstrdup (tcvc_keyfiles);
char *keyfile = strtok_r (keyfiles, ",", &saveptr);
if (keyfiles == NULL) return -1;
if (keyfile == NULL)
{
free (keyfiles);
char *saveptr = NULL;
return -1;
}
char *keyfile = strtok_r (keyfiles, ",", &saveptr);
do
{
const int rc_crc32 = cpu_crc32 (hashcat_ctx, keyfile, (u8 *) keyfile_buf);
if (rc_crc32 == -1)
if (keyfile == NULL)
{
free (keyfiles);
return -1;
}
} while ((keyfile = strtok_r ((char *) NULL, ",", &saveptr)) != NULL);
do
{
const int rc_crc32 = cpu_crc32 (hashcat_ctx, keyfile, (u8 *) tc->keyfile_buf);
if (rc_crc32 == -1)
{
free (keyfiles);
return -1;
}
} while ((keyfile = strtok_r ((char *) NULL, ",", &saveptr)) != NULL);
free (keyfiles);
}
// truecrypt and veracrypt boot only
if ((hashconfig->hash_mode == 6241)
|| (hashconfig->hash_mode == 6242)
|| (hashconfig->hash_mode == 6243)
|| (hashconfig->hash_mode == 13741)
|| (hashconfig->hash_mode == 13742)
|| (hashconfig->hash_mode == 13743)
|| (hashconfig->hash_mode == 13761)
|| (hashconfig->hash_mode == 13762)
|| (hashconfig->hash_mode == 13763))
{
char *optional_param2 = NULL;
if (user_options->truecrypt_keyboard_layout) optional_param2 = user_options->truecrypt_keyboard_layout;
if (user_options->veracrypt_keyboard_layout) optional_param2 = user_options->veracrypt_keyboard_layout;
free (keyfiles);
const bool rc = initialize_keyboard_layout (hashcat_ctx, optional_param2, tc->keyboard_layout);
if (rc == false) return -1;
}
}
if (user_options->veracrypt_pim)
// veracrypt only
if ((hashconfig->hash_mode >= 13700) && (hashconfig->hash_mode == 13799))
{
// we can access salt directly here because in VC it's always just one salt not many
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;
hashes_t *hashes = hashcat_ctx->hashes;
salt_t *salts_buf = hashes->salts_buf;
salt_t *salts_buf = hashes->salts_buf;
salt_t *salt = &salts_buf[0];
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;
case 13771: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
case 13772: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
case 13773: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
}
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;
case 13771: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
case 13772: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
case 13773: salt->salt_iter = 15000 + (user_options->veracrypt_pim * 1000);
break;
}
salt->salt_iter -= 1;
salt->salt_iter -= 1;
}
}
return 0;

@ -24,109 +24,111 @@ static const char *const USAGE_BIG[] =
"",
"- [ Options ] -",
"",
" Options Short / Long | Type | Description | Example",
"================================+======+======================================================+=======================",
" -m, --hash-type | Num | Hash-type, see references below | -m 1000",
" -a, --attack-mode | Num | Attack-mode, see references below | -a 3",
" -V, --version | | Print version |",
" -h, --help | | Print help |",
" --quiet | | Suppress output |",
" --hex-charset | | Assume charset is given in hex |",
" --hex-salt | | Assume salt is given in hex |",
" --hex-wordlist | | Assume words in wordlist are given in hex |",
" --force | | Ignore warnings |",
" --status | | Enable automatic update of the status screen |",
" --status-timer | Num | Sets seconds between status screen updates to X | --status-timer=1",
" --stdin-timeout-abort | Num | Abort if there is no input from stdin for X seconds | --stdin-timeout-abort=300",
" --machine-readable | | Display the status view in a machine-readable format |",
" --keep-guessing | | Keep guessing the hash after it has been cracked |",
" --self-test-disable | | Disable self-test functionality on startup |",
" --loopback | | Add new plains to induct directory |",
" --markov-hcstat2 | File | Specify hcstat2 file to use | --markov-hcstat2=my.hcstat2",
" --markov-disable | | Disables markov-chains, emulates classic brute-force |",
" --markov-classic | | Enables classic markov-chains, no per-position |",
" -t, --markov-threshold | Num | Threshold X when to stop accepting new markov-chains | -t 50",
" --runtime | Num | Abort session after X seconds of runtime | --runtime=10",
" --session | Str | Define specific session name | --session=mysession",
" --restore | | Restore session from --session |",
" --restore-disable | | Do not write restore file |",
" --restore-file-path | File | Specific path to restore file | --restore-file-path=x.restore",
" -o, --outfile | File | Define outfile for recovered hash | -o outfile.txt",
" --outfile-format | Num | Define outfile-format X for recovered hash | --outfile-format=7",
" --outfile-autohex-disable | | Disable the use of $HEX[] in output plains |",
" --outfile-check-timer | Num | Sets seconds between outfile checks to X | --outfile-check=30",
" --wordlist-autohex-disable | | Disable the conversion of $HEX[] from the wordlist |",
" -p, --separator | Char | Separator char for hashlists and outfile | -p :",
" --stdout | | Do not crack a hash, instead print candidates only |",
" --show | | Compare hashlist with potfile; show cracked hashes |",
" --left | | Compare hashlist with potfile; show uncracked hashes |",
" --username | | Enable ignoring of usernames in hashfile |",
" --remove | | Enable removal of hashes once they are cracked |",
" --remove-timer | Num | Update input hash file each X seconds | --remove-timer=30",
" --potfile-disable | | Do not write potfile |",
" --potfile-path | File | Specific path to potfile | --potfile-path=my.pot",
" --encoding-from | Code | Force internal wordlist encoding from X | --encoding-from=iso-8859-15",
" --encoding-to | Code | Force internal wordlist encoding to X | --encoding-to=utf-32le",
" --debug-mode | Num | Defines the debug mode (hybrid only by using rules) | --debug-mode=4",
" --debug-file | File | Output file for debugging rules | --debug-file=good.log",
" --induction-dir | Dir | Specify the induction directory to use for loopback | --induction=inducts",
" --outfile-check-dir | Dir | Specify the outfile directory to monitor for plains | --outfile-check-dir=x",
" --logfile-disable | | Disable the logfile |",
" --hccapx-message-pair | Num | Load only message pairs from hccapx matching X | --hccapx-message-pair=2",
" --nonce-error-corrections | Num | The BF size range to replace AP's nonce last bytes | --nonce-error-corrections=16",
" --truecrypt-keyfiles | File | Keyfiles to use, separated with commas | --truecrypt-key=x.png",
" --veracrypt-keyfiles | File | Keyfiles to use, separated with commas | --veracrypt-key=x.txt",
" --veracrypt-pim | Num | VeraCrypt personal iterations multiplier | --veracrypt-pim=1000",
" -b, --benchmark | | Run benchmark of selected hash-modes |",
" --benchmark-all | | Run benchmark of all hash-modes (requires -b) |",
" --speed-only | | Return expected speed of the attack, then quit |",
" --progress-only | | Return ideal progress step size and time to process |",
" -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32",
" --bitmap-min | Num | Sets minimum bits allowed for bitmaps to X | --bitmap-min=24",
" --bitmap-max | Num | Sets maximum bits allowed for bitmaps to X | --bitmap-max=24",
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
" --example-hashes | | Show an example hash for each hash-mode |",
" -I, --opencl-info | | Show info about detected OpenCL platforms/devices | -I",
" --opencl-platforms | Str | OpenCL platforms to use, separated with commas | --opencl-platforms=2",
" -d, --opencl-devices | Str | OpenCL devices to use, separated with commas | -d 1",
" -D, --opencl-device-types | Str | OpenCL device-types to use, separated with commas | -D 1",
" --opencl-vector-width | Num | Manually override OpenCL vector-width to X | --opencl-vector=4",
" -O, --optimized-kernel-enable | | Enable optimized kernels (limits password length) |",
" -w, --workload-profile | Num | Enable a specific workload profile, see pool below | -w 3",
" -n, --kernel-accel | Num | Manual workload tuning, set outerloop step size to X | -n 64",
" -u, --kernel-loops | Num | Manual workload tuning, set innerloop step size to X | -u 256",
" -T, --kernel-threads | Num | Manual workload tuning, set thread count to X | -T 64",
" --nvidia-spin-damp | Num | Workaround NVIDIAs CPU burning loop bug, in percent | --nvidia-spin-damp=50",
" --hwmon-disable | | Disable temperature and fanspeed reads and triggers |",
" --hwmon-temp-abort | Num | Abort if temperature reaches X degrees Celsius | --hwmon-temp-abort=100",
" --scrypt-tmto | Num | Manually override TMTO value for scrypt to X | --scrypt-tmto=3",
" -s, --skip | Num | Skip X words from the start | -s 1000000",
" -l, --limit | Num | Limit X words from the start + skipped words | -l 1000000",
" --keyspace | | Show keyspace base:mod values and quit |",
" -j, --rule-left | Rule | Single rule applied to each word from left wordlist | -j 'c'",
" -k, --rule-right | Rule | Single rule applied to each word from right wordlist | -k '^-'",
" -r, --rules-file | File | Multiple rules applied to each word from wordlists | -r rules/best64.rule",
" -g, --generate-rules | Num | Generate X random rules | -g 10000",
" --generate-rules-func-min | Num | Force min X functions per rule |",
" --generate-rules-func-max | Num | Force max X functions per rule |",
" --generate-rules-seed | Num | Force RNG seed set to X |",
" -1, --custom-charset1 | CS | User-defined charset ?1 | -1 ?l?d?u",
" -2, --custom-charset2 | CS | User-defined charset ?2 | -2 ?l?d?s",
" -3, --custom-charset3 | CS | User-defined charset ?3 |",
" -4, --custom-charset4 | CS | User-defined charset ?4 |",
" -i, --increment | | Enable mask increment mode |",
" --increment-min | Num | Start mask incrementing at X | --increment-min=4",
" --increment-max | Num | Stop mask incrementing at X | --increment-max=8",
" -S, --slow-candidates | | Enable slower (but advanced) candidate generators |",
" Options Short / Long | Type | Description | Example",
"=================================+======+======================================================+=======================",
" -m, --hash-type | Num | Hash-type, see references below | -m 1000",
" -a, --attack-mode | Num | Attack-mode, see references below | -a 3",
" -V, --version | | Print version |",
" -h, --help | | Print help |",
" --quiet | | Suppress output |",
" --hex-charset | | Assume charset is given in hex |",
" --hex-salt | | Assume salt is given in hex |",
" --hex-wordlist | | Assume words in wordlist are given in hex |",
" --force | | Ignore warnings |",
" --status | | Enable automatic update of the status screen |",
" --status-timer | Num | Sets seconds between status screen updates to X | --status-timer=1",
" --stdin-timeout-abort | Num | Abort if there is no input from stdin for X seconds | --stdin-timeout-abort=300",
" --machine-readable | | Display the status view in a machine-readable format |",
" --keep-guessing | | Keep guessing the hash after it has been cracked |",
" --self-test-disable | | Disable self-test functionality on startup |",
" --loopback | | Add new plains to induct directory |",
" --markov-hcstat2 | File | Specify hcstat2 file to use | --markov-hcstat2=my.hcstat2",
" --markov-disable | | Disables markov-chains, emulates classic brute-force |",
" --markov-classic | | Enables classic markov-chains, no per-position |",
" -t, --markov-threshold | Num | Threshold X when to stop accepting new markov-chains | -t 50",
" --runtime | Num | Abort session after X seconds of runtime | --runtime=10",
" --session | Str | Define specific session name | --session=mysession",
" --restore | | Restore session from --session |",
" --restore-disable | | Do not write restore file |",
" --restore-file-path | File | Specific path to restore file | --restore-file-path=x.restore",
" -o, --outfile | File | Define outfile for recovered hash | -o outfile.txt",
" --outfile-format | Num | Define outfile-format X for recovered hash | --outfile-format=7",
" --outfile-autohex-disable | | Disable the use of $HEX[] in output plains |",
" --outfile-check-timer | Num | Sets seconds between outfile checks to X | --outfile-check=30",
" --wordlist-autohex-disable | | Disable the conversion of $HEX[] from the wordlist |",
" -p, --separator | Char | Separator char for hashlists and outfile | -p :",
" --stdout | | Do not crack a hash, instead print candidates only |",
" --show | | Compare hashlist with potfile; show cracked hashes |",
" --left | | Compare hashlist with potfile; show uncracked hashes |",
" --username | | Enable ignoring of usernames in hashfile |",
" --remove | | Enable removal of hashes once they are cracked |",
" --remove-timer | Num | Update input hash file each X seconds | --remove-timer=30",
" --potfile-disable | | Do not write potfile |",
" --potfile-path | File | Specific path to potfile | --potfile-path=my.pot",
" --encoding-from | Code | Force internal wordlist encoding from X | --encoding-from=iso-8859-15",
" --encoding-to | Code | Force internal wordlist encoding to X | --encoding-to=utf-32le",
" --debug-mode | Num | Defines the debug mode (hybrid only by using rules) | --debug-mode=4",
" --debug-file | File | Output file for debugging rules | --debug-file=good.log",
" --induction-dir | Dir | Specify the induction directory to use for loopback | --induction=inducts",
" --outfile-check-dir | Dir | Specify the outfile directory to monitor for plains | --outfile-check-dir=x",
" --logfile-disable | | Disable the logfile |",
" --hccapx-message-pair | Num | Load only message pairs from hccapx matching X | --hccapx-message-pair=2",
" --nonce-error-corrections | Num | The BF size range to replace AP's nonce last bytes | --nonce-error-corrections=16",
" --truecrypt-keyboard-layout | File | Keyboard mapping table for system-boot passwords | --truecrypt-keyb=german.hckmap",
" --truecrypt-keyfiles | File | Keyfiles to use, separated with commas | --truecrypt-keyf=x.png",
" --veracrypt-keyboard-layout | File | Keyboard mapping table for system-boot passwords | --veracrypt-keyb=swedish.hckmap",
" --veracrypt-keyfiles | File | Keyfiles to use, separated with commas | --veracrypt-keyf=x.txt",
" --veracrypt-pim | Num | VeraCrypt personal iterations multiplier | --veracrypt-pim=1000",
" -b, --benchmark | | Run benchmark of selected hash-modes |",
" --benchmark-all | | Run benchmark of all hash-modes (requires -b) |",
" --speed-only | | Return expected speed of the attack, then quit |",
" --progress-only | | Return ideal progress step size and time to process |",
" -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32",
" --bitmap-min | Num | Sets minimum bits allowed for bitmaps to X | --bitmap-min=24",
" --bitmap-max | Num | Sets maximum bits allowed for bitmaps to X | --bitmap-max=24",
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
" --example-hashes | | Show an example hash for each hash-mode |",
" -I, --opencl-info | | Show info about detected OpenCL platforms/devices | -I",
" --opencl-platforms | Str | OpenCL platforms to use, separated with commas | --opencl-platforms=2",
" -d, --opencl-devices | Str | OpenCL devices to use, separated with commas | -d 1",
" -D, --opencl-device-types | Str | OpenCL device-types to use, separated with commas | -D 1",
" --opencl-vector-width | Num | Manually override OpenCL vector-width to X | --opencl-vector=4",
" -O, --optimized-kernel-enable | | Enable optimized kernels (limits password length) |",
" -w, --workload-profile | Num | Enable a specific workload profile, see pool below | -w 3",
" -n, --kernel-accel | Num | Manual workload tuning, set outerloop step size to X | -n 64",
" -u, --kernel-loops | Num | Manual workload tuning, set innerloop step size to X | -u 256",
" -T, --kernel-threads | Num | Manual workload tuning, set thread count to X | -T 64",
" --nvidia-spin-damp | Num | Workaround NVIDIAs CPU burning loop bug, in percent | --nvidia-spin-damp=50",
" --hwmon-disable | | Disable temperature and fanspeed reads and triggers |",
" --hwmon-temp-abort | Num | Abort if temperature reaches X degrees Celsius | --hwmon-temp-abort=100",
" --scrypt-tmto | Num | Manually override TMTO value for scrypt to X | --scrypt-tmto=3",
" -s, --skip | Num | Skip X words from the start | -s 1000000",
" -l, --limit | Num | Limit X words from the start + skipped words | -l 1000000",
" --keyspace | | Show keyspace base:mod values and quit |",
" -j, --rule-left | Rule | Single rule applied to each word from left wordlist | -j 'c'",
" -k, --rule-right | Rule | Single rule applied to each word from right wordlist | -k '^-'",
" -r, --rules-file | File | Multiple rules applied to each word from wordlists | -r rules/best64.rule",
" -g, --generate-rules | Num | Generate X random rules | -g 10000",
" --generate-rules-func-min | Num | Force min X functions per rule |",
" --generate-rules-func-max | Num | Force max X functions per rule |",
" --generate-rules-seed | Num | Force RNG seed set to X |",
" -1, --custom-charset1 | CS | User-defined charset ?1 | -1 ?l?d?u",
" -2, --custom-charset2 | CS | User-defined charset ?2 | -2 ?l?d?s",
" -3, --custom-charset3 | CS | User-defined charset ?3 |",
" -4, --custom-charset4 | CS | User-defined charset ?4 |",
" -i, --increment | | Enable mask increment mode |",
" --increment-min | Num | Start mask incrementing at X | --increment-min=4",
" --increment-max | Num | Stop mask incrementing at X | --increment-max=8",
" -S, --slow-candidates | | Enable slower (but advanced) candidate generators |",
#ifdef WITH_BRAIN
" --brain-server | | Enable brain server |",
" -z, --brain-client | | Enable brain client, activates -S |",
" --brain-client-features | Num | Define brain client features, see below | --brain-client-features=3",
" --brain-host | Str | Brain server host (IP or domain) | --brain-host=127.0.0.1",
" --brain-port | Port | Brain server port | --brain-port=13743",
" --brain-password | Str | Brain server authentication password | --brain-password=bZfhCvGUSjRq",
" --brain-session | Hex | Overrides automatically calculated brain session | --brain-session=0x2ae611db",
" --brain-session-whitelist | Hex | Allow given sessions only, separated with commas | --brain-session-whitelist=0x2ae611db",
" --brain-server | | Enable brain server |",
" -z, --brain-client | | Enable brain client, activates -S |",
" --brain-client-features | Num | Define brain client features, see below | --brain-client-features=3",
" --brain-host | Str | Brain server host (IP or domain) | --brain-host=127.0.0.1",
" --brain-port | Port | Brain server port | --brain-port=13743",
" --brain-password | Str | Brain server authentication password | --brain-password=bZfhCvGUSjRq",
" --brain-session | Hex | Overrides automatically calculated brain session | --brain-session=0x2ae611db",
" --brain-session-whitelist | Hex | Allow given sessions only, separated with commas | --brain-session-whitelist=0x2ae611db",
#endif
"",
"- [ Hash modes ] -",

@ -113,8 +113,10 @@ static const struct option long_options[] =
{"status-timer", required_argument, NULL, IDX_STATUS_TIMER},
{"stdout", no_argument, NULL, IDX_STDOUT_FLAG},
{"stdin-timeout-abort", required_argument, NULL, IDX_STDIN_TIMEOUT_ABORT},
{"truecrypt-keyboard-layout", required_argument, NULL, IDX_TRUECRYPT_KEYBOARD_LAYOUT},
{"truecrypt-keyfiles", required_argument, NULL, IDX_TRUECRYPT_KEYFILES},
{"username", no_argument, NULL, IDX_USERNAME},
{"veracrypt-keyboard-layout", required_argument, NULL, IDX_VERACRYPT_KEYBOARD_LAYOUT},
{"veracrypt-keyfiles", required_argument, NULL, IDX_VERACRYPT_KEYFILES},
{"veracrypt-pim", required_argument, NULL, IDX_VERACRYPT_PIM},
{"version", no_argument, NULL, IDX_VERSION},
@ -241,9 +243,11 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->status_timer = STATUS_TIMER;
user_options->stdin_timeout_abort = STDIN_TIMEOUT_ABORT;
user_options->stdout_flag = STDOUT_FLAG;
user_options->truecrypt_keyboard_layout = NULL;
user_options->truecrypt_keyfiles = NULL;
user_options->usage = USAGE;
user_options->username = USERNAME;
user_options->veracrypt_keyboard_layout = NULL;
user_options->veracrypt_keyfiles = NULL;
user_options->veracrypt_pim = 0;
user_options->version = VERSION;
@ -347,131 +351,133 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
{
switch (c)
{
case IDX_HELP: user_options->usage = true; break;
case IDX_VERSION: user_options->version = true; break;
case IDX_RESTORE: user_options->restore = true; break;
case IDX_QUIET: user_options->quiet = true; break;
case IDX_SHOW: user_options->show = true; break;
case IDX_LEFT: user_options->left = true; break;
case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break;
case IDX_USERNAME: user_options->username = true; break;
case IDX_REMOVE: user_options->remove = true; break;
case IDX_REMOVE_TIMER: user_options->remove_timer = hc_strtoul (optarg, NULL, 10);
user_options->remove_timer_chgd = true; break;
case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break;
case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break;
case IDX_DEBUG_MODE: user_options->debug_mode = hc_strtoul (optarg, NULL, 10); break;
case IDX_DEBUG_FILE: user_options->debug_file = optarg; break;
case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break;
case IDX_ENCODING_TO: user_options->encoding_to = optarg; break;
case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break;
case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break;
case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break;
case IDX_FORCE: user_options->force = true; break;
case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break;
case IDX_SKIP: user_options->skip = hc_strtoull (optarg, NULL, 10);
user_options->skip_chgd = true; break;
case IDX_LIMIT: user_options->limit = hc_strtoull (optarg, NULL, 10);
user_options->limit_chgd = true; break;
case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break;
case IDX_KEYSPACE: user_options->keyspace = true; break;
case IDX_BENCHMARK: user_options->benchmark = true; break;
case IDX_BENCHMARK_ALL: user_options->benchmark_all = true; break;
case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break;
case IDX_STDIN_TIMEOUT_ABORT: user_options->stdin_timeout_abort = hc_strtoul (optarg, NULL, 10);
user_options->stdin_timeout_abort_chgd = true; break;
case IDX_SPEED_ONLY: user_options->speed_only = true; break;
case IDX_PROGRESS_ONLY: user_options->progress_only = true; break;
case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break;
case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break;
case IDX_STATUS: user_options->status = true; break;
case IDX_STATUS_TIMER: user_options->status_timer = hc_strtoul (optarg, NULL, 10); break;
case IDX_MACHINE_READABLE: user_options->machine_readable = true; break;
case IDX_LOOPBACK: user_options->loopback = true; break;
case IDX_SESSION: user_options->session = optarg; break;
case IDX_HASH_MODE: user_options->hash_mode = hc_strtoul (optarg, NULL, 10);
user_options->hash_mode_chgd = true; break;
case IDX_RUNTIME: user_options->runtime = hc_strtoul (optarg, NULL, 10);
user_options->runtime_chgd = true; break;
case IDX_ATTACK_MODE: user_options->attack_mode = hc_strtoul (optarg, NULL, 10);
user_options->attack_mode_chgd = true; break;
case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] = optarg; break;
case IDX_RP_GEN: user_options->rp_gen = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_SEED: user_options->rp_gen_seed = hc_strtoul (optarg, NULL, 10);
user_options->rp_gen_seed_chgd = true; break;
case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break;
case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break;
case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break;
case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break;
case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = hc_strtoul (optarg, NULL, 10); break;
case IDX_MARKOV_HCSTAT2: user_options->markov_hcstat2 = optarg; break;
case IDX_OUTFILE: user_options->outfile = optarg; break;
case IDX_OUTFILE_FORMAT: user_options->outfile_format = hc_strtoul (optarg, NULL, 10);
user_options->outfile_format_chgd = true; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;
case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = hc_strtoul (optarg, NULL, 10); break;
case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break;
case IDX_HEX_CHARSET: user_options->hex_charset = true; break;
case IDX_HEX_SALT: user_options->hex_salt = true; break;
case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break;
case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break;
case IDX_OPENCL_INFO: user_options->opencl_info = true; break;
case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break;
case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break;
case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break;
case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = hc_strtoul (optarg, NULL, 10);
user_options->opencl_vector_width_chgd = true; break;
case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break;
case IDX_WORKLOAD_PROFILE: user_options->workload_profile = hc_strtoul (optarg, NULL, 10);
user_options->workload_profile_chgd = true; break;
case IDX_KERNEL_ACCEL: user_options->kernel_accel = hc_strtoul (optarg, NULL, 10);
user_options->kernel_accel_chgd = true; break;
case IDX_KERNEL_LOOPS: user_options->kernel_loops = hc_strtoul (optarg, NULL, 10);
user_options->kernel_loops_chgd = true; break;
case IDX_KERNEL_THREADS: user_options->kernel_threads = hc_strtoul (optarg, NULL, 10);
user_options->kernel_threads_chgd = true; break;
case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = hc_strtoul (optarg, NULL, 10);
user_options->nvidia_spin_damp_chgd = true; break;
case IDX_HWMON_DISABLE: user_options->hwmon_disable = true; break;
case IDX_HWMON_TEMP_ABORT: user_options->hwmon_temp_abort = hc_strtoul (optarg, NULL, 10); break;
case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break;
case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = hc_strtoul (optarg, NULL, 10);
user_options->hccapx_message_pair_chgd = true; break;
case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = hc_strtoul (optarg, NULL, 10);
user_options->nonce_error_corrections_chgd = true; break;
case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break;
case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break;
case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = hc_strtoul (optarg, NULL, 10); break;
case IDX_SEGMENT_SIZE: user_options->segment_size = hc_strtoul (optarg, NULL, 10);
user_options->segment_size_chgd = true; break;
case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = hc_strtoul (optarg, NULL, 10); break;
case IDX_SEPARATOR: user_options->separator = optarg[0]; break;
case IDX_BITMAP_MIN: user_options->bitmap_min = hc_strtoul (optarg, NULL, 10); break;
case IDX_BITMAP_MAX: user_options->bitmap_max = hc_strtoul (optarg, NULL, 10); break;
case IDX_INCREMENT: user_options->increment = true; break;
case IDX_INCREMENT_MIN: user_options->increment_min = hc_strtoul (optarg, NULL, 10);
user_options->increment_min_chgd = true; break;
case IDX_INCREMENT_MAX: user_options->increment_max = hc_strtoul (optarg, NULL, 10);
user_options->increment_max_chgd = true; break;
case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break;
case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break;
case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break;
case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break;
case IDX_SLOW_CANDIDATES: user_options->slow_candidates = true; break;
case IDX_HELP: user_options->usage = true; break;
case IDX_VERSION: user_options->version = true; break;
case IDX_RESTORE: user_options->restore = true; break;
case IDX_QUIET: user_options->quiet = true; break;
case IDX_SHOW: user_options->show = true; break;
case IDX_LEFT: user_options->left = true; break;
case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break;
case IDX_USERNAME: user_options->username = true; break;
case IDX_REMOVE: user_options->remove = true; break;
case IDX_REMOVE_TIMER: user_options->remove_timer = hc_strtoul (optarg, NULL, 10);
user_options->remove_timer_chgd = true; break;
case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break;
case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break;
case IDX_DEBUG_MODE: user_options->debug_mode = hc_strtoul (optarg, NULL, 10); break;
case IDX_DEBUG_FILE: user_options->debug_file = optarg; break;
case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break;
case IDX_ENCODING_TO: user_options->encoding_to = optarg; break;
case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break;
case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break;
case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break;
case IDX_FORCE: user_options->force = true; break;
case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break;
case IDX_SKIP: user_options->skip = hc_strtoull (optarg, NULL, 10);
user_options->skip_chgd = true; break;
case IDX_LIMIT: user_options->limit = hc_strtoull (optarg, NULL, 10);
user_options->limit_chgd = true; break;
case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break;
case IDX_KEYSPACE: user_options->keyspace = true; break;
case IDX_BENCHMARK: user_options->benchmark = true; break;
case IDX_BENCHMARK_ALL: user_options->benchmark_all = true; break;
case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break;
case IDX_STDIN_TIMEOUT_ABORT: user_options->stdin_timeout_abort = hc_strtoul (optarg, NULL, 10);
user_options->stdin_timeout_abort_chgd = true; break;
case IDX_SPEED_ONLY: user_options->speed_only = true; break;
case IDX_PROGRESS_ONLY: user_options->progress_only = true; break;
case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break;
case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break;
case IDX_STATUS: user_options->status = true; break;
case IDX_STATUS_TIMER: user_options->status_timer = hc_strtoul (optarg, NULL, 10); break;
case IDX_MACHINE_READABLE: user_options->machine_readable = true; break;
case IDX_LOOPBACK: user_options->loopback = true; break;
case IDX_SESSION: user_options->session = optarg; break;
case IDX_HASH_MODE: user_options->hash_mode = hc_strtoul (optarg, NULL, 10);
user_options->hash_mode_chgd = true; break;
case IDX_RUNTIME: user_options->runtime = hc_strtoul (optarg, NULL, 10);
user_options->runtime_chgd = true; break;
case IDX_ATTACK_MODE: user_options->attack_mode = hc_strtoul (optarg, NULL, 10);
user_options->attack_mode_chgd = true; break;
case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] = optarg; break;
case IDX_RP_GEN: user_options->rp_gen = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = hc_strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_SEED: user_options->rp_gen_seed = hc_strtoul (optarg, NULL, 10);
user_options->rp_gen_seed_chgd = true; break;
case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break;
case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break;
case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break;
case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break;
case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = hc_strtoul (optarg, NULL, 10); break;
case IDX_MARKOV_HCSTAT2: user_options->markov_hcstat2 = optarg; break;
case IDX_OUTFILE: user_options->outfile = optarg; break;
case IDX_OUTFILE_FORMAT: user_options->outfile_format = hc_strtoul (optarg, NULL, 10);
user_options->outfile_format_chgd = true; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;
case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = hc_strtoul (optarg, NULL, 10); break;
case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break;
case IDX_HEX_CHARSET: user_options->hex_charset = true; break;
case IDX_HEX_SALT: user_options->hex_salt = true; break;
case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break;
case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break;
case IDX_OPENCL_INFO: user_options->opencl_info = true; break;
case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break;
case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break;
case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break;
case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = hc_strtoul (optarg, NULL, 10);
user_options->opencl_vector_width_chgd = true; break;
case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break;
case IDX_WORKLOAD_PROFILE: user_options->workload_profile = hc_strtoul (optarg, NULL, 10);
user_options->workload_profile_chgd = true; break;
case IDX_KERNEL_ACCEL: user_options->kernel_accel = hc_strtoul (optarg, NULL, 10);
user_options->kernel_accel_chgd = true; break;
case IDX_KERNEL_LOOPS: user_options->kernel_loops = hc_strtoul (optarg, NULL, 10);
user_options->kernel_loops_chgd = true; break;
case IDX_KERNEL_THREADS: user_options->kernel_threads = hc_strtoul (optarg, NULL, 10);
user_options->kernel_threads_chgd = true; break;
case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = hc_strtoul (optarg, NULL, 10);
user_options->nvidia_spin_damp_chgd = true; break;
case IDX_HWMON_DISABLE: user_options->hwmon_disable = true; break;
case IDX_HWMON_TEMP_ABORT: user_options->hwmon_temp_abort = hc_strtoul (optarg, NULL, 10); break;
case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break;
case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = hc_strtoul (optarg, NULL, 10);
user_options->hccapx_message_pair_chgd = true; break;
case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = hc_strtoul (optarg, NULL, 10);
user_options->nonce_error_corrections_chgd = true; break;
case IDX_TRUECRYPT_KEYBOARD_LAYOUT: user_options->truecrypt_keyboard_layout = optarg; break;
case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break;
case IDX_VERACRYPT_KEYBOARD_LAYOUT: user_options->veracrypt_keyboard_layout = optarg; break;
case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break;
case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = hc_strtoul (optarg, NULL, 10); break;
case IDX_SEGMENT_SIZE: user_options->segment_size = hc_strtoul (optarg, NULL, 10);
user_options->segment_size_chgd = true; break;
case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = hc_strtoul (optarg, NULL, 10); break;
case IDX_SEPARATOR: user_options->separator = optarg[0]; break;
case IDX_BITMAP_MIN: user_options->bitmap_min = hc_strtoul (optarg, NULL, 10); break;
case IDX_BITMAP_MAX: user_options->bitmap_max = hc_strtoul (optarg, NULL, 10); break;
case IDX_INCREMENT: user_options->increment = true; break;
case IDX_INCREMENT_MIN: user_options->increment_min = hc_strtoul (optarg, NULL, 10);
user_options->increment_min_chgd = true; break;
case IDX_INCREMENT_MAX: user_options->increment_max = hc_strtoul (optarg, NULL, 10);
user_options->increment_max_chgd = true; break;
case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break;
case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break;
case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break;
case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break;
case IDX_SLOW_CANDIDATES: user_options->slow_candidates = true; break;
#ifdef WITH_BRAIN
case IDX_BRAIN_CLIENT: user_options->brain_client = true; break;
case IDX_BRAIN_CLIENT_FEATURES: user_options->brain_client_features = hc_strtoul (optarg, NULL, 10); break;
case IDX_BRAIN_SERVER: user_options->brain_server = true; break;
case IDX_BRAIN_PASSWORD: user_options->brain_password = optarg;
user_options->brain_password_chgd = true; break;
case IDX_BRAIN_HOST: user_options->brain_host = optarg;
user_options->brain_host_chgd = true; break;
case IDX_BRAIN_PORT: user_options->brain_port = hc_strtoul (optarg, NULL, 10);
user_options->brain_port_chgd = true; break;
case IDX_BRAIN_SESSION: user_options->brain_session = hc_strtoul (optarg, NULL, 16); break;
case IDX_BRAIN_SESSION_WHITELIST: user_options->brain_session_whitelist = optarg; break;
case IDX_BRAIN_CLIENT: user_options->brain_client = true; break;
case IDX_BRAIN_CLIENT_FEATURES: user_options->brain_client_features = hc_strtoul (optarg, NULL, 10); break;
case IDX_BRAIN_SERVER: user_options->brain_server = true; break;
case IDX_BRAIN_PASSWORD: user_options->brain_password = optarg;
user_options->brain_password_chgd = true; break;
case IDX_BRAIN_HOST: user_options->brain_host = optarg;
user_options->brain_host_chgd = true; break;
case IDX_BRAIN_PORT: user_options->brain_port = hc_strtoul (optarg, NULL, 10);
user_options->brain_port_chgd = true; break;
case IDX_BRAIN_SESSION: user_options->brain_session = hc_strtoul (optarg, NULL, 16); break;
case IDX_BRAIN_SESSION_WHITELIST: user_options->brain_session_whitelist = optarg; break;
#endif
}
}
@ -2549,6 +2555,46 @@ int user_options_check_files (hashcat_ctx_t *hashcat_ctx)
// debugfile check already done
// dictstat
if (user_options->truecrypt_keyboard_layout != NULL)
{
if (hc_path_exist (user_options->truecrypt_keyboard_layout) == true)
{
if (hc_path_read (user_options->truecrypt_keyboard_layout) == false)
{
event_log_error (hashcat_ctx, "%s: %s", user_options->truecrypt_keyboard_layout, strerror (errno));
return -1;
}
}
else
{
event_log_error (hashcat_ctx, "%s: %s", user_options->truecrypt_keyboard_layout, strerror (errno));
return -1;
}
}
if (user_options->veracrypt_keyboard_layout != NULL)
{
if (hc_path_exist (user_options->veracrypt_keyboard_layout) == true)
{
if (hc_path_read (user_options->veracrypt_keyboard_layout) == false)
{
event_log_error (hashcat_ctx, "%s: %s", user_options->veracrypt_keyboard_layout, strerror (errno));
return -1;
}
}
else
{
event_log_error (hashcat_ctx, "%s: %s", user_options->veracrypt_keyboard_layout, strerror (errno));
return -1;
}
}
return 0;
}
@ -2582,7 +2628,9 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_string (user_options->rule_buf_l);
logfile_top_string (user_options->rule_buf_r);
logfile_top_string (user_options->session);
logfile_top_string (user_options->truecrypt_keyboard_layout);
logfile_top_string (user_options->truecrypt_keyfiles);
logfile_top_string (user_options->veracrypt_keyboard_layout);
logfile_top_string (user_options->veracrypt_keyfiles);
#ifdef WITH_BRAIN
logfile_top_string (user_options->brain_host);

Loading…
Cancel
Save