From db5291a76cbda92616f85a9c6f4bd0bc2908e5e9 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 29 Nov 2016 20:37:29 +0100 Subject: [PATCH] Add special weak-hash detection section for LM Fixes https://github.com/hashcat/hashcat/issues/889 --- include/interface.h | 4 ++-- src/potfile.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/interface.h b/include/interface.h index 01eed4e27..9c9b7db2c 100644 --- a/include/interface.h +++ b/include/interface.h @@ -16,8 +16,8 @@ * weak hashes shutcut */ -#define LM_WEAK_HASH "\x4e\xcf\x0d\x0c\x0a\xe2\xfb\xc1" -#define LM_MASKED_PLAIN "[notfound]" +static const char LM_WEAK_HASH[] = "aad3b435b51404ee"; +static const char LM_MASKED_PLAIN[] = "[notfound]"; /** * algo specific diff --git a/src/potfile.c b/src/potfile.c index c7b03f8d2..aa752b531 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -303,6 +303,27 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) hash_buf.esalt = hcmalloc (hashconfig->esalt_size); } + // this is usually detected by weak-hash-check + // but not if bitslice + + if (hashconfig->hash_mode == 3000) + { + int parser_status = hashconfig->parse_func ((u8 *) LM_WEAK_HASH, 16, &hash_buf, hashconfig); + + if (parser_status == PARSER_OK) + { + hash_t *found = (hash_t *) hc_bsearch_r (&hash_buf, hashes_buf, hashes_cnt, sizeof (hash_t), sort_by_hash_no_salt, (void *) hashconfig); + + if (found) + { + found->pw_buf = ""; + found->pw_len = 0; + + found->cracked = 1; + } + } + } + const int rc = potfile_read_open (hashcat_ctx); if (rc == -1) return -1;