mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-21 14:08:21 +00:00
assigned -H to --hash-info
This commit is contained in:
parent
71147249d5
commit
55f53ba076
@ -130,6 +130,8 @@
|
||||
- Metal Backend: allow use of devices with Metal if runtime version is >= 200
|
||||
- Metal Backend: disable Metal devices only if at least one OpenCL device is active
|
||||
- User Options: added --metal-compiler-runtime option
|
||||
- User Options: assigned -H to --hash-info
|
||||
- Hash-Info: show more details using -HH
|
||||
- Hardware Monitor: avoid sprintf in src/ext_iokit.c
|
||||
- Help: show supported hash-modes only with -hh
|
||||
- Makefile: prevent make failure with Apple Silicon in case of partial rebuild
|
||||
|
@ -425,7 +425,7 @@ _hashcat ()
|
||||
local HIDDEN_FILES_AGGRESSIVE="${HIDDEN_FILES}|hcmask|hcchr"
|
||||
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 SHORT_OPTS="-m -a -V -h -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 --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"
|
||||
|
||||
@ -729,11 +729,11 @@ _hashcat ()
|
||||
|
||||
while [ ${h} -le ${COMP_CWORD} ]; do
|
||||
|
||||
if [[ "${COMP_WORDS[h]}" == "-a" ]]; then
|
||||
if [[ "${COMP_WORDS[h]}" == "-a" ]]; then
|
||||
|
||||
attack_mode=${COMP_WORDS[$((h + 1))]}
|
||||
|
||||
elif [[ "${COMP_WORDS[h]}" == -a* ]]; then
|
||||
elif [[ "${COMP_WORDS[h]}" == -a* ]]; then
|
||||
|
||||
attack_mode=${COMP_WORDS[h]:2}
|
||||
|
||||
|
@ -646,7 +646,7 @@ typedef enum user_options_defaults
|
||||
#else
|
||||
HWMON_TEMP_ABORT = 90,
|
||||
#endif
|
||||
HASH_INFO = false,
|
||||
HASH_INFO = 0,
|
||||
HASH_MODE = 0,
|
||||
HCCAPX_MESSAGE_PAIR = 0,
|
||||
HEX_CHARSET = false,
|
||||
@ -761,7 +761,7 @@ typedef enum user_options_map
|
||||
IDX_DYNAMIC_X = 0xff55,
|
||||
IDX_ENCODING_FROM = 0xff15,
|
||||
IDX_ENCODING_TO = 0xff16,
|
||||
IDX_HASH_INFO = 0xff17,
|
||||
IDX_HASH_INFO = 'H', // 0xff17
|
||||
IDX_FORCE = 0xff18,
|
||||
IDX_HWMON_DISABLE = 0xff19,
|
||||
IDX_HWMON_TEMP_ABORT = 0xff1a,
|
||||
@ -2344,7 +2344,6 @@ typedef struct user_options
|
||||
bool deprecated_check;
|
||||
bool dynamic_x;
|
||||
bool hwmon;
|
||||
bool hash_info;
|
||||
bool hex_charset;
|
||||
bool hex_salt;
|
||||
bool hex_wordlist;
|
||||
@ -2429,6 +2428,7 @@ typedef struct user_options
|
||||
#endif
|
||||
u32 debug_mode;
|
||||
u32 hwmon_temp_abort;
|
||||
u32 hash_info;
|
||||
int hash_mode;
|
||||
u32 hccapx_message_pair;
|
||||
u32 hook_threads;
|
||||
|
@ -4258,8 +4258,8 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
backend_ctx->enabled = false;
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -81,8 +81,8 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -21,8 +21,8 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
@ -17,8 +17,8 @@ int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -118,9 +118,9 @@ int debugfile_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -58,9 +58,9 @@ int dictstat_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -1228,8 +1228,8 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -41,9 +41,9 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
@ -355,7 +355,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
hashconfig->has_optimized_kernel = hc_path_read (source_file);
|
||||
|
||||
if (user_options->hash_info == false)
|
||||
if (user_options->hash_info == 0 || user_options->hash_info > 1)
|
||||
{
|
||||
if (user_options->optimized_kernel == true)
|
||||
{
|
||||
|
@ -62,9 +62,9 @@ int loopback_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->usage > 0) return 0;
|
||||
if (user_options->backend_info > 0) return 0;
|
||||
if (user_options->hash_info > 0) return 0;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->hash_info == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
|
12
src/main.c
12
src/main.c
@ -192,12 +192,13 @@ static void main_outerloop_starting (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA
|
||||
|
||||
status_ctx->shutdown_outer = false;
|
||||
|
||||
if (user_options->hash_info == true) return;
|
||||
if (user_options->backend_info > 0) return;
|
||||
if (user_options->hash_info > 0) return;
|
||||
|
||||
if (user_options->keyspace == true) return;
|
||||
if (user_options->stdout_flag == true) return;
|
||||
if (user_options->speed_only == true) return;
|
||||
if (user_options->identify == true) return;
|
||||
if (user_options->backend_info > 0) return;
|
||||
|
||||
if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK))
|
||||
{
|
||||
@ -269,10 +270,11 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||
|
||||
if (user_options->hash_info == true) return;
|
||||
if (user_options->backend_info > 0) return;
|
||||
if (user_options->hash_info > 0) return;
|
||||
|
||||
if (user_options->keyspace == true) return;
|
||||
if (user_options->stdout_flag == true) return;
|
||||
if (user_options->backend_info > 0) return;
|
||||
|
||||
// if we had a prompt, clear it
|
||||
|
||||
@ -1328,7 +1330,7 @@ int main (int argc, char **argv)
|
||||
|
||||
rc_final = 0;
|
||||
}
|
||||
else if (user_options->hash_info == true)
|
||||
else if (user_options->hash_info > 0)
|
||||
{
|
||||
hash_info (hashcat_ctx);
|
||||
|
||||
|
224
src/terminal.c
224
src/terminal.c
@ -87,7 +87,7 @@ void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
|
||||
event_log_info (hashcat_ctx, "%s (%s) starting in autodetect mode", PROGNAME, version_tag);
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
else if (user_options->hash_info == true)
|
||||
else if (user_options->hash_info > 0)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "%s (%s) starting in hash-info mode", PROGNAME, version_tag);
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
@ -634,7 +634,7 @@ void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginn
|
||||
*ptr1 = 0;
|
||||
}
|
||||
|
||||
void json_encode (char *text, char *escaped)
|
||||
void json_encode (const char *text, char *escaped)
|
||||
{
|
||||
/*
|
||||
* Based on https://www.freeformatter.com/json-escape.html, below these 7 different chars
|
||||
@ -667,6 +667,8 @@ void json_encode (char *text, char *escaped)
|
||||
|
||||
void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
if (hashconfig_init (hashcat_ctx) == 0)
|
||||
{
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
@ -677,25 +679,70 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
printf ("\"category\": \"%s\", ", strhashcategory (hashconfig->hash_category));
|
||||
printf ("\"slow_hash\": %s, ", (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) ? "false" : "true");
|
||||
|
||||
printf ("\"password_len_min\": %u, ", hashconfig->pw_min);
|
||||
printf ("\"password_len_max\": %u, ", hashconfig->pw_max);
|
||||
|
||||
printf ("\"is_deprecated\": %s, ", (module_ctx->module_deprecated_notice != MODULE_DEFAULT) ? "true" : "false");
|
||||
|
||||
if (module_ctx->module_deprecated_notice != MODULE_DEFAULT) {
|
||||
const char *deprecated_notice = module_ctx->module_deprecated_notice (hashconfig, hashcat_ctx->user_options, user_options_extra);
|
||||
printf ("\"deprecated_notice\": \"%s\", ", deprecated_notice);
|
||||
if (module_ctx->module_deprecated_notice != MODULE_DEFAULT)
|
||||
{
|
||||
const char *t_deprecated_notice = module_ctx->module_deprecated_notice (hashconfig, hashcat_ctx->user_options, user_options_extra);
|
||||
|
||||
char *t_deprecated_notice_json_encoded = (char *) hcmalloc (strlen (t_deprecated_notice) * 2);
|
||||
|
||||
json_encode (t_deprecated_notice, t_deprecated_notice_json_encoded);
|
||||
|
||||
printf ("\"deprecated_notice\": \"%s\", ", t_deprecated_notice_json_encoded);
|
||||
|
||||
hcfree (t_deprecated_notice_json_encoded);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\"deprecated_notice\": \"%s\", ", "N/A");
|
||||
}
|
||||
|
||||
const char *t_pw_desc = (hashconfig->opts_type & OPTS_TYPE_PT_HEX) ? "HEX" : "plain";
|
||||
|
||||
u32 t_pw_min = hashconfig->pw_min;
|
||||
u32 t_pw_max = hashconfig->pw_max;
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_HEX)
|
||||
{
|
||||
t_pw_min *= 2;
|
||||
t_pw_max *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\"password_type\": %s, ", t_pw_desc);
|
||||
printf ("\"password_len_min\": %u, ", t_pw_min);
|
||||
printf ("\"password_len_max\": %u, ", t_pw_max);
|
||||
|
||||
printf ("\"is_salted\": %s, ", (hashconfig->is_salted == true) ? "true" : "false");
|
||||
|
||||
if (hashconfig->is_salted == true)
|
||||
{
|
||||
u32 t = hashconfig->salt_type;
|
||||
const char *t_desc = (t == SALT_TYPE_EMBEDDED) ? "embedded" : (t == SALT_TYPE_GENERIC) ? "generic" : "virtual";
|
||||
printf ("\"salt_type\": \"%s\", ", t_desc);
|
||||
printf ("\"salt_len_min\": %u, ", hashconfig->salt_min);
|
||||
printf ("\"salt_len_max\": %u, ", hashconfig->salt_max);
|
||||
|
||||
const char *t_salt_desc = (t == SALT_TYPE_EMBEDDED) ? "embedded" : (t == SALT_TYPE_GENERIC) ? "generic" : "virtual";
|
||||
|
||||
printf ("\"salt_type\": \"%s\", ", t_salt_desc);
|
||||
|
||||
if (hashconfig->salt_type == SALT_TYPE_GENERIC || hashconfig->salt_type == SALT_TYPE_EMBEDDED)
|
||||
{
|
||||
u32 t_salt_min = hashconfig->salt_min;
|
||||
u32 t_salt_max = hashconfig->salt_max;
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_ST_HEX)
|
||||
{
|
||||
t_salt_min *= 2;
|
||||
t_salt_max *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\"salt_len_min\": %u, ", t_salt_min);
|
||||
printf ("\"salt_len_max\": %u, ", t_salt_max);
|
||||
}
|
||||
}
|
||||
|
||||
if ((hashconfig->has_pure_kernel) && (hashconfig->has_optimized_kernel))
|
||||
@ -711,6 +758,39 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
printf ("\"kernel_type\": %s, ", "[ \"optimized\" ]");
|
||||
}
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
printf ("\"kernel_type_filter\": %s, ", "[ \"optimized\" ]");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\"kernel_type_filter\": %s, ", "[ \"pure\" ]");
|
||||
}
|
||||
|
||||
printf ("\"attack_mode_filter\": %d, ", user_options->attack_mode);
|
||||
|
||||
// almost always 1 and -1
|
||||
printf ("\"hashes_count_min\": %d, ", hashconfig->hashes_count_min);
|
||||
printf ("\"hashes_count_max\": %d, ", hashconfig->hashes_count_max);
|
||||
|
||||
if (hashconfig->salt_type == SALT_TYPE_GENERIC || hashconfig->salt_type == SALT_TYPE_EMBEDDED)
|
||||
{
|
||||
bool multi_hash_same_salt = true;
|
||||
|
||||
if ((hashconfig->opts_type & OPTS_TYPE_DEEP_COMP_KERNEL) == 0)
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_OUTSIDE_KERNEL)
|
||||
{
|
||||
multi_hash_same_salt = false;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\"hashes_with_same_salt\": %s, ", (multi_hash_same_salt == true) ? "true" : "false");
|
||||
}
|
||||
}
|
||||
|
||||
if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
|
||||
@ -731,7 +811,7 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
|
||||
char *example_hash_json_encoded = (char *) hcmalloc (strlen (hashconfig->st_hash) * 2);
|
||||
|
||||
json_encode ((char *)hashconfig->st_hash, example_hash_json_encoded);
|
||||
json_encode (hashconfig->st_hash, example_hash_json_encoded);
|
||||
|
||||
printf ("\"example_hash\": \"%s\", ", example_hash_json_encoded);
|
||||
|
||||
@ -807,6 +887,7 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
printf ("\"autodetect_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_AUTODETECT_DISABLE) ? "false" : "true");
|
||||
printf ("\"self_test_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_SELF_TEST_DISABLE) ? "false" : "true");
|
||||
printf ("\"potfile_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_POTFILE_NOPASS) ? "false" : "true");
|
||||
printf ("\"keep_guessing\": %s, ", (hashconfig->opts_type & OPTS_TYPE_SUGGEST_KG) ? "true" : "false");
|
||||
printf ("\"custom_plugin\": %s, ", (hashconfig->opts_type & OPTS_TYPE_STOCK_MODULE) ? "false" : "true");
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII)
|
||||
@ -821,8 +902,6 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
{
|
||||
printf ("\"plaintext_encoding\": %s", "[ \"ASCII\", \"HEX\" ]");
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
|
||||
printf (" }");
|
||||
@ -832,30 +911,73 @@ void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *us
|
||||
|
||||
void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
if (hashconfig_init (hashcat_ctx) == 0)
|
||||
{
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
module_ctx_t *module_ctx = hashcat_ctx->module_ctx;
|
||||
|
||||
event_log_info (hashcat_ctx, "Hash mode #%u", hashconfig->hash_mode);
|
||||
event_log_info (hashcat_ctx, " Name................: %s", hashconfig->hash_name);
|
||||
event_log_info (hashcat_ctx, " Category............: %s", strhashcategory (hashconfig->hash_category));
|
||||
event_log_info (hashcat_ctx, " Slow.Hash...........: %s", (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) ? "No" : "Yes");
|
||||
|
||||
event_log_info (hashcat_ctx, " Password.Len.Min....: %u", hashconfig->pw_min);
|
||||
event_log_info (hashcat_ctx, " Password.Len.Max....: %u", hashconfig->pw_max);
|
||||
event_log_info (hashcat_ctx, " Deprecated..........: %s", (module_ctx->module_deprecated_notice != MODULE_DEFAULT) ? "Yes" : "No");
|
||||
|
||||
char *t_deprecated_notice = "N/A\0";
|
||||
|
||||
if (module_ctx->module_deprecated_notice != MODULE_DEFAULT)
|
||||
{
|
||||
t_deprecated_notice = (char *) module_ctx->module_deprecated_notice (hashconfig, hashcat_ctx->user_options, user_options_extra);
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Deprecated.Notice...: %s", t_deprecated_notice);
|
||||
|
||||
const char *t_pw_desc = (hashconfig->opts_type & OPTS_TYPE_PT_HEX) ? "HEX\0" : "plain\0";
|
||||
|
||||
u32 t_pw_min = hashconfig->pw_min;
|
||||
u32 t_pw_max = hashconfig->pw_max;
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_HEX)
|
||||
{
|
||||
t_pw_min *= 2;
|
||||
t_pw_max *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Password.Type.......: %s", t_pw_desc);
|
||||
event_log_info (hashcat_ctx, " Password.Len.Min....: %u", t_pw_min);
|
||||
event_log_info (hashcat_ctx, " Password.Len.Max....: %u", t_pw_max);
|
||||
|
||||
if (hashconfig->is_salted == true)
|
||||
{
|
||||
u32 t = hashconfig->salt_type;
|
||||
const char *t_desc = (t == SALT_TYPE_EMBEDDED) ? "Embedded\0" : (t == SALT_TYPE_GENERIC) ? "Generic\0" : "Virtual\0";
|
||||
event_log_info (hashcat_ctx, " Salt.Type...........: %s", t_desc);
|
||||
event_log_info (hashcat_ctx, " Salt.Len.Min........: %u", hashconfig->salt_min);
|
||||
event_log_info (hashcat_ctx, " Salt.Len.Max........: %u", hashconfig->salt_max);
|
||||
}
|
||||
|
||||
// almost always 1 and -1
|
||||
//event_log_info (hashcat_ctx, " Hashes.Count.Min....: %d", hashconfig->hashes_count_min);
|
||||
//event_log_info (hashcat_ctx, " Hashes.Count.Max....: %u", hashconfig->hashes_count_max);
|
||||
const char *t_salt_desc = (t == SALT_TYPE_EMBEDDED) ? "Embedded\0" : (t == SALT_TYPE_GENERIC) ? "Generic\0" : "Virtual\0";
|
||||
|
||||
event_log_info (hashcat_ctx, " Salt.Type...........: %s", t_salt_desc);
|
||||
|
||||
if (hashconfig->salt_type == SALT_TYPE_GENERIC || hashconfig->salt_type == SALT_TYPE_EMBEDDED)
|
||||
{
|
||||
u32 t_salt_min = hashconfig->salt_min;
|
||||
u32 t_salt_max = hashconfig->salt_max;
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_ST_HEX)
|
||||
{
|
||||
t_salt_min *= 2;
|
||||
t_salt_max *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Salt.Len.Min........: %u", t_salt_min);
|
||||
event_log_info (hashcat_ctx, " Salt.Len.Max........: %u", t_salt_max);
|
||||
}
|
||||
}
|
||||
|
||||
if ((hashconfig->has_pure_kernel) && (hashconfig->has_optimized_kernel))
|
||||
{
|
||||
@ -870,6 +992,39 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op
|
||||
event_log_info (hashcat_ctx, " Kernel.Type(s)......: optimized");
|
||||
}
|
||||
|
||||
if (user_options->hash_info > 1)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
event_log_info (hashcat_ctx, " Kernel.Type.Filter..: optimized");
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info (hashcat_ctx, " Kernel.Type.Filter..: pure");
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Attack.Mode.Filter..: %u", user_options->attack_mode);
|
||||
|
||||
// almost always 1 and -1
|
||||
event_log_info (hashcat_ctx, " Hashes.Count.Min....: %d", hashconfig->hashes_count_min);
|
||||
event_log_info (hashcat_ctx, " Hashes.Count.Max....: %d", hashconfig->hashes_count_max);
|
||||
|
||||
if (hashconfig->salt_type == SALT_TYPE_GENERIC || hashconfig->salt_type == SALT_TYPE_EMBEDDED)
|
||||
{
|
||||
bool multi_hash_same_salt = true;
|
||||
|
||||
if ((hashconfig->opts_type & OPTS_TYPE_DEEP_COMP_KERNEL) == 0)
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_OUTSIDE_KERNEL)
|
||||
{
|
||||
multi_hash_same_salt = false;
|
||||
}
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Hashes.w/.Same.Salt.: %s", (multi_hash_same_salt == true) ? "Allowed" : "Not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
|
||||
{
|
||||
if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
|
||||
@ -973,6 +1128,7 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op
|
||||
event_log_info (hashcat_ctx, " Autodetect.Enabled..: %s", (hashconfig->opts_type & OPTS_TYPE_AUTODETECT_DISABLE) ? "No" : "Yes");
|
||||
event_log_info (hashcat_ctx, " Self.Test.Enabled...: %s", (hashconfig->opts_type & OPTS_TYPE_SELF_TEST_DISABLE) ? "No" : "Yes");
|
||||
event_log_info (hashcat_ctx, " Potfile.Enabled.....: %s", (hashconfig->opts_type & OPTS_TYPE_POTFILE_NOPASS) ? "No" : "Yes");
|
||||
event_log_info (hashcat_ctx, " Keep.Guessing.......: %s", (hashconfig->opts_type & OPTS_TYPE_SUGGEST_KG) ? "Yes" : "No");
|
||||
event_log_info (hashcat_ctx, " Custom.Plugin.......: %s", (hashconfig->opts_type & OPTS_TYPE_STOCK_MODULE) ? "No" : "Yes");
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII)
|
||||
@ -1915,7 +2071,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
|
||||
printf (",");
|
||||
}
|
||||
|
||||
printf (" { \"device_id\": %u,", device_id + 1);
|
||||
printf (" { \"device_id\": %d,", device_id + 1);
|
||||
|
||||
char *device_name_json_encoded = (char *) hcmalloc (strlen (device_info->device_name) * 2);
|
||||
|
||||
@ -2419,18 +2575,10 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info (hashcat_ctx,
|
||||
"Remaining........: %u (%.2f%%) Digests",
|
||||
digests_remain,
|
||||
digests_remain_percent);
|
||||
event_log_info (hashcat_ctx, "Remaining........: %u (%.2f%%) Digests", digests_remain, digests_remain_percent);
|
||||
}
|
||||
}
|
||||
|
||||
if (hashcat_status->digests_cnt > 1000)
|
||||
{
|
||||
event_log_info (hashcat_ctx,
|
||||
"Recovered/Time...: %s",
|
||||
hashcat_status->cpt);
|
||||
event_log_info (hashcat_ctx, "Recovered/Time...: %s", hashcat_status->cpt);
|
||||
}
|
||||
|
||||
switch (hashcat_status->progress_mode)
|
||||
@ -2754,7 +2902,7 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
|
||||
printf (",");
|
||||
}
|
||||
|
||||
printf (" { \"device_id\": %u,", device_id + 1);
|
||||
printf (" { \"device_id\": %d,", device_id + 1);
|
||||
printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000));
|
||||
device_num++;
|
||||
}
|
||||
@ -2871,7 +3019,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
|
||||
printf (",");
|
||||
}
|
||||
|
||||
printf (" { \"device_id\": %u,", device_id + 1);
|
||||
printf (" { \"device_id\": %d,", device_id + 1);
|
||||
printf (" \"progress\": %" PRIu64 ",", device_info->progress_dev);
|
||||
printf (" \"runtime\": %0.2f }", device_info->runtime_msec_dev);
|
||||
device_num++;
|
||||
|
@ -94,7 +94,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
|
||||
" --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",
|
||||
" --hook-threads | Num | Sets number of threads for a hook (per compute unit) | --hook-threads=8",
|
||||
" --hash-info | | Show information for each hash-mode |",
|
||||
" -H, --hash-info | | Show information for each hash-mode | -H or -HH",
|
||||
" --example-hashes | | Alias of --hash-info |",
|
||||
" --backend-ignore-cuda | | Do not try to open CUDA interface on startup |",
|
||||
" --backend-ignore-hip | | Do not try to open HIP interface on startup |",
|
||||
|
@ -21,9 +21,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BRAIN
|
||||
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:z";
|
||||
static const char *const short_options = "hHVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:z";
|
||||
#else
|
||||
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:";
|
||||
static const char *const short_options = "hHVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:";
|
||||
#endif
|
||||
|
||||
static char *const SEPARATOR = ":";
|
||||
@ -415,7 +415,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
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_HASH_INFO: user_options->hash_info = true; break;
|
||||
case IDX_HASH_INFO: user_options->hash_info++; break;
|
||||
case IDX_FORCE: user_options->force = true; break;
|
||||
case IDX_SELF_TEST_DISABLE: user_options->self_test = false; break;
|
||||
case IDX_SKIP: user_options->skip = hc_strtoull (optarg, NULL, 10);
|
||||
@ -1291,7 +1291,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (user_options->hash_info == true)
|
||||
if (user_options->hash_info > 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Use of --hash-info is not allowed in benchmark mode.");
|
||||
|
||||
@ -1476,6 +1476,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (user_options->hash_info > 2)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Invalid --hash-info/-H value, must have a value greater or equal to 0 and lower than 3.");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef WITH_BRAIN
|
||||
if ((user_options->brain_client == true) && (user_options->remove == true))
|
||||
{
|
||||
@ -1570,7 +1577,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
show_error = false;
|
||||
}
|
||||
}
|
||||
else if (user_options->hash_info == true)
|
||||
else if (user_options->hash_info > 0)
|
||||
{
|
||||
if (user_options->hc_argc == 0)
|
||||
{
|
||||
@ -1768,7 +1775,7 @@ void user_options_session_auto (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->session = "benchmark";
|
||||
}
|
||||
|
||||
if (user_options->hash_info == true)
|
||||
if (user_options->hash_info > 0)
|
||||
{
|
||||
user_options->session = "hash_info";
|
||||
}
|
||||
@ -1851,12 +1858,12 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->bitmap_max = 1;
|
||||
}
|
||||
|
||||
if (user_options->hash_info == true
|
||||
|| user_options->keyspace == true
|
||||
if (user_options->keyspace == true
|
||||
|| user_options->speed_only == true
|
||||
|| user_options->progress_only == true
|
||||
|| user_options->identify == true
|
||||
|| user_options->usage > 0
|
||||
|| user_options->hash_info > 0
|
||||
|| user_options->backend_info > 0)
|
||||
{
|
||||
user_options->hwmon = false;
|
||||
@ -1908,7 +1915,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->hash_info == true)
|
||||
if (user_options->hash_info > 0)
|
||||
{
|
||||
user_options->quiet = true;
|
||||
}
|
||||
@ -2022,7 +2029,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
if (user_options->hash_info == true)
|
||||
if (user_options->hash_info > 0)
|
||||
{
|
||||
|
||||
}
|
||||
@ -2278,7 +2285,7 @@ void user_options_extra_init (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
|
||||
}
|
||||
else if (user_options->hash_info == true)
|
||||
else if (user_options->hash_info > 0)
|
||||
{
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user