mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-14 03:39:09 +00:00
Add Domain Cached Credentials 2 (DCC2), MS Cache 2, (NT), -m 31600
This commit is contained in:
parent
04e7f84daf
commit
9b2aca0a38
322
OpenCL/m31600-pure.cl
Normal file
322
OpenCL/m31600-pure.cl
Normal file
@ -0,0 +1,322 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#ifdef KERNEL_STATIC
|
||||
#include M2S(INCLUDE_PATH/inc_vendor.h)
|
||||
#include M2S(INCLUDE_PATH/inc_types.h)
|
||||
#include M2S(INCLUDE_PATH/inc_platform.cl)
|
||||
#include M2S(INCLUDE_PATH/inc_common.cl)
|
||||
#include M2S(INCLUDE_PATH/inc_simd.cl)
|
||||
#include M2S(INCLUDE_PATH/inc_hash_md4.cl)
|
||||
#include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
|
||||
#endif
|
||||
|
||||
#define COMPARE_S M2S(INCLUDE_PATH/inc_comp_single.cl)
|
||||
#define COMPARE_M M2S(INCLUDE_PATH/inc_comp_multi.cl)
|
||||
|
||||
typedef struct dcc2_tmp
|
||||
{
|
||||
u32 ipad[5];
|
||||
u32 opad[5];
|
||||
|
||||
u32 dgst[5];
|
||||
u32 out[4];
|
||||
|
||||
} dcc2_tmp_t;
|
||||
|
||||
#ifdef KERNEL_STATIC
|
||||
DECLSPEC u8 hex_convert (const u8 c)
|
||||
{
|
||||
return (c & 15) + (c >> 6) * 9;
|
||||
}
|
||||
|
||||
DECLSPEC u8 hex_to_u8 (PRIVATE_AS const u8 *hex)
|
||||
{
|
||||
u8 v = 0;
|
||||
|
||||
v |= ((u8) hex_convert (hex[1]) << 0);
|
||||
v |= ((u8) hex_convert (hex[0]) << 4);
|
||||
|
||||
return (v);
|
||||
}
|
||||
#endif
|
||||
|
||||
DECLSPEC void hmac_sha1_run_V (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *ipad, PRIVATE_AS u32x *opad, PRIVATE_AS u32x *digest)
|
||||
{
|
||||
digest[0] = ipad[0];
|
||||
digest[1] = ipad[1];
|
||||
digest[2] = ipad[2];
|
||||
digest[3] = ipad[3];
|
||||
digest[4] = ipad[4];
|
||||
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
|
||||
w0[0] = digest[0];
|
||||
w0[1] = digest[1];
|
||||
|
||||
w0[2] = digest[2];
|
||||
w0[3] = digest[3];
|
||||
w1[0] = digest[4];
|
||||
w1[1] = 0x80000000;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = (64 + 20) * 8;
|
||||
|
||||
digest[0] = opad[0];
|
||||
digest[1] = opad[1];
|
||||
digest[2] = opad[2];
|
||||
digest[3] = opad[3];
|
||||
digest[4] = opad[4];
|
||||
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
}
|
||||
|
||||
KERNEL_FQ void m31600_init (KERN_ATTR_TMPS (dcc2_tmp_t))
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
if (gid >= GID_CNT) return;
|
||||
|
||||
// dcc1
|
||||
|
||||
u32 in[16];
|
||||
|
||||
in[ 0] = pws[gid].i[ 0];
|
||||
in[ 1] = pws[gid].i[ 1];
|
||||
in[ 2] = pws[gid].i[ 2];
|
||||
in[ 3] = pws[gid].i[ 3];
|
||||
in[ 4] = pws[gid].i[ 4];
|
||||
in[ 5] = pws[gid].i[ 5];
|
||||
in[ 6] = pws[gid].i[ 6];
|
||||
in[ 7] = pws[gid].i[ 7];
|
||||
|
||||
u32 out[4];
|
||||
|
||||
PRIVATE_AS u8 *in_ptr = (PRIVATE_AS u8 *) in;
|
||||
PRIVATE_AS u8 *out_ptr = (PRIVATE_AS u8 *) out;
|
||||
|
||||
for (int i = 0, j = 0; i < 16; i += 1, j += 2)
|
||||
{
|
||||
out_ptr[i] = hex_to_u8 (in_ptr + j);
|
||||
}
|
||||
|
||||
md4_ctx_t md4_ctx;
|
||||
|
||||
md4_init (&md4_ctx);
|
||||
|
||||
md4_ctx.w0[0] = out[0];
|
||||
md4_ctx.w0[1] = out[1];
|
||||
md4_ctx.w0[2] = out[2];
|
||||
md4_ctx.w0[3] = out[3];
|
||||
|
||||
md4_ctx.len = 16;
|
||||
|
||||
md4_update_global_utf16le (&md4_ctx, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
|
||||
md4_final (&md4_ctx);
|
||||
|
||||
md4_ctx.h[0] = hc_swap32_S (md4_ctx.h[0]);
|
||||
md4_ctx.h[1] = hc_swap32_S (md4_ctx.h[1]);
|
||||
md4_ctx.h[2] = hc_swap32_S (md4_ctx.h[2]);
|
||||
md4_ctx.h[3] = hc_swap32_S (md4_ctx.h[3]);
|
||||
|
||||
// dcc2
|
||||
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
u32 w3[4];
|
||||
|
||||
w0[0] = md4_ctx.h[0];
|
||||
w0[1] = md4_ctx.h[1];
|
||||
w0[2] = md4_ctx.h[2];
|
||||
w0[3] = md4_ctx.h[3];
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
sha1_hmac_ctx_t sha1_hmac_ctx;
|
||||
|
||||
sha1_hmac_init_64 (&sha1_hmac_ctx, w0, w1, w2, w3);
|
||||
|
||||
tmps[gid].ipad[0] = sha1_hmac_ctx.ipad.h[0];
|
||||
tmps[gid].ipad[1] = sha1_hmac_ctx.ipad.h[1];
|
||||
tmps[gid].ipad[2] = sha1_hmac_ctx.ipad.h[2];
|
||||
tmps[gid].ipad[3] = sha1_hmac_ctx.ipad.h[3];
|
||||
tmps[gid].ipad[4] = sha1_hmac_ctx.ipad.h[4];
|
||||
|
||||
tmps[gid].opad[0] = sha1_hmac_ctx.opad.h[0];
|
||||
tmps[gid].opad[1] = sha1_hmac_ctx.opad.h[1];
|
||||
tmps[gid].opad[2] = sha1_hmac_ctx.opad.h[2];
|
||||
tmps[gid].opad[3] = sha1_hmac_ctx.opad.h[3];
|
||||
tmps[gid].opad[4] = sha1_hmac_ctx.opad.h[4];
|
||||
|
||||
sha1_hmac_update_global_utf16le_swap (&sha1_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
|
||||
w0[0] = 1;
|
||||
w0[1] = 0;
|
||||
w0[2] = 0;
|
||||
w0[3] = 0;
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
sha1_hmac_update_64 (&sha1_hmac_ctx, w0, w1, w2, w3, 4);
|
||||
|
||||
sha1_hmac_final (&sha1_hmac_ctx);
|
||||
|
||||
tmps[gid].dgst[0] = sha1_hmac_ctx.opad.h[0];
|
||||
tmps[gid].dgst[1] = sha1_hmac_ctx.opad.h[1];
|
||||
tmps[gid].dgst[2] = sha1_hmac_ctx.opad.h[2];
|
||||
tmps[gid].dgst[3] = sha1_hmac_ctx.opad.h[3];
|
||||
tmps[gid].dgst[4] = sha1_hmac_ctx.opad.h[4];
|
||||
|
||||
tmps[gid].out[0] = tmps[gid].dgst[0];
|
||||
tmps[gid].out[1] = tmps[gid].dgst[1];
|
||||
tmps[gid].out[2] = tmps[gid].dgst[2];
|
||||
tmps[gid].out[3] = tmps[gid].dgst[3];
|
||||
}
|
||||
|
||||
KERNEL_FQ void m31600_loop (KERN_ATTR_TMPS (dcc2_tmp_t))
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
if ((gid * VECT_SIZE) >= GID_CNT) return;
|
||||
|
||||
u32x ipad[5];
|
||||
u32x opad[5];
|
||||
|
||||
ipad[0] = packv (tmps, ipad, gid, 0);
|
||||
ipad[1] = packv (tmps, ipad, gid, 1);
|
||||
ipad[2] = packv (tmps, ipad, gid, 2);
|
||||
ipad[3] = packv (tmps, ipad, gid, 3);
|
||||
ipad[4] = packv (tmps, ipad, gid, 4);
|
||||
|
||||
opad[0] = packv (tmps, opad, gid, 0);
|
||||
opad[1] = packv (tmps, opad, gid, 1);
|
||||
opad[2] = packv (tmps, opad, gid, 2);
|
||||
opad[3] = packv (tmps, opad, gid, 3);
|
||||
opad[4] = packv (tmps, opad, gid, 4);
|
||||
|
||||
/**
|
||||
* iter1
|
||||
*/
|
||||
|
||||
u32x dgst[5];
|
||||
u32x out[4];
|
||||
|
||||
dgst[0] = packv (tmps, dgst, gid, 0);
|
||||
dgst[1] = packv (tmps, dgst, gid, 1);
|
||||
dgst[2] = packv (tmps, dgst, gid, 2);
|
||||
dgst[3] = packv (tmps, dgst, gid, 3);
|
||||
dgst[4] = packv (tmps, dgst, gid, 4);
|
||||
|
||||
out[0] = packv (tmps, out, gid, 0);
|
||||
out[1] = packv (tmps, out, gid, 1);
|
||||
out[2] = packv (tmps, out, gid, 2);
|
||||
out[3] = packv (tmps, out, gid, 3);
|
||||
|
||||
for (u32 i = 0; i < LOOP_CNT; i++)
|
||||
{
|
||||
u32x w0[4];
|
||||
u32x w1[4];
|
||||
u32x w2[4];
|
||||
u32x w3[4];
|
||||
|
||||
w0[0] = dgst[0];
|
||||
w0[1] = dgst[1];
|
||||
w0[2] = dgst[2];
|
||||
w0[3] = dgst[3];
|
||||
w1[0] = dgst[4];
|
||||
w1[1] = 0x80000000;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = (64 + 20) * 8;
|
||||
|
||||
hmac_sha1_run_V (w0, w1, w2, w3, ipad, opad, dgst);
|
||||
|
||||
out[0] ^= dgst[0];
|
||||
out[1] ^= dgst[1];
|
||||
out[2] ^= dgst[2];
|
||||
out[3] ^= dgst[3];
|
||||
}
|
||||
|
||||
unpackv (tmps, dgst, gid, 0, dgst[0]);
|
||||
unpackv (tmps, dgst, gid, 1, dgst[1]);
|
||||
unpackv (tmps, dgst, gid, 2, dgst[2]);
|
||||
unpackv (tmps, dgst, gid, 3, dgst[3]);
|
||||
unpackv (tmps, dgst, gid, 4, dgst[4]);
|
||||
|
||||
unpackv (tmps, out, gid, 0, out[0]);
|
||||
unpackv (tmps, out, gid, 1, out[1]);
|
||||
unpackv (tmps, out, gid, 2, out[2]);
|
||||
unpackv (tmps, out, gid, 3, out[3]);
|
||||
}
|
||||
|
||||
KERNEL_FQ void m31600_comp (KERN_ATTR_TMPS (dcc2_tmp_t))
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
if (gid >= GID_CNT) return;
|
||||
|
||||
const u64 lid = get_local_id (0);
|
||||
|
||||
const u32 r0 = tmps[gid].out[DGST_R0];
|
||||
const u32 r1 = tmps[gid].out[DGST_R1];
|
||||
const u32 r2 = tmps[gid].out[DGST_R2];
|
||||
const u32 r3 = tmps[gid].out[DGST_R3];
|
||||
|
||||
#define il_pos 0
|
||||
|
||||
#ifdef KERNEL_STATIC
|
||||
#include COMPARE_M
|
||||
#endif
|
||||
}
|
@ -26,6 +26,7 @@
|
||||
- Added hash-mode: HMAC-RIPEMD160 (key = $pass)
|
||||
- Added hash-mode: HMAC-RIPEMD160 (key = $salt)
|
||||
- Added hash-mode: md5(md5($salt).md5(md5($pass)))
|
||||
- Added hash-mode: Domain Cached Credentials 2 (DCC2), MS Cache 2, (NT)
|
||||
|
||||
##
|
||||
## Performance
|
||||
|
247
src/modules/module_31600.c
Normal file
247
src/modules/module_31600.c
Normal file
@ -0,0 +1,247 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "modules.h"
|
||||
#include "bitops.h"
|
||||
#include "convert.h"
|
||||
#include "shared.h"
|
||||
|
||||
static const u32 ATTACK_EXEC = ATTACK_EXEC_OUTSIDE_KERNEL;
|
||||
static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_4;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_OS;
|
||||
static const char *HASH_NAME = "Domain Cached Credentials 2 (DCC2), MS Cache 2, (NT)";
|
||||
static const u64 KERN_TYPE = 31600;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
|
||||
| OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_ST_LOWER
|
||||
| OPTS_TYPE_AUTODETECT_DISABLE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "b4b9b02e6f09a9bd760f388b67351e2b";
|
||||
static const char *ST_HASH = "$DCC2$10240#6848#e2829c8af2232fa53797e2f0e35e4626";
|
||||
|
||||
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; }
|
||||
|
||||
typedef struct dcc2_tmp
|
||||
{
|
||||
u32 ipad[5];
|
||||
u32 opad[5];
|
||||
|
||||
u32 dgst[5];
|
||||
u32 out[4];
|
||||
|
||||
} dcc2_tmp_t;
|
||||
|
||||
static const char *SIGNATURE_DCC2 = "$DCC2$";
|
||||
|
||||
u64 module_tmp_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)
|
||||
{
|
||||
const u64 tmp_size = (const u64) sizeof (dcc2_tmp_t);
|
||||
|
||||
return tmp_size;
|
||||
}
|
||||
|
||||
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len)
|
||||
{
|
||||
u32 *digest = (u32 *) digest_buf;
|
||||
|
||||
hc_token_t token;
|
||||
|
||||
token.token_cnt = 4;
|
||||
|
||||
token.signatures_cnt = 1;
|
||||
token.signatures_buf[0] = SIGNATURE_DCC2;
|
||||
|
||||
token.len[0] = 6;
|
||||
token.attr[0] = TOKEN_ATTR_FIXED_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_SIGNATURE;
|
||||
|
||||
token.len_min[1] = 1;
|
||||
token.len_max[1] = 6;
|
||||
token.sep[1] = '#';
|
||||
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_DIGIT;
|
||||
|
||||
token.len_min[2] = SALT_MIN;
|
||||
token.len_max[2] = SALT_MAX;
|
||||
token.sep[2] = '#';
|
||||
token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_SEPARATOR_FARTHEST;
|
||||
|
||||
token.len_min[3] = 32;
|
||||
token.len_max[3] = 32;
|
||||
token.attr[3] = TOKEN_ATTR_VERIFY_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);
|
||||
|
||||
const u8 *hash_pos = token.buf[3];
|
||||
|
||||
digest[0] = hex_to_u32 (hash_pos + 0);
|
||||
digest[1] = hex_to_u32 (hash_pos + 8);
|
||||
digest[2] = hex_to_u32 (hash_pos + 16);
|
||||
digest[3] = hex_to_u32 (hash_pos + 24);
|
||||
|
||||
digest[0] = byte_swap_32 (digest[0]);
|
||||
digest[1] = byte_swap_32 (digest[1]);
|
||||
digest[2] = byte_swap_32 (digest[2]);
|
||||
digest[3] = byte_swap_32 (digest[3]);
|
||||
|
||||
const u8 *salt_pos = token.buf[2];
|
||||
const int salt_len = token.len[2];
|
||||
|
||||
const bool parse_rc = generic_salt_decode (hashconfig, salt_pos, salt_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
|
||||
|
||||
if (parse_rc == false) return (PARSER_SALT_LENGTH);
|
||||
|
||||
const u8 *iter_pos = token.buf[1];
|
||||
|
||||
u32 iter = hc_strtoul ((const char *) iter_pos, NULL, 10);
|
||||
|
||||
salt->salt_iter = iter - 1;
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size)
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
int line_len = 0;
|
||||
|
||||
line_len += snprintf (line_buf + line_len, line_size - line_len, "%s%u#", SIGNATURE_DCC2, salt->salt_iter + 1);
|
||||
|
||||
line_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) line_buf + line_len);
|
||||
|
||||
line_len += snprintf (line_buf + line_len, line_size - line_len, "#%08x%08x%08x%08x",
|
||||
digest[0],
|
||||
digest[1],
|
||||
digest[2],
|
||||
digest[3]);
|
||||
|
||||
return line_len;
|
||||
}
|
||||
|
||||
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 pw_max = 32; // Length of a NT hash
|
||||
|
||||
return pw_max;
|
||||
}
|
||||
|
||||
u32 module_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 pw_min = 32; // Length of a NT hash
|
||||
|
||||
return pw_min;
|
||||
}
|
||||
|
||||
const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const char *mask = "?a?a?a?a?a?a?a?axxxxxxxxxxxxxxxx";
|
||||
return mask;
|
||||
}
|
||||
|
||||
void module_init (module_ctx_t *module_ctx)
|
||||
{
|
||||
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
|
||||
module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT;
|
||||
|
||||
module_ctx->module_attack_exec = module_attack_exec;
|
||||
module_ctx->module_benchmark_esalt = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_mask = module_benchmark_mask;
|
||||
module_ctx->module_benchmark_charset = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_salt = MODULE_DEFAULT;
|
||||
module_ctx->module_build_plain_postprocess = MODULE_DEFAULT;
|
||||
module_ctx->module_deep_comp_kernel = MODULE_DEFAULT;
|
||||
module_ctx->module_deprecated_notice = MODULE_DEFAULT;
|
||||
module_ctx->module_dgst_pos0 = module_dgst_pos0;
|
||||
module_ctx->module_dgst_pos1 = module_dgst_pos1;
|
||||
module_ctx->module_dgst_pos2 = module_dgst_pos2;
|
||||
module_ctx->module_dgst_pos3 = module_dgst_pos3;
|
||||
module_ctx->module_dgst_size = module_dgst_size;
|
||||
module_ctx->module_dictstat_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_esalt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_extra_buffer_size = MODULE_DEFAULT;
|
||||
module_ctx->module_extra_tmp_size = MODULE_DEFAULT;
|
||||
module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT;
|
||||
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_save = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode_postprocess = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode_potfile = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode = module_hash_decode;
|
||||
module_ctx->module_hash_encode_status = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_encode_potfile = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_encode = module_hash_encode;
|
||||
module_ctx->module_hash_init_selftest = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_mode = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_category = module_hash_category;
|
||||
module_ctx->module_hash_name = module_hash_name;
|
||||
module_ctx->module_hashes_count_min = MODULE_DEFAULT;
|
||||
module_ctx->module_hashes_count_max = MODULE_DEFAULT;
|
||||
module_ctx->module_hlfmt_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_extra_param_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_extra_param_init = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_extra_param_term = MODULE_DEFAULT;
|
||||
module_ctx->module_hook12 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
module_ctx->module_opts_type = module_opts_type;
|
||||
module_ctx->module_outfile_check_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT;
|
||||
module_ctx->module_potfile_custom_check = MODULE_DEFAULT;
|
||||
module_ctx->module_potfile_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT;
|
||||
module_ctx->module_pwdump_column = MODULE_DEFAULT;
|
||||
module_ctx->module_pw_max = module_pw_max;
|
||||
module_ctx->module_pw_min = module_pw_min;
|
||||
module_ctx->module_salt_max = MODULE_DEFAULT;
|
||||
module_ctx->module_salt_min = MODULE_DEFAULT;
|
||||
module_ctx->module_salt_type = module_salt_type;
|
||||
module_ctx->module_separator = MODULE_DEFAULT;
|
||||
module_ctx->module_st_hash = module_st_hash;
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = module_tmp_size;
|
||||
module_ctx->module_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
}
|
Loading…
Reference in New Issue
Block a user