From d4dfe58a729031cd41fb8a59605dd3de5a4c74d6 Mon Sep 17 00:00:00 2001 From: radix Date: Thu, 28 Jul 2016 10:38:31 -0500 Subject: [PATCH 1/6] CRAM_MD5 throws salt length exception when the issue is in the hash --- src/shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared.c b/src/shared.c index 8488463e6..931a100ab 100644 --- a/src/shared.c +++ b/src/shared.c @@ -16949,7 +16949,7 @@ int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf) hash_len = base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); - if (hash_len < 32 + 1) return (PARSER_SALT_LENGTH); + if (hash_len < 32 + 1) return (PARSER_HASH_LENGTH); uint user_len = hash_len - 32; From 004812819f4460ad8fb6335b4585fd7b08b7cb3c Mon Sep 17 00:00:00 2001 From: radix Date: Sat, 30 Jul 2016 20:14:46 -0500 Subject: [PATCH 2/6] Add Custom.Chars to output window in the case of a user specifying -1, -2, -3, -4. --- include/types.h | 4 ++++ src/hashcat.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/types.h b/include/types.h index 37e877cac..a03be3830 100644 --- a/include/types.h +++ b/include/types.h @@ -1281,6 +1281,10 @@ typedef struct char *veracrypt_keyfiles; uint veracrypt_pim; uint workload_profile; + char *custom_charset_1; + char *custom_charset_2; + char *custom_charset_3; + char *custom_charset_4; uint hash_mode; uint hash_type; diff --git a/src/hashcat.c b/src/hashcat.c index d11921f6b..7993ba02c 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1036,6 +1036,16 @@ void status_display () } log_info ("Input.Mode.....: %s", tmp_buf); + + if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + { + char *custom_charset_1 = data.custom_charset_1; + char *custom_charset_2 = data.custom_charset_2; + char *custom_charset_3 = data.custom_charset_3; + char *custom_charset_4 = data.custom_charset_4; + + log_info ("Custom.Chars...: -1 %s. -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + } } tmp_len = 0; @@ -7549,6 +7559,10 @@ int main (int argc, char **argv) data.benchmark = benchmark; data.skip = skip; data.limit = limit; + data.custom_charset_1 = custom_charset_1; + data.custom_charset_2 = custom_charset_2; + data.custom_charset_3 = custom_charset_3; + data.custom_charset_4 = custom_charset_4; #ifdef HAVE_HWMON data.powertune_enable = powertune_enable; #endif From 817917591edde03fdb06939dd6c9e4cac1b020df Mon Sep 17 00:00:00 2001 From: radix Date: Sat, 30 Jul 2016 20:20:46 -0500 Subject: [PATCH 3/6] Had a typo in the output, fixed. --- src/hashcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashcat.c b/src/hashcat.c index 7993ba02c..291cf576d 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1044,7 +1044,7 @@ void status_display () char *custom_charset_3 = data.custom_charset_3; char *custom_charset_4 = data.custom_charset_4; - log_info ("Custom.Chars...: -1 %s. -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } From 494afc0f66d223602e362facd1e9bb4319ee9c47 Mon Sep 17 00:00:00 2001 From: radix Date: Sat, 30 Jul 2016 20:39:23 -0500 Subject: [PATCH 4/6] Added Custom.Chars for modes 6, and 7. --- src/hashcat.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/hashcat.c b/src/hashcat.c index 291cf576d..86ee6668e 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1054,11 +1054,27 @@ void status_display () { if (data.dictfile != NULL) log_info ("Input.Left.....: File (%s)", data.dictfile); if (data.mask != NULL) log_info ("Input.Right....: Mask (%s) [%i]", data.mask, data.css_cnt); + if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + { + char *custom_charset_1 = data.custom_charset_1; + char *custom_charset_2 = data.custom_charset_2; + char *custom_charset_3 = data.custom_charset_3; + char *custom_charset_4 = data.custom_charset_4; + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + } } else if (data.attack_mode == ATTACK_MODE_HYBRID2) { if (data.mask != NULL) log_info ("Input.Left.....: Mask (%s) [%i]", data.mask, data.css_cnt); if (data.dictfile != NULL) log_info ("Input.Right....: File (%s)", data.dictfile); + if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + { + char *custom_charset_1 = data.custom_charset_1; + char *custom_charset_2 = data.custom_charset_2; + char *custom_charset_3 = data.custom_charset_3; + char *custom_charset_4 = data.custom_charset_4; + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + } } if (data.digests_cnt == 1) From cadafefcc0ac8d7517ab214739ae92dd8fd9af22 Mon Sep 17 00:00:00 2001 From: radix Date: Wed, 17 Aug 2016 00:35:40 -0500 Subject: [PATCH 5/6] update changes.txt --- docs/changes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 1cfe5113d..61d8bd2ee 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -4,6 +4,7 @@ ## Improvements ## +- Added mask display to modes 3, 6, and 7. Allows the user to see the custom character set used during the run - Make Linux build POSIX compatible; Also allow it to actually compile on musl-libc systems - Add support to compile on FreeBSD - Make use of cl_context_properties[] to clCreateContext(), even if OpenCL specification allow the use of NULL, some runtimes fail without @@ -26,6 +27,7 @@ ## Bugs ## +- Fixed a bug where CRAM MD5 checked salt length instead of hash length - Fixed a bug where hashcat is suppressing --machine-readable output in the final status update - Fixed a bug where hashcat did not check the return of realpath() and crashes uncontrolled if the path does not exist - Fixed a bug where hashcat crashes for accessing deallocated buffer if user spams "s" shortly before hashcat shuts down From e30dac2c6ed1a091d8e741c448846c3890a67671 Mon Sep 17 00:00:00 2001 From: radix Date: Wed, 17 Aug 2016 09:30:42 -0500 Subject: [PATCH 6/6] If a custom char set is undefined, declare it as undefined rather than NULL --- src/hashcat.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/hashcat.c b/src/hashcat.c index 86ee6668e..8a5670de7 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1044,6 +1044,23 @@ void status_display () char *custom_charset_3 = data.custom_charset_3; char *custom_charset_4 = data.custom_charset_4; + if (custom_charset_1 == NULL) + { + custom_charset_1 = "Undefined"; + } + if (custom_charset_2 == NULL) + { + custom_charset_2 = "Undefined"; + } + if (custom_charset_3 == NULL) + { + custom_charset_3 = "Undefined"; + } + if (custom_charset_4 == NULL) + { + custom_charset_4 = "Undefined"; + } + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } @@ -1060,6 +1077,24 @@ void status_display () char *custom_charset_2 = data.custom_charset_2; char *custom_charset_3 = data.custom_charset_3; char *custom_charset_4 = data.custom_charset_4; + + if (custom_charset_1 == NULL) + { + custom_charset_1 = "Undefined"; + } + if (custom_charset_2 == NULL) + { + custom_charset_2 = "Undefined"; + } + if (custom_charset_3 == NULL) + { + custom_charset_3 = "Undefined"; + } + if (custom_charset_4 == NULL) + { + custom_charset_4 = "Undefined"; + } + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } @@ -1073,6 +1108,24 @@ void status_display () char *custom_charset_2 = data.custom_charset_2; char *custom_charset_3 = data.custom_charset_3; char *custom_charset_4 = data.custom_charset_4; + + if (custom_charset_1 == NULL) + { + custom_charset_1 = "Undefined"; + } + if (custom_charset_2 == NULL) + { + custom_charset_2 = "Undefined"; + } + if (custom_charset_3 == NULL) + { + custom_charset_3 = "Undefined"; + } + if (custom_charset_4 == NULL) + { + custom_charset_4 = "Undefined"; + } + log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } }