fixes show output of -m 9710, -m 9810 and -m 10410

pull/1343/head
philsmd 7 years ago
parent bed7e8f466
commit f1c3f952ba
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF

@ -33,6 +33,7 @@
- Fixed the parsing of command line options. It doesn't show two times the same error about an invalid option anymore
- Fixed the parsing of DCC2 hashes by allowing the "#" character within the user name
- Fixed the parsing of descrypt hashes if the hashes do have non-standard characters within the salt
- Fixed the output of --show when used together with the collider modes -m 9710, 9810 or 10410
- Fixed the version number used in the restore file header
##

@ -97,6 +97,12 @@ bool is_hexify (const u8 *buf, const int len)
{
if (len < 6) return false; // $HEX[] = 6
// length of the hex string must be a multiple of 2
// and the length of "$HEX[]" is 6 (also an even length)
// Therefore the overall length must be an even number:
if ((len & 1) == 1) return false;
if (buf[0] != '$') return (false);
if (buf[1] != 'H') return (false);
if (buf[2] != 'E') return (false);
@ -156,12 +162,9 @@ bool need_hexify (const u8 *buf, const int len, const char separator, bool alway
if (rc == false)
{
if ((len & 1) == 0)
if (is_hexify (buf, len))
{
if (is_hexify (buf, len))
{
rc = true;
}
rc = true;
}
}

@ -734,7 +734,36 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx)
tmp_buf[0] = 0;
const int tmp_len = outfile_write (hashcat_ctx, (char *) out_buf, (u8 *) hash->pw_buf, hash->pw_len, 0, username, user_len, (char *) tmp_buf);
// special case for collider modes: we do not use the $HEX[] format within the hash itself
// therefore we need to convert the $HEX[] password into hexadecimal (without "$HEX[" and "]")
bool is_collider_hex_password = false;
if ((hashconfig->hash_mode == 9710) || (hashconfig->hash_mode == 9810) || (hashconfig->hash_mode == 10410))
{
if (is_hexify ((u8 *) hash->pw_buf, hash->pw_len) == true)
{
is_collider_hex_password = true;
}
}
int tmp_len = 0;
if (is_collider_hex_password == true)
{
u8 pass_unhexified[HCBUFSIZ_TINY] = { 0 };
u32 pass_unhexified_len = 0;
pass_unhexified_len = exec_unhexify ((u8 *) hash->pw_buf, hash->pw_len, pass_unhexified, sizeof (pass_unhexified));
tmp_len = outfile_write (hashcat_ctx, (char *) out_buf, pass_unhexified, pass_unhexified_len, 0, username, user_len, (char *) tmp_buf);
}
else
{
tmp_len = outfile_write (hashcat_ctx, (char *) out_buf, (u8 *) hash->pw_buf, hash->pw_len, 0, username, user_len, (char *) tmp_buf);
}
EVENT_DATA (EVENT_POTFILE_HASH_SHOW, tmp_buf, tmp_len);
}

Loading…
Cancel
Save