Compare commits

...

13 Commits

@ -578,7 +578,7 @@ DECLSPEC bool b58enc (PRIVATE_AS u8 *b58, PRIVATE_AS u32 *b58sz, PRIVATE_AS cons
j = 0;
for (; j < (size && !buf[j]); j++) {}
for (; j < size && !buf[j]; j++) {}
if (*b58sz <= zcount + size - j)
{

@ -426,7 +426,7 @@ _hashcat ()
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H'
local SHORT_OPTS="-m -a -V -h -b -t -T -o -p -c -d -D -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O -S -z -M -Y"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-inverse --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-json --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --deprecated-check-disable --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 --hash-info --backend-ignore-cuda --backend-ignore-opencl --backend-ignore-hip --backend-ignore-metal --backend-info --backend-devices --backend-devices-virtual --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --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-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --multiply-accel-disable --self-test-disable --slow-candidates --brain-server --brain-server-timer --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password --identify"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-inverse --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-json --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --deprecated-check-disable --left --username --dynamic-x --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --hash-info --backend-ignore-cuda --backend-ignore-opencl --backend-ignore-hip --backend-ignore-metal --backend-info --backend-devices --backend-devices-virtual --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --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-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --multiply-accel-disable --self-test-disable --slow-candidates --brain-server --brain-server-timer --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password --identify"
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 --stdin-timeout-abort --markov-hcstat2 --markov-threshold --runtime --session --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 --backend-devices --backend-devices-virtual --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --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-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment-min --increment-max --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-server-timer --brain-client-features --brain-host --brain-password --brain-port --brain-session --brain-session-whitelist"
COMPREPLY=()

@ -104,6 +104,8 @@ int generic_salt_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, const u8
int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token);
int extract_dynamicx_hash (const u8 *input_buf, const int input_len, u8 **output_buf, int *output_len);
#if defined (__APPLE__)
bool is_apple_silicon (void);
#endif

@ -638,6 +638,7 @@ typedef enum user_options_defaults
#endif
DEBUG_MODE = 0,
DEPRECATED_CHECK = true,
DYNAMIC_X = false,
FORCE = false,
HWMON = true,
#if defined (__APPLE__)
@ -757,6 +758,7 @@ typedef enum user_options_map
IDX_DEBUG_FILE = 0xff12,
IDX_DEBUG_MODE = 0xff13,
IDX_DEPRECATED_CHECK_DISABLE = 0xff14,
IDX_DYNAMIC_X = 0xff55,
IDX_ENCODING_FROM = 0xff15,
IDX_ENCODING_TO = 0xff16,
IDX_HASH_INFO = 0xff17,
@ -2332,6 +2334,7 @@ typedef struct user_options
#endif
bool force;
bool deprecated_check;
bool dynamic_x;
bool hwmon;
bool hash_info;
bool hex_charset;

@ -28,15 +28,13 @@ static void hlfmt_hash_hashcat (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *l
const user_options_t *user_options = hashcat_ctx->user_options;
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
if (user_options->username == 0)
{
*hashbuf_pos = line_buf;
*hashbuf_len = line_len;
}
else
*hashbuf_pos = line_buf;
*hashbuf_len = line_len;
if (user_options->username == true)
{
char *pos = line_buf;
size_t len = line_len;
char *pos = *hashbuf_pos;
size_t len = *hashbuf_len;
for (int i = 0; i < line_len; i++, pos++, len--)
{
@ -53,6 +51,18 @@ static void hlfmt_hash_hashcat (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *l
*hashbuf_pos = pos;
*hashbuf_len = len;
}
if (user_options->dynamic_x == true)
{
char *pos = NULL;
int len = 0;
if (extract_dynamicx_hash ((const u8 *) line_buf, line_len, (u8 **) &pos, &len) != -1)
{
*hashbuf_pos = pos;
*hashbuf_len = len;
}
}
}
static void hlfmt_user_hashcat (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *line_buf, const int line_len, char **userbuf_pos, int *userbuf_len)

@ -1483,3 +1483,20 @@ char *file_to_buffer (const char *filename)
return NULL;
}
int extract_dynamicx_hash (const u8 *input_buf, const int input_len, u8 **output_buf, int *output_len)
{
int hash_mode = -1;
if (sscanf ((char *) input_buf, "$dynamic_%d$", &hash_mode) != 1) return -1;
*output_buf = (u8 *) index ((char *) input_buf + 10, '$');
if (*output_buf == NULL) return -1;
*output_buf += 1; // the $ itself
*output_len = input_len - (*output_buf - input_buf);
return hash_mode;
}

@ -66,6 +66,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
" --show | | Compare hashlist with potfile; show cracked hashes |",
" --left | | Compare hashlist with potfile; show uncracked hashes |",
" --username | | Enable ignoring of usernames in hashfile |",
" --dynamic-x | | Ignore $dynamic_X$ prefix in hashes |",
" --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 |",

@ -54,6 +54,7 @@ static const struct option long_options[] =
{"debug-file", required_argument, NULL, IDX_DEBUG_FILE},
{"debug-mode", required_argument, NULL, IDX_DEBUG_MODE},
{"deprecated-check-disable", no_argument, NULL, IDX_DEPRECATED_CHECK_DISABLE},
{"dynamic-x", no_argument, NULL, IDX_DYNAMIC_X},
{"encoding-from", required_argument, NULL, IDX_ENCODING_FROM},
{"encoding-to", required_argument, NULL, IDX_ENCODING_TO},
{"example-hashes", no_argument, NULL, IDX_HASH_INFO}, // alias of hash-info
@ -205,6 +206,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->debug_file = NULL;
user_options->debug_mode = DEBUG_MODE;
user_options->deprecated_check = DEPRECATED_CHECK;
user_options->dynamic_x = DYNAMIC_X;
user_options->encoding_from = ENCODING_FROM;
user_options->encoding_to = ENCODING_TO;
user_options->force = FORCE;
@ -401,6 +403,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_LEFT: user_options->left = true; break;
case IDX_ADVICE_DISABLE: user_options->advice = false; break;
case IDX_USERNAME: user_options->username = true; break;
case IDX_DYNAMIC_X: user_options->dynamic_x = 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;
@ -3228,6 +3231,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint (user_options->bitmap_max);
logfile_top_uint (user_options->bitmap_min);
logfile_top_uint (user_options->debug_mode);
logfile_top_uint (user_options->dynamic_x);
logfile_top_uint (user_options->hash_info);
logfile_top_uint (user_options->force);
logfile_top_uint (user_options->hwmon);

Loading…
Cancel
Save