1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-26 08:28:20 +00:00

Fixed calculation of brain-session ID, only the first hash of the hashset was taken into account

This commit is contained in:
Jens Steube 2020-05-10 10:05:14 +02:00
parent d34381680d
commit 08ea00020a
2 changed files with 12 additions and 8 deletions

View File

@ -78,6 +78,7 @@
- Fixed buffer overflow in build_plain() function - Fixed buffer overflow in build_plain() function
- Fixed buffer overflow in mp_add_cs_buf() function - Fixed buffer overflow in mp_add_cs_buf() function
- Fixed copy/paste error leading to invalid "Integer overflow detected in keyspace of mask" in attack-mode 6 and 7 - Fixed copy/paste error leading to invalid "Integer overflow detected in keyspace of mask" in attack-mode 6 and 7
- Fixed calculation of brain-session ID, only the first hash of the hashset was taken into account
- Fixed cracking multiple Office hashes (modes 9500, 9600) with the same salt - Fixed cracking multiple Office hashes (modes 9500, 9600) with the same salt
- Fixed cracking of Blockchain, My Wallet (V1 and V2) hashes with unexpected decrypted data - Fixed cracking of Blockchain, My Wallet (V1 and V2) hashes with unexpected decrypted data
- Fixed cracking of Cisco-PIX and Cisco-ASA MD5 passwords in mask-attack mode if mask > length 16 - Fixed cracking of Cisco-PIX and Cisco-ASA MD5 passwords in mask-attack mode if mask > length 16

View File

@ -95,10 +95,11 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx)
else else
{ {
// using hash_encode is an easy workaround for dealing with optimizations // using hash_encode is an easy workaround for dealing with optimizations
// like OPTI_TYPE_PRECOMPUTE_MERKLE which cause diffrent hashes in digests_buf // like OPTI_TYPE_PRECOMPUTE_MERKLE which cause different hashes in digests_buf
// in case -O is used // in case -O is used
char **out_bufs = (char **) hccalloc (hashes->digests_cnt, sizeof (char *)); char **out_bufs = (char **) hccalloc (hashes->digests_cnt, sizeof (char *));
int *out_lens = (int *) hccalloc (hashes->digests_cnt, sizeof (int));
int out_idx = 0; int out_idx = 0;
@ -114,9 +115,12 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx)
{ {
const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx); const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx);
out_buf[out_len] = 0; out_bufs[out_idx] = (char *) hcmalloc (out_len + 1);
out_lens[out_idx] = out_len;
out_bufs[out_idx] = hcstrdup ((char *) out_buf); memcpy (out_bufs[out_idx], out_buf, out_len);
out_idx++;
} }
} }
@ -124,16 +128,15 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx)
qsort (out_bufs, out_idx, sizeof (char *), sort_by_string); qsort (out_bufs, out_idx, sizeof (char *), sort_by_string);
for (int i = 0; i <= out_idx; i++) for (int i = 0; i < out_idx; i++)
{ {
const size_t out_len = strlen (out_bufs[out_idx]); XXH64_update (state, out_bufs[i], out_lens[i]);
XXH64_update (state, out_bufs[out_idx], out_len); hcfree (out_bufs[i]);
hcfree (out_bufs[out_idx]);
} }
hcfree (out_bufs); hcfree (out_bufs);
hcfree (out_lens);
} }
const u32 session = (const u32) XXH64_digest (state); const u32 session = (const u32) XXH64_digest (state);