From 7f55f69d7fe3bd8efaf7b8244be16066f4034167 Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Fri, 6 Mar 2020 11:49:22 +0100 Subject: [PATCH 1/2] solve telegram format conflict with jtr --- src/modules/module_22301.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/module_22301.c b/src/modules/module_22301.c index 9f87465c7..cda57a6e7 100644 --- a/src/modules/module_22301.c +++ b/src/modules/module_22301.c @@ -27,7 +27,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_BE; static const u32 SALT_TYPE = SALT_TYPE_GENERIC; static const char *ST_PASS = "hashcat"; -static const char *ST_HASH = "$telegram$1*518c001aeb3b4ae96c6173be4cebe60a85f67b1e087b045935849e2f815b5e41*25184098058621950709328221838128"; +static const char *ST_HASH = "$telegram$0*518c001aeb3b4ae96c6173be4cebe60a85f67b1e087b045935849e2f815b5e41*25184098058621950709328221838128"; u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; } u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; } @@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *version_pos = token.buf[1]; - if (version_pos[0] != '1') return (PARSER_SALT_VALUE); + if (version_pos[0] != '0') return (PARSER_SALT_VALUE); const u8 *hash_pos = token.buf[2]; @@ -162,7 +162,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int line_len = snprintf (line_buf, line_size, "%s%i*%08x%08x%08x%08x%08x%08x%08x%08x*%08x%08x%08x%08x", SIGNATURE_TELEGRAM, - 1, + 0, tmp[0], tmp[1], tmp[2], From eb46c829983849c81df2c9ebfa4d35d2683ca266 Mon Sep 17 00:00:00 2001 From: philsmd <921533+philsmd@users.noreply.github.com> Date: Fri, 6 Mar 2020 11:50:16 +0100 Subject: [PATCH 2/2] tests: solve telegram format conflict with jtr --- tools/test_modules/m22301.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test_modules/m22301.pm b/tools/test_modules/m22301.pm index 6a3a32e79..6c708d513 100644 --- a/tools/test_modules/m22301.pm +++ b/tools/test_modules/m22301.pm @@ -21,7 +21,7 @@ sub module_generate_hash my $digest = sha256_hex ($salt_bin . $word . $salt_bin); - my $hash = sprintf ("\$telegram\$1*%s*%s", $digest, $salt); + my $hash = sprintf ("\$telegram\$0*%s*%s", $digest, $salt); return $hash; } @@ -40,7 +40,7 @@ sub module_verify_hash my $version = substr ($data[0], 10); - return unless ($version eq "1"); + return unless ($version eq "0"); my $digest = $data[1]; my $salt = $data[2];