mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-08 14:51:10 +00:00
Improve cracking performance of -m 29500 by writing directly into hmac buffers
This commit is contained in:
parent
7c72430929
commit
2e8ba6ba2c
@ -22,42 +22,30 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
if (gid >= GID_CNT) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
COPY_PW (pws[gid]);
|
||||
|
||||
/**
|
||||
@ -69,25 +57,50 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
pw_t tmp = PASTE_PW;
|
||||
|
||||
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
sha1_hmac_final (&ctx);
|
||||
u32 intermediate[16] = {0};
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
// };
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
||||
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
u32 intermediate[16] = { 0 };
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,25 +109,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
@ -131,14 +126,15 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R2],
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -156,26 +152,49 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
pw_t tmp = PASTE_PW;
|
||||
|
||||
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
||||
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
u32 intermediate[16] = {0};
|
||||
|
||||
u32 intermediate[16] = { 0 };
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,32 +14,13 @@
|
||||
#include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
|
||||
#endif
|
||||
|
||||
|
||||
KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
{
|
||||
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
@ -53,6 +34,7 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||
{
|
||||
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
||||
@ -61,13 +43,13 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
@ -98,21 +80,46 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
u32 intermediate[16] = {0};
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
@ -123,25 +130,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
@ -167,6 +156,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||
{
|
||||
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
||||
@ -175,13 +165,13 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
@ -212,21 +202,46 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
u32 intermediate[16] = {0};
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
@ -20,44 +20,11 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
* modifier
|
||||
*/
|
||||
|
||||
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
|
||||
if (gid >= GID_CNT) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R0],
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R1],
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R2],
|
||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
@ -65,6 +32,7 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||
{
|
||||
@ -74,16 +42,17 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
|
||||
u32 w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += 1)
|
||||
@ -93,30 +62,51 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||
const u32 w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init (&ctx, w, pw_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
sha1_hmac_final (&ctx);
|
||||
sha1_hmac_ctx_t ctx;
|
||||
|
||||
u32 intermediate[16] = {0};
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_init (&ctx, w, pw_len);
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
u32 intermediate[16] = { 0 };
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,30 +116,9 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
* modifier
|
||||
*/
|
||||
|
||||
|
||||
const u32 fixed[16] =
|
||||
{
|
||||
0x636f6f6b,
|
||||
0x69652d73,
|
||||
0x65737369,
|
||||
0x6f6e0000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
const u64 lid = get_local_id (0);
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
|
||||
if (gid >= GID_CNT) return;
|
||||
|
||||
/**
|
||||
@ -171,6 +140,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||
{
|
||||
@ -180,16 +150,17 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||
|
||||
u32 s[16] = { 0 };
|
||||
|
||||
#pragma unroll
|
||||
for (u32 id = 0; id < 16; id++)
|
||||
{
|
||||
s[id] = hc_swap32_S(salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||
};
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
|
||||
u32 w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += 1)
|
||||
@ -199,31 +170,50 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
||||
const u32 w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
|
||||
sha1_hmac_ctx_t ctx;
|
||||
sha1_hmac_init (&ctx, w, pw_len);
|
||||
sha1_hmac_update (&ctx, fixed, 14);
|
||||
sha1_hmac_final (&ctx);
|
||||
u32 intermediate[16] = {0};
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
sha1_hmac_ctx_t ctx;
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 16);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
sha1_hmac_init (&ctx, w, pw_len);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
|
||||
// fixed: "cookie-session"
|
||||
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||
ctx.ipad.w0[1] = 0x69652d73;
|
||||
ctx.ipad.w0[2] = 0x65737369;
|
||||
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||
ctx.ipad.w1[0] = 0;
|
||||
ctx.ipad.w1[1] = 0;
|
||||
ctx.ipad.w1[2] = 0;
|
||||
ctx.ipad.w1[3] = 0;
|
||||
ctx.ipad.w2[0] = 0;
|
||||
ctx.ipad.w2[1] = 0;
|
||||
ctx.ipad.w2[2] = 0;
|
||||
ctx.ipad.w2[3] = 0;
|
||||
ctx.ipad.w3[0] = 0;
|
||||
ctx.ipad.w3[1] = 0;
|
||||
ctx.ipad.w3[2] = 0;
|
||||
ctx.ipad.w3[3] = 0;
|
||||
|
||||
|
||||
ctx.ipad.len += 14;
|
||||
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
u32 intermediate[16] = { 0 };
|
||||
|
||||
intermediate[0] = ctx.opad.h[0];
|
||||
intermediate[1] = ctx.opad.h[1];
|
||||
intermediate[2] = ctx.opad.h[2];
|
||||
intermediate[3] = ctx.opad.h[3];
|
||||
intermediate[4] = ctx.opad.h[4];
|
||||
|
||||
sha1_hmac_init (&ctx, intermediate, 20);
|
||||
sha1_hmac_update (&ctx, s, salt_len);
|
||||
sha1_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = ctx.opad.h[0];
|
||||
const u32 r1 = ctx.opad.h[1];
|
||||
const u32 r2 = ctx.opad.h[2];
|
||||
const u32 r3 = ctx.opad.h[3];
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
@ -26,8 +26,7 @@ static const u64 KERN_TYPE = 29500;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_NOT_ITERATED;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
|
||||
| OPTS_TYPE_PT_GENERATE_BE
|
||||
| OPTS_TYPE_SELF_TEST_DISABLE;
|
||||
| OPTS_TYPE_PT_GENERATE_BE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
static const char *ST_HASH = "eyJ1c2VybmFtZSI6ImFkbWluIn0.YjdgRQ.1OTlf1PD0H9wXsu_qS0aywAJVD8";
|
||||
@ -65,7 +64,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
token.token_cnt = 3;
|
||||
|
||||
token.sep[0] = '.';
|
||||
token.len_min[0] = 0;
|
||||
token.len_min[0] = 0;
|
||||
token.len_max[0] = 27;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_BASE64C;
|
||||
@ -91,11 +90,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
const u8 *hash_pos = token.buf[2];
|
||||
const int hash_len = token.len[2];
|
||||
const int salt_len = salt1_len + 1 + salt2_len;
|
||||
|
||||
|
||||
const bool parse_rc = generic_salt_decode (hashconfig, salt2_pos, salt_len, (u8 *) salt->salt_buf, (int *) &salt->salt_len);
|
||||
|
||||
if (parse_rc == false) return (PARSER_SALT_LENGTH);
|
||||
|
||||
|
||||
|
||||
memcpy (salt->salt_buf, line_buf, salt_len);
|
||||
|
||||
@ -111,7 +110,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
digest[2] = byte_swap_32 (digest[2]);
|
||||
digest[3] = byte_swap_32 (digest[3]);
|
||||
digest[4] = byte_swap_32 (digest[4]);
|
||||
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
@ -134,7 +133,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
base64_encode (int_to_base64url, (const u8 *) tmp_buf, 48, (u8 *) ptr_plain);
|
||||
|
||||
ptr_plain[27] = 0;
|
||||
|
||||
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%s.%s", (char *) salt->salt_buf, (char *) ptr_plain);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user