From 9a3cf88887c8bf0310130e7b7d262b635cd83aba Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 30 Nov 2017 13:41:25 +0100 Subject: [PATCH] Update -m 16100 kernel to enable cracking of sequences 1, 3 and 5 --- OpenCL/m16100_a0.cl | 148 +++++++++++++++++++++++++++++++++++--------- OpenCL/m16100_a1.cl | 148 +++++++++++++++++++++++++++++++++++--------- OpenCL/m16100_a3.cl | 148 +++++++++++++++++++++++++++++++++++--------- 3 files changed, 360 insertions(+), 84 deletions(-) diff --git a/OpenCL/m16100_a0.cl b/OpenCL/m16100_a0.cl index 855e071ee..a0159538a 100644 --- a/OpenCL/m16100_a0.cl +++ b/OpenCL/m16100_a0.cl @@ -65,7 +65,9 @@ __kernel void m16100_mxx (__global pw_t *pws, __constant const kernel_rule_t *ru ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -86,7 +88,7 @@ __kernel void m16100_mxx (__global pw_t *pws, __constant const kernel_rule_t *ru u32 sequence2[4]; u32 sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -112,20 +114,64 @@ __kernel void m16100_mxx (__global pw_t *pws, __constant const kernel_rule_t *ru test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } } @@ -181,7 +227,9 @@ __kernel void m16100_sxx (__global pw_t *pws, __constant const kernel_rule_t *ru ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -202,7 +250,7 @@ __kernel void m16100_sxx (__global pw_t *pws, __constant const kernel_rule_t *ru u32 sequence2[4]; u32 sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -228,20 +276,64 @@ __kernel void m16100_sxx (__global pw_t *pws, __constant const kernel_rule_t *ru test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } } diff --git a/OpenCL/m16100_a1.cl b/OpenCL/m16100_a1.cl index aafbc5fb5..56795b605 100644 --- a/OpenCL/m16100_a1.cl +++ b/OpenCL/m16100_a1.cl @@ -62,7 +62,9 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -79,7 +81,7 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule u32 sequence2[4]; u32 sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -105,20 +107,64 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } } @@ -174,7 +220,9 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -191,7 +239,7 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule u32 sequence2[4]; u32 sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -217,20 +265,64 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } } diff --git a/OpenCL/m16100_a3.cl b/OpenCL/m16100_a3.cl index 3a0e71b0f..3d8ef37b4 100644 --- a/OpenCL/m16100_a3.cl +++ b/OpenCL/m16100_a3.cl @@ -69,7 +69,9 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -96,7 +98,7 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule u32x sequence2[4]; u32x sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -122,20 +124,64 @@ __kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rule test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } } @@ -198,7 +244,9 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; - u32 cl_len = esalt_bufs[digests_offset].ct_data_len; + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; /** * loop @@ -225,7 +273,7 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule u32x sequence2[4]; u32x sequence3[4]; - sequence0[0] = esalt_bufs[digests_offset].sequence_buf[0]; + sequence0[0] = sequence_buf0; sequence0[1] = 0; sequence0[2] = 0; sequence0[3] = 0; @@ -251,20 +299,64 @@ __kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rule test[0] = ctx.h[0] ^ ct_buf[0]; test[1] = ctx.h[1] ^ ct_buf[1]; - const u32 status = ((test[0] >> 0) & 0xff); - const u32 flags = ((test[0] >> 8) & 0xff); - const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 - | ((test[0] >> 24) & 0xff) << 0; - const u32 data_len = ((test[1] >> 0) & 0xff) << 8 - | ((test[1] >> 8) & 0xff) << 0; - - if (((status >= 0x01 && status <= 0x07) || status == 0x21) - && (flags == 0x01 || flags == 0x00) - && (6 + msg_len + data_len == cl_len)) + if (sequence_buf0 == 0x01c0) { - if (atomic_inc (&hashes_shown[digests_offset]) == 0) + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) { - mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } } } }