From c1b56a3018904044572e974d74b92d49a08de027 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sun, 16 Jan 2022 14:48:49 +0100 Subject: [PATCH] Hash Info: show more information (Updated Hash-Format. Added Autodetect, Self-Test, Potfile and Plaintext encoding) --- docs/changes.txt | 1 + src/terminal.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 1519dba47..916898b4a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -52,6 +52,7 @@ - Status code: updated negative status code, usefull in Unit tests engine (test.sh) - Unit tests: added -r (--runtime) option - Unit tests: handle negative status code, skip deprecated hash-types, skip hash-types with known perl modules issues, updated output +- Hash Info: show more information (Updated Hash-Format. Added Autodetect, Self-Test, Potfile and Plaintext encoding) * changes v6.2.4 -> v6.2.5 diff --git a/src/terminal.c b/src/terminal.c index 3692c10b3..13f46c1ee 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -667,7 +667,14 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op { if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE) { - event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded"); + if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE_OPTIONAL) + { + event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded"); + } + else + { + event_log_info (hashcat_ctx, " Example.Hash.Format.: hex-encoded (binary file only)"); + } event_log_info (hashcat_ctx, " Example.Hash........: %s", hashconfig->st_hash); } else @@ -734,6 +741,23 @@ void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_op event_log_info (hashcat_ctx, " Benchmark.Mask......: N/A"); } + 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"); + + if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII) + { + event_log_info (hashcat_ctx, " Plaintext.Encoding..: ASCII only"); + } + else if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_HEXIFY) + { + event_log_info (hashcat_ctx, " Plaintext.Encoding..: HEX only"); + } + else + { + event_log_info (hashcat_ctx, " Plaintext.Encoding..: ASCII, HEX"); + } + event_log_info (hashcat_ctx, NULL); }