Added new hash-mode 14400 = SHA1(CX)

Details: https://github.com/hashcat/hashcat/issues/554
This commit is contained in:
jsteube
2016-11-12 11:39:38 +01:00
parent ac811011b0
commit 2bda020c83
10 changed files with 3009 additions and 3 deletions
+60
View File
@@ -211,6 +211,7 @@ static const char HT_13800[] = "Windows 8+ phone PIN/Password";
static const char HT_13900[] = "OpenCart";
static const char HT_14000[] = "DES (PT = $salt, key = $pass)";
static const char HT_14100[] = "3DES (PT = $salt, key = $pass)";
static const char HT_14400[] = "sha1(CX)";
static const char HT_99999[] = "Plaintext";
static const char HT_00011[] = "Joomla < 2.5.18";
@@ -12628,6 +12629,37 @@ int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_
return (PARSER_OK);
}
int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig)
{
if ((input_len < DISPLAY_LEN_MIN_14400) || (input_len > DISPLAY_LEN_MAX_14400)) return (PARSER_GLOBAL_LENGTH);
u32 *digest = (u32 *) hash_buf->digest;
salt_t *salt = hash_buf->salt;
digest[0] = hex_to_u32 ((const u8 *) &input_buf[ 0]);
digest[1] = hex_to_u32 ((const u8 *) &input_buf[ 8]);
digest[2] = hex_to_u32 ((const u8 *) &input_buf[16]);
digest[3] = hex_to_u32 ((const u8 *) &input_buf[24]);
digest[4] = hex_to_u32 ((const u8 *) &input_buf[32]);
if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED);
u32 salt_len = input_len - 40 - 1;
u8 *salt_buf = input_buf + 40 + 1;
u8 *salt_buf_ptr = (u8 *) salt->salt_buf;
salt_len = parse_and_store_salt (salt_buf_ptr, salt_buf, salt_len, hashconfig);
if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH);
salt->salt_len = salt_len;
return (PARSER_OK);
}
/**
* output
*/
@@ -12870,6 +12902,7 @@ char *strhashtype (const u32 hash_mode)
case 13900: return ((char *) HT_13900);
case 14000: return ((char *) HT_14000);
case 14100: return ((char *) HT_14100);
case 14400: return ((char *) HT_14400);
case 99999: return ((char *) HT_99999);
}
@@ -15693,6 +15726,15 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos,
{
snprintf (out_buf, len - 1, "%08x%08x:%s", digest_buf[0], digest_buf[1], (char *) salt.salt_buf);
}
else if (hash_mode == 14400)
{
snprintf (out_buf, len-1, "%08x%08x%08x%08x%08x",
byte_swap_32 (digest_buf[0]),
byte_swap_32 (digest_buf[1]),
byte_swap_32 (digest_buf[2]),
byte_swap_32 (digest_buf[3]),
byte_swap_32 (digest_buf[4]));
}
else if (hash_mode == 99999)
{
char *ptr = (char *) digest_buf;
@@ -19636,6 +19678,22 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->dgst_pos3 = 3;
break;
case 14400: hashconfig->hash_type = HASH_TYPE_SHA1;
hashconfig->salt_type = SALT_TYPE_INTERN;
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE;
hashconfig->kern_type = KERN_TYPE_SHA1CX;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = sha1cx_parse_hash;
hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE
| OPTI_TYPE_PRECOMPUTE_INIT
| OPTI_TYPE_EARLY_SKIP;
hashconfig->dgst_pos0 = 3;
hashconfig->dgst_pos1 = 4;
hashconfig->dgst_pos2 = 2;
hashconfig->dgst_pos3 = 1;
break;
case 99999: hashconfig->hash_type = HASH_TYPE_PLAINTEXT;
hashconfig->salt_type = SALT_TYPE_NONE;
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
@@ -19953,6 +20011,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
break;
case 14100: hashconfig->pw_max = 24;
break;
case 14400: hashconfig->pw_max = 24;
break;
}
return 0;
+1
View File
@@ -141,6 +141,7 @@ static const char *USAGE_BIG[] =
" 4500 | sha1(sha1($pass)) | Raw Hash, Salted and / or Iterated",
" 4700 | sha1(md5($pass)) | Raw Hash, Salted and / or Iterated",
" 4900 | sha1($salt.$pass.$salt) | Raw Hash, Salted and / or Iterated",
" 14400 | sha1(CX) | Raw Hash, Salted and / or Iterated",
" 1410 | sha256($pass.$salt) | Raw Hash, Salted and / or Iterated",
" 1420 | sha256($salt.$pass) | Raw Hash, Salted and / or Iterated",
" 1430 | sha256(unicode($pass).$salt) | Raw Hash, Salted and / or Iterated",