Prepare to use --keyboard-layout-mapping for algorithms other than TC/VC

This commit is contained in:
Jens Steube
2018-11-25 18:21:07 +01:00
parent ee2854ec2a
commit fca4f7e8a6
27 changed files with 479 additions and 505 deletions
+11 -19
View File
@@ -130,12 +130,12 @@ int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3)
return sort_by_digest_p0p1 (d1, d2, v3);
}
int find_map (const u32 search, const int search_len, kb_layout_map_t *s_kb_layout_map, const int kb_layout_map_cnt)
int find_keyboard_layout_map (const u32 search, const int search_len, keyboard_layout_mapping_t *s_keyboard_layout_mapping, const int keyboard_layout_mapping_cnt)
{
for (int idx = 0; idx < kb_layout_map_cnt; idx++)
for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++)
{
const u32 src_char = s_kb_layout_map[idx].src_char;
const int src_len = s_kb_layout_map[idx].src_len;
const u32 src_char = s_keyboard_layout_mapping[idx].src_char;
const int src_len = s_keyboard_layout_mapping[idx].src_len;
if (src_len == search_len)
{
@@ -148,7 +148,7 @@ int find_map (const u32 search, const int search_len, kb_layout_map_t *s_kb_layo
return -1;
}
int keyboard_map (u32 plain_buf[64], const int plain_len, kb_layout_map_t *s_kb_layout_map, const int kb_layout_map_cnt)
int execute_keyboard_layout_mapping (u32 plain_buf[64], const int plain_len, keyboard_layout_mapping_t *s_keyboard_layout_mapping, const int keyboard_layout_mapping_cnt)
{
u32 out_buf[16] = { 0 };
@@ -187,12 +187,12 @@ int keyboard_map (u32 plain_buf[64], const int plain_len, kb_layout_map_t *s_kb_
for (src_len = rem; src_len > 0; src_len--)
{
const int idx = find_map (src, src_len, s_kb_layout_map, kb_layout_map_cnt);
const int idx = find_keyboard_layout_map (src, src_len, s_keyboard_layout_mapping, keyboard_layout_mapping_cnt);
if (idx == -1) continue;
u32 dst_char = s_kb_layout_map[idx].dst_char;
int dst_len = s_kb_layout_map[idx].dst_len;
u32 dst_char = s_keyboard_layout_mapping[idx].dst_char;
int dst_len = s_keyboard_layout_mapping[idx].dst_len;
switch (dst_len)
{
@@ -425,22 +425,14 @@ 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));
}
// truecrypt and veracrypt boot only:
// 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))
if (hashconfig->opts_type & OPTS_TYPE_KEYBOARD_MAPPING)
{
tc_t *tc = (tc_t *) hashes->esalts_buf;
plain_len = keyboard_map (plain_buf, plain_len, tc->kb_layout_map, tc->kb_layout_map_cnt);
plain_len = execute_keyboard_layout_mapping (plain_buf, plain_len, tc->keyboard_layout_mapping_buf, tc->keyboard_layout_mapping_cnt);
}
// crackpos
+43 -37
View File
@@ -2630,13 +2630,13 @@ static int input_tokenizer (u8 *input_buf, int input_len, token_t *token)
static int sort_by_src_len (const void *p1, const void *p2)
{
const kb_layout_map_t *k1 = (const kb_layout_map_t *) p1;
const kb_layout_map_t *k2 = (const kb_layout_map_t *) p2;
const keyboard_layout_mapping_t *k1 = (const keyboard_layout_mapping_t *) p1;
const keyboard_layout_mapping_t *k2 = (const keyboard_layout_mapping_t *) p2;
return k1->src_len < k2->src_len;
}
static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *filename, kb_layout_map_t *kb_layout_map, int *kb_layout_map_cnt)
static bool initialize_keyboard_layout_mapping (hashcat_ctx_t *hashcat_ctx, const char *filename, keyboard_layout_mapping_t *keyboard_layout_mapping, int *keyboard_layout_mapping_cnt)
{
char *line_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
@@ -2663,12 +2663,12 @@ static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *
token.len_min[0] = 1;
token.len_max[0] = 4;
token.sep[0] = '=';
token.sep[0] = 0x09;
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH;
token.len_min[1] = 0;
token.len_max[1] = 4;
token.sep[1] = '=';
token.sep[1] = 0x09;
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH;
const int rc_tokenizer = input_tokenizer ((u8 *) line_buf, line_len, &token);
@@ -2684,11 +2684,11 @@ static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *
return false;
}
memcpy (&kb_layout_map[maps_cnt].src_char, token.buf[0], token.len[0]);
memcpy (&kb_layout_map[maps_cnt].dst_char, token.buf[1], token.len[1]);
memcpy (&keyboard_layout_mapping[maps_cnt].src_char, token.buf[0], token.len[0]);
memcpy (&keyboard_layout_mapping[maps_cnt].dst_char, token.buf[1], token.len[1]);
kb_layout_map[maps_cnt].src_len = token.len[0];
kb_layout_map[maps_cnt].dst_len = token.len[1];
keyboard_layout_mapping[maps_cnt].src_len = token.len[0];
keyboard_layout_mapping[maps_cnt].dst_len = token.len[1];
if (maps_cnt == 256)
{
@@ -2704,7 +2704,7 @@ static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *
maps_cnt++;
}
*kb_layout_map_cnt = maps_cnt;
*keyboard_layout_mapping_cnt = maps_cnt;
fclose (fp);
@@ -2712,7 +2712,7 @@ static bool initialize_keyboard_layout (hashcat_ctx_t *hashcat_ctx, const char *
// we need to sort this by length to ensure the largest blocks come first in mapping
qsort (kb_layout_map, maps_cnt, sizeof (kb_layout_map_t), sort_by_src_len);
qsort (keyboard_layout_mapping, maps_cnt, sizeof (keyboard_layout_mapping_t), sort_by_src_len);
return true;
}
@@ -25618,7 +25618,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS512;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = truecrypt_parse_hash_1k;
@@ -25636,7 +25637,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS1024;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = truecrypt_parse_hash_1k;
@@ -25654,7 +25656,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS1536;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = truecrypt_parse_hash_1k;
@@ -27409,7 +27412,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS512;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = veracrypt_parse_hash_327661;
@@ -27427,7 +27431,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS1024;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = veracrypt_parse_hash_327661;
@@ -27445,7 +27450,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_TCRIPEMD160_XTS1536;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = veracrypt_parse_hash_327661;
@@ -27517,7 +27523,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_VCSHA256_XTS512;
hashconfig->dgst_size = DGST_SIZE_4_8;
hashconfig->parse_func = veracrypt_parse_hash_200000;
@@ -27535,7 +27542,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_VCSHA256_XTS1024;
hashconfig->dgst_size = DGST_SIZE_4_8;
hashconfig->parse_func = veracrypt_parse_hash_200000;
@@ -27553,7 +27561,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_BINARY_HASHFILE;
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_KEYBOARD_MAPPING;
hashconfig->kern_type = KERN_TYPE_VCSHA256_XTS1536;
hashconfig->dgst_size = DGST_SIZE_4_8;
hashconfig->parse_func = veracrypt_parse_hash_200000;
@@ -28391,6 +28400,16 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
default: return -1;
}
if (user_options->keyboard_layout_mapping)
{
if ((hashconfig->opts_type & OPTS_TYPE_KEYBOARD_MAPPING) == 0)
{
event_log_error (hashcat_ctx, "Parameter --keyboard-layout-mapping not valid for hash-type %u", hashconfig->hash_mode);
return -1;
}
}
if (user_options->hex_salt)
{
if (hashconfig->salt_type == SALT_TYPE_GENERIC)
@@ -28399,7 +28418,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
}
else
{
event_log_error (hashcat_ctx, "Parameter hex-salt not valid for hash-type %u", hashconfig->hash_mode);
event_log_error (hashcat_ctx, "Parameter --hex-salt not valid for hash-type %u", hashconfig->hash_mode);
return -1;
}
@@ -29288,24 +29307,11 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx)
}
// 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))
if (hashconfig->opts_type & OPTS_TYPE_KEYBOARD_MAPPING)
{
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;
if (optional_param2)
if (user_options->keyboard_layout_mapping)
{
const bool rc = initialize_keyboard_layout (hashcat_ctx, optional_param2, tc->kb_layout_map, &tc->kb_layout_map_cnt);
const bool rc = initialize_keyboard_layout_mapping (hashcat_ctx, user_options->keyboard_layout_mapping, tc->keyboard_layout_mapping_buf, &tc->keyboard_layout_mapping_cnt);
if (rc == false) return -1;
}
+103 -104
View File
@@ -24,111 +24,110 @@ 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-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",
" --spin-damp | Num | Use CPU for device synchronization, in percent | --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",
" --keyboard-layout-mapping | File | Keyboard layout mapping table for special hash-modes | --keyb=german.hckmap",
" --truecrypt-keyfiles | File | Keyfiles to use, separated with commas | --truecrypt-keyf=x.png",
" --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",
" --spin-damp | Num | Use CPU for device synchronization, in percent | --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 ] -",
+9 -32
View File
@@ -63,6 +63,7 @@ static const struct option long_options[] =
{"kernel-accel", required_argument, NULL, IDX_KERNEL_ACCEL},
{"kernel-loops", required_argument, NULL, IDX_KERNEL_LOOPS},
{"kernel-threads", required_argument, NULL, IDX_KERNEL_THREADS},
{"keyboard-layout", required_argument, NULL, IDX_KEYBOARD_LAYOUT_MAPPING},
{"keyspace", no_argument, NULL, IDX_KEYSPACE},
{"left", no_argument, NULL, IDX_LEFT},
{"limit", required_argument, NULL, IDX_LIMIT},
@@ -113,10 +114,8 @@ 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},
@@ -190,6 +189,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->kernel_accel = KERNEL_ACCEL;
user_options->kernel_loops = KERNEL_LOOPS;
user_options->kernel_threads = KERNEL_THREADS;
user_options->keyboard_layout_mapping = NULL;
user_options->keyspace = KEYSPACE;
user_options->left = LEFT;
user_options->limit = LIMIT;
@@ -243,11 +243,9 @@ 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;
@@ -445,9 +443,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
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_KEYBOARD_LAYOUT_MAPPING: user_options->keyboard_layout_mapping = 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);
@@ -2557,39 +2554,20 @@ int user_options_check_files (hashcat_ctx_t *hashcat_ctx)
// dictstat
if (user_options->truecrypt_keyboard_layout != NULL)
if (user_options->keyboard_layout_mapping != NULL)
{
if (hc_path_exist (user_options->truecrypt_keyboard_layout) == true)
if (hc_path_exist (user_options->keyboard_layout_mapping) == true)
{
if (hc_path_read (user_options->truecrypt_keyboard_layout) == false)
if (hc_path_read (user_options->keyboard_layout_mapping) == false)
{
event_log_error (hashcat_ctx, "%s: %s", user_options->truecrypt_keyboard_layout, strerror (errno));
event_log_error (hashcat_ctx, "%s: %s", user_options->keyboard_layout_mapping, 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));
event_log_error (hashcat_ctx, "%s: %s", user_options->keyboard_layout_mapping, strerror (errno));
return -1;
}
@@ -2616,6 +2594,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_string (user_options->encoding_from);
logfile_top_string (user_options->encoding_to);
logfile_top_string (user_options->induction_dir);
logfile_top_string (user_options->keyboard_layout_mapping);
logfile_top_string (user_options->markov_hcstat2);
logfile_top_string (user_options->opencl_devices);
logfile_top_string (user_options->opencl_device_types);
@@ -2628,9 +2607,7 @@ 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);