From 51fda295dd917776febaf415ea9baa801de5bffe Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Tue, 22 Mar 2022 15:40:36 +0100 Subject: [PATCH 1/2] fixes #3201: fixed -O with -a 7 in --stdout mode --- src/stdout.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/stdout.c b/src/stdout.c index b9e11c6a6..12994f0ad 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -130,7 +130,7 @@ int process_stdout (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, } } } - else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) + else if ((user_options->attack_mode == ATTACK_MODE_HYBRID2) && ((hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) == 0)) { for (u64 gidvid = 0; gidvid < pws_cnt; gidvid++) { @@ -302,6 +302,36 @@ int process_stdout (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, } } } + else if ((user_options->attack_mode == ATTACK_MODE_HYBRID2) && (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)) + { + while (pw_idx <= pw_idx_last) + { + char *pw = (char *) (pws_comp_blk + (pw_idx->off - off_blk)); + u32 pw_len = (pw_idx->len); + + pw_idx++; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + u64 off = device_param->kernel_params_mp_buf64[3] + il_pos; + + u32 start = 0; + u32 stop = device_param->kernel_params_mp_buf32[4]; + + sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop); + + plain_len = stop; + + memcpy (plain_ptr + plain_len, pw, pw_len); + + plain_len += pw_len; + + if (plain_len > hashconfig->pw_max) plain_len = hashconfig->pw_max; + + out_push (&out, plain_ptr, plain_len); + } + } + } gidvid_blk += blk_cnt; // prepare for next block } From 81912e32582fe7272a67b1dd7d92623254c2b9e5 Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Tue, 22 Mar 2022 15:42:07 +0100 Subject: [PATCH 2/2] update changes for -a 7 -O --stdout fix --- docs/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes.txt b/docs/changes.txt index 6a2cb85d9..e318b69ce 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -44,6 +44,7 @@ - Fixed --hash-info example password output: force uppercase if OPTS_TYPE_PT_UPPER is set - Fixed method of how OPTS_TYPE_AUX* kernels are called in an association attack, for example in WPA/WPA2 kernel - Fixed missing option flag OPTS_TYPE_SUGGEST_KG for hash-mode 11600 to inform the user about possible false positives in this mode +- Fixed optimized (-O) candidate generation with --stdout and -a 7 - Fixed password limit in optimized kernel for hash-mode 10700 - Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices - Fixed Unit Test early exit on luks test file download/extract failure