From c48f044fb77ebbaf8bfbd3925f89a87a9eb31b57 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Mon, 10 Jan 2022 01:50:32 +0100 Subject: [PATCH 1/2] Fixed false negative on Unit Test with hash-type 25400 --- docs/changes.txt | 1 + src/modules/module_25400.c | 4 ++-- tools/test.sh | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 9e13fa513..f99eb33dd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -25,6 +25,7 @@ - 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 wordlist handling in -m 3000 when candidate passwords use the $HEX[...] syntax +- Fixed false negative on Unit Test with hash-type 25400 ## ## Technical diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index c00ad420b..026302c5f 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -541,7 +541,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE pdf_t *pdf = (pdf_t *) esalt_buf; if (pdf->id_len == 32) { - line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%s", + line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s", pdf->V, pdf->R, 128, @@ -579,7 +579,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE } else { - line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%s", + line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s", pdf->V, pdf->R, 128, diff --git a/tools/test.sh b/tools/test.sh index 205d8367d..c0c2edcb5 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -518,6 +518,11 @@ function attack_0() search="${hash}:${pass}" fi + if [ ${hash_type} -eq 25400 ]; then + tmp=$(echo $output | sed -e 's/ (user password[^)].*//g') + output="${tmp}" + fi + echo "${output}" | grep -F "${search}" >/dev/null 2>/dev/null if [ "${?}" -ne 0 ]; then From 3fe9f8632657a01f4b793ab6484279c72b1bf438 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Mon, 10 Jan 2022 02:06:19 +0100 Subject: [PATCH 2/2] simplified regex --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index c0c2edcb5..1acbd4cb3 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -519,7 +519,7 @@ function attack_0() fi if [ ${hash_type} -eq 25400 ]; then - tmp=$(echo $output | sed -e 's/ (user password[^)].*//g') + tmp=$(echo $output | sed -e 's/ (user password.*//g') output="${tmp}" fi