|
|
|
@ -19,81 +19,29 @@ static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
|
|
|
|
static const u32 HASH_CATEGORY = HASH_CATEGORY_RAW_HASH;
|
|
|
|
|
static const char *HASH_NAME = "BLAKE2s-256";
|
|
|
|
|
static const u64 KERN_TYPE = 31000;
|
|
|
|
|
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE | OPTI_TYPE_USES_BITS_32 | OPTI_TYPE_RAW_HASH;
|
|
|
|
|
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE | OPTS_TYPE_PT_GENERATE_LE;
|
|
|
|
|
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
|
|
|
|
| OPTI_TYPE_USES_BITS_32
|
|
|
|
|
| OPTI_TYPE_RAW_HASH;
|
|
|
|
|
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
|
|
|
|
|
| OPTS_TYPE_PT_GENERATE_LE;
|
|
|
|
|
static const u32 SALT_TYPE = SALT_TYPE_NONE;
|
|
|
|
|
static const char *ST_PASS = "hashcat";
|
|
|
|
|
static const char *ST_HASH = "$BLAKE2$2c719b484789ad5f6fc1739012182169b25484af156adc91d4f64f72400e574a";
|
|
|
|
|
|
|
|
|
|
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return ATTACK_EXEC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return DGST_POS0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return DGST_POS1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return DGST_POS2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return DGST_POS3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return DGST_SIZE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_hash_category (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return HASH_CATEGORY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return HASH_NAME;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u64 module_kern_type (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return KERN_TYPE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_opti_type (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return OPTI_TYPE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u64 module_opts_type (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return OPTS_TYPE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 module_salt_type (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return SALT_TYPE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return ST_HASH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUSED const user_options_t * user_options, MAYBE_UNUSED const user_options_extra_t * user_options_extra)
|
|
|
|
|
{
|
|
|
|
|
return ST_PASS;
|
|
|
|
|
}
|
|
|
|
|
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; }
|
|
|
|
|
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; }
|
|
|
|
|
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; }
|
|
|
|
|
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; }
|
|
|
|
|
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; }
|
|
|
|
|
u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; }
|
|
|
|
|
u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; }
|
|
|
|
|
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; }
|
|
|
|
|
u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; }
|
|
|
|
|
u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; }
|
|
|
|
|
u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; }
|
|
|
|
|
u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; }
|
|
|
|
|
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
|
|
|
|
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
|
|
|
|
|
|
|
|
|
static const char *SIGNATURE_BLAKE2S = "$BLAKE2$";
|
|
|
|
|
|
|
|
|
@ -109,15 +57,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUS
|
|
|
|
|
token.signatures_buf[0] = SIGNATURE_BLAKE2S;
|
|
|
|
|
|
|
|
|
|
token.len[0] = 8;
|
|
|
|
|
token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE;
|
|
|
|
|
token.attr[0] = TOKEN_ATTR_FIXED_LENGTH
|
|
|
|
|
| TOKEN_ATTR_VERIFY_SIGNATURE;
|
|
|
|
|
|
|
|
|
|
token.len[1] = 64;
|
|
|
|
|
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_HEX;
|
|
|
|
|
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
|
|
|
|
|
| TOKEN_ATTR_VERIFY_HEX;
|
|
|
|
|
|
|
|
|
|
const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token);
|
|
|
|
|
|
|
|
|
|
if (rc_tokenizer != PARSER_OK)
|
|
|
|
|
return (rc_tokenizer);
|
|
|
|
|
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
|
|
|
|
|
|
|
|
|
const u8 *hash_pos = token.buf[1];
|
|
|
|
|
|
|
|
|
@ -146,22 +95,14 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t * hashconfig, MAYBE_UNUS
|
|
|
|
|
|
|
|
|
|
memcpy (out_buf, SIGNATURE_BLAKE2S, out_len);
|
|
|
|
|
|
|
|
|
|
u32_to_hex (digest[0], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[1], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[2], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[3], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[4], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[5], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[6], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[7], out_buf + out_len);
|
|
|
|
|
out_len += 8;
|
|
|
|
|
u32_to_hex (digest[0], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[1], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[2], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[3], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[4], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[5], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[6], out_buf + out_len); out_len += 8;
|
|
|
|
|
u32_to_hex (digest[7], out_buf + out_len); out_len += 8;
|
|
|
|
|
|
|
|
|
|
return out_len;
|
|
|
|
|
}
|
|
|
|
|