From 2b3162f49b06c5d714babdda36cdc0abb9e9c7c7 Mon Sep 17 00:00:00 2001 From: b0lek <95943440+b0lek@users.noreply.github.com> Date: Fri, 17 Dec 2021 22:07:28 +0100 Subject: [PATCH 1/3] adding guess data into --status-json output --- src/terminal.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/terminal.c b/src/terminal.c index 2fcdfe109..db46077b2 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1309,6 +1309,24 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) target_json_encoded[j] = 0; printf ("{ \"session\": \"%s\",", hashcat_status->session); + printf (" \"guess\": {"); + if (hashcat_status->guess_base) + printf (" \"guess_base\": \"%s\",", hashcat_status->guess_base); + else + printf (" \"guess_base\": null,"); + printf (" \"guess_base_count\": \"%d\",", hashcat_status->guess_base_count); + printf (" \"guess_base_offset\": \"%d\",", hashcat_status->guess_base_offset); + printf (" \"guess_base_percent\": \"%.02f%%\",", hashcat_status->guess_base_percent); + printf (" \"guess_mask_length\": \"%d\",", hashcat_status->guess_mask_length); + if (hashcat_status->guess_mod) + printf (" \"guess_mod\": \"%s\",", hashcat_status->guess_mod); + else + printf (" \"guess_mod\": null,"); + printf (" \"guess_mod_count\": \"%d\",", hashcat_status->guess_mod_count); + printf (" \"guess_mod_offset\": \"%d\",", hashcat_status->guess_mod_offset); + printf (" \"guess_mod_percent\": \"%.02f%%\",", hashcat_status->guess_mod_percent); + printf (" \"guess_mode\": \"%d\"", hashcat_status->guess_mode); + printf (" }"); printf (" \"status\": %d,", hashcat_status->status_number); printf (" \"target\": \"%s\",", target_json_encoded); printf (" \"progress\": [%" PRIu64 ", %" PRIu64 "],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip); From f4edcc33eb419ec208f7d42b412645bc60843f8d Mon Sep 17 00:00:00 2001 From: b0lek <95943440+b0lek@users.noreply.github.com> Date: Fri, 17 Dec 2021 22:25:06 +0100 Subject: [PATCH 2/3] updating recent two changes --- docs/changes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 5c8f078eb..611e99836 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -11,6 +11,7 @@ ## - Added support to use --debug-mode in attack-mode 9 (Association Attack) +- Added guess data to --status-json output ## ## Bugs @@ -19,6 +20,7 @@ - Fixed functional error when nonce-error-corrections that were set on the command line in hash-mode 22000/22001 were not accepted - Fixed missing option flag OPTS_TYPE_SUGGEST_KG for hash-mode 11600 to inform the user about possible false positives in this mode - Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices +- Fixed HEX wordlist handling in -m 3000 ## ## Technical From 705dd16f50d21d30c4f2404a8806ca8281c44c9d Mon Sep 17 00:00:00 2001 From: b0lek <95943440+b0lek@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:44:40 +0100 Subject: [PATCH 3/3] Quotes removed from numbers and % sign removed. --- src/terminal.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index db46077b2..4ac4832f2 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1314,19 +1314,19 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) printf (" \"guess_base\": \"%s\",", hashcat_status->guess_base); else printf (" \"guess_base\": null,"); - printf (" \"guess_base_count\": \"%d\",", hashcat_status->guess_base_count); - printf (" \"guess_base_offset\": \"%d\",", hashcat_status->guess_base_offset); - printf (" \"guess_base_percent\": \"%.02f%%\",", hashcat_status->guess_base_percent); - printf (" \"guess_mask_length\": \"%d\",", hashcat_status->guess_mask_length); + printf (" \"guess_base_count\": %d,", hashcat_status->guess_base_count); + printf (" \"guess_base_offset\": %d,", hashcat_status->guess_base_offset); + printf (" \"guess_base_percent\": %.02f,", hashcat_status->guess_base_percent); + printf (" \"guess_mask_length\": %d,", hashcat_status->guess_mask_length); if (hashcat_status->guess_mod) printf (" \"guess_mod\": \"%s\",", hashcat_status->guess_mod); else printf (" \"guess_mod\": null,"); - printf (" \"guess_mod_count\": \"%d\",", hashcat_status->guess_mod_count); - printf (" \"guess_mod_offset\": \"%d\",", hashcat_status->guess_mod_offset); - printf (" \"guess_mod_percent\": \"%.02f%%\",", hashcat_status->guess_mod_percent); - printf (" \"guess_mode\": \"%d\"", hashcat_status->guess_mode); - printf (" }"); + printf (" \"guess_mod_count\": %d,", hashcat_status->guess_mod_count); + printf (" \"guess_mod_offset\": %d,", hashcat_status->guess_mod_offset); + printf (" \"guess_mod_percent\": %.02f,", hashcat_status->guess_mod_percent); + printf (" \"guess_mode\": %d", hashcat_status->guess_mode); + printf (" },"); printf (" \"status\": %d,", hashcat_status->status_number); printf (" \"target\": \"%s\",", target_json_encoded); printf (" \"progress\": [%" PRIu64 ", %" PRIu64 "],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip);