mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Added hash-mode 14900 = Skip32
This commit is contained in:
parent
dd263c1d20
commit
1b8c2a29f1
299
OpenCL/m14900_a0.cl
Normal file
299
OpenCL/m14900_a0.cl
Normal file
@ -0,0 +1,299 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//too much register pressure
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_simd.cl"
|
||||
|
||||
__constant u8 c_ftable[256] =
|
||||
{
|
||||
0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4,
|
||||
0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9,
|
||||
0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e,
|
||||
0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28,
|
||||
0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68,
|
||||
0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53,
|
||||
0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19,
|
||||
0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2,
|
||||
0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b,
|
||||
0xee, 0xb4, 0x1a, 0xea, 0xd0, 0x91, 0x2f, 0xb8,
|
||||
0x55, 0xb9, 0xda, 0x85, 0x3f, 0x41, 0xbf, 0xe0,
|
||||
0x5a, 0x58, 0x80, 0x5f, 0x66, 0x0b, 0xd8, 0x90,
|
||||
0x35, 0xd5, 0xc0, 0xa7, 0x33, 0x06, 0x65, 0x69,
|
||||
0x45, 0x00, 0x94, 0x56, 0x6d, 0x98, 0x9b, 0x76,
|
||||
0x97, 0xfc, 0xb2, 0xc2, 0xb0, 0xfe, 0xdb, 0x20,
|
||||
0xe1, 0xeb, 0xd6, 0xe4, 0xdd, 0x47, 0x4a, 0x1d,
|
||||
0x42, 0xed, 0x9e, 0x6e, 0x49, 0x3c, 0xcd, 0x43,
|
||||
0x27, 0xd2, 0x07, 0xd4, 0xde, 0xc7, 0x67, 0x18,
|
||||
0x89, 0xcb, 0x30, 0x1f, 0x8d, 0xc6, 0x8f, 0xaa,
|
||||
0xc8, 0x74, 0xdc, 0xc9, 0x5d, 0x5c, 0x31, 0xa4,
|
||||
0x70, 0x88, 0x61, 0x2c, 0x9f, 0x0d, 0x2b, 0x87,
|
||||
0x50, 0x82, 0x54, 0x64, 0x26, 0x7d, 0x03, 0x40,
|
||||
0x34, 0x4b, 0x1c, 0x73, 0xd1, 0xc4, 0xfd, 0x3b,
|
||||
0xcc, 0xfb, 0x7f, 0xab, 0xe6, 0x3e, 0x5b, 0xa5,
|
||||
0xad, 0x04, 0x23, 0x9c, 0x14, 0x51, 0x22, 0xf0,
|
||||
0x29, 0x79, 0x71, 0x7e, 0xff, 0x8c, 0x0e, 0xe2,
|
||||
0x0c, 0xef, 0xbc, 0x72, 0x75, 0x6f, 0x37, 0xa1,
|
||||
0xec, 0xd3, 0x8e, 0x62, 0x8b, 0x86, 0x10, 0xe8,
|
||||
0x08, 0x77, 0x11, 0xbe, 0x92, 0x4f, 0x24, 0xc5,
|
||||
0x32, 0x36, 0x9d, 0xcf, 0xf3, 0xa6, 0xbb, 0xac,
|
||||
0x5e, 0x6c, 0xa9, 0x13, 0x57, 0x25, 0xb5, 0xe3,
|
||||
0xbd, 0xa8, 0x3a, 0x01, 0x05, 0x59, 0x2a, 0x46
|
||||
};
|
||||
|
||||
static void g (__local u8 s_ftable[256], const u32 *key, const int k, const u32 *wx, u32 *out)
|
||||
{
|
||||
const u32 g1 = wx[1];
|
||||
const u32 g2 = wx[0];
|
||||
const u32 g3 = s_ftable[g2 ^ key[(4 * k + 0) % 10]] ^ g1;
|
||||
const u32 g4 = s_ftable[g3 ^ key[(4 * k + 1) % 10]] ^ g2;
|
||||
const u32 g5 = s_ftable[g4 ^ key[(4 * k + 2) % 10]] ^ g3;
|
||||
const u32 g6 = s_ftable[g5 ^ key[(4 * k + 3) % 10]] ^ g4;
|
||||
|
||||
out[0] = g6;
|
||||
out[1] = g5;
|
||||
}
|
||||
|
||||
static u32 skip32 (__local u8 s_ftable[256], const u32 KP, const u32 *key)
|
||||
{
|
||||
u32 wl[2];
|
||||
u32 wr[2];
|
||||
|
||||
wl[0] = (KP >> 8) & 0xff;
|
||||
wl[1] = (KP >> 0) & 0xff;
|
||||
wr[0] = (KP >> 24) & 0xff;
|
||||
wr[1] = (KP >> 16) & 0xff;
|
||||
|
||||
for (u32 i = 0; i < 12; i++)
|
||||
{
|
||||
const u32 k0 = (i * 2) + 0;
|
||||
const u32 k1 = (i * 2) + 1;
|
||||
|
||||
u32 tmp[2];
|
||||
|
||||
g (s_ftable, key, k0, wl, tmp);
|
||||
|
||||
tmp[0] ^= k0;
|
||||
|
||||
wr[0] ^= tmp[0];
|
||||
wr[1] ^= tmp[1];
|
||||
|
||||
g (s_ftable, key, k1, wr, tmp);
|
||||
|
||||
tmp[0] ^= k1;
|
||||
|
||||
wl[0] ^= tmp[0];
|
||||
wl[1] ^= tmp[1];
|
||||
}
|
||||
|
||||
const u32 r = ((wr[1] & 0xff) << 0)
|
||||
| ((wr[0] & 0xff) << 8)
|
||||
| ((wl[1] & 0xff) << 16)
|
||||
| ((wl[0] & 0xff) << 24);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
__kernel void m14900_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* s_ftable
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
u32x w0[4] = { 0 };
|
||||
u32x w1[4] = { 0 };
|
||||
u32x w2[4] = { 0 };
|
||||
u32x w3[4] = { 0 };
|
||||
|
||||
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0[0] >> 0) & 0xff;
|
||||
key[1] = (w0[0] >> 8) & 0xff;
|
||||
key[2] = (w0[0] >> 16) & 0xff;
|
||||
key[3] = (w0[0] >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_M_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m14900_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* s_ftable
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
u32x w0[4] = { 0 };
|
||||
u32x w1[4] = { 0 };
|
||||
u32x w2[4] = { 0 };
|
||||
u32x w3[4] = { 0 };
|
||||
|
||||
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0[0] >> 0) & 0xff;
|
||||
key[1] = (w0[0] >> 8) & 0xff;
|
||||
key[2] = (w0[0] >> 16) & 0xff;
|
||||
key[3] = (w0[0] >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_S_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m14900_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
425
OpenCL/m14900_a1.cl
Normal file
425
OpenCL/m14900_a1.cl
Normal file
@ -0,0 +1,425 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//too much register pressure
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
|
||||
__constant u8 c_ftable[256] =
|
||||
{
|
||||
0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4,
|
||||
0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9,
|
||||
0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e,
|
||||
0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28,
|
||||
0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68,
|
||||
0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53,
|
||||
0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19,
|
||||
0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2,
|
||||
0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b,
|
||||
0xee, 0xb4, 0x1a, 0xea, 0xd0, 0x91, 0x2f, 0xb8,
|
||||
0x55, 0xb9, 0xda, 0x85, 0x3f, 0x41, 0xbf, 0xe0,
|
||||
0x5a, 0x58, 0x80, 0x5f, 0x66, 0x0b, 0xd8, 0x90,
|
||||
0x35, 0xd5, 0xc0, 0xa7, 0x33, 0x06, 0x65, 0x69,
|
||||
0x45, 0x00, 0x94, 0x56, 0x6d, 0x98, 0x9b, 0x76,
|
||||
0x97, 0xfc, 0xb2, 0xc2, 0xb0, 0xfe, 0xdb, 0x20,
|
||||
0xe1, 0xeb, 0xd6, 0xe4, 0xdd, 0x47, 0x4a, 0x1d,
|
||||
0x42, 0xed, 0x9e, 0x6e, 0x49, 0x3c, 0xcd, 0x43,
|
||||
0x27, 0xd2, 0x07, 0xd4, 0xde, 0xc7, 0x67, 0x18,
|
||||
0x89, 0xcb, 0x30, 0x1f, 0x8d, 0xc6, 0x8f, 0xaa,
|
||||
0xc8, 0x74, 0xdc, 0xc9, 0x5d, 0x5c, 0x31, 0xa4,
|
||||
0x70, 0x88, 0x61, 0x2c, 0x9f, 0x0d, 0x2b, 0x87,
|
||||
0x50, 0x82, 0x54, 0x64, 0x26, 0x7d, 0x03, 0x40,
|
||||
0x34, 0x4b, 0x1c, 0x73, 0xd1, 0xc4, 0xfd, 0x3b,
|
||||
0xcc, 0xfb, 0x7f, 0xab, 0xe6, 0x3e, 0x5b, 0xa5,
|
||||
0xad, 0x04, 0x23, 0x9c, 0x14, 0x51, 0x22, 0xf0,
|
||||
0x29, 0x79, 0x71, 0x7e, 0xff, 0x8c, 0x0e, 0xe2,
|
||||
0x0c, 0xef, 0xbc, 0x72, 0x75, 0x6f, 0x37, 0xa1,
|
||||
0xec, 0xd3, 0x8e, 0x62, 0x8b, 0x86, 0x10, 0xe8,
|
||||
0x08, 0x77, 0x11, 0xbe, 0x92, 0x4f, 0x24, 0xc5,
|
||||
0x32, 0x36, 0x9d, 0xcf, 0xf3, 0xa6, 0xbb, 0xac,
|
||||
0x5e, 0x6c, 0xa9, 0x13, 0x57, 0x25, 0xb5, 0xe3,
|
||||
0xbd, 0xa8, 0x3a, 0x01, 0x05, 0x59, 0x2a, 0x46
|
||||
};
|
||||
|
||||
static void g (__local u8 s_ftable[256], const u32 *key, const int k, const u32 *wx, u32 *out)
|
||||
{
|
||||
const u32 g1 = wx[1];
|
||||
const u32 g2 = wx[0];
|
||||
const u32 g3 = s_ftable[g2 ^ key[(4 * k + 0) % 10]] ^ g1;
|
||||
const u32 g4 = s_ftable[g3 ^ key[(4 * k + 1) % 10]] ^ g2;
|
||||
const u32 g5 = s_ftable[g4 ^ key[(4 * k + 2) % 10]] ^ g3;
|
||||
const u32 g6 = s_ftable[g5 ^ key[(4 * k + 3) % 10]] ^ g4;
|
||||
|
||||
out[0] = g6;
|
||||
out[1] = g5;
|
||||
}
|
||||
|
||||
static u32 skip32 (__local u8 s_ftable[256], const u32 KP, const u32 *key)
|
||||
{
|
||||
u32 wl[2];
|
||||
u32 wr[2];
|
||||
|
||||
wl[0] = (KP >> 8) & 0xff;
|
||||
wl[1] = (KP >> 0) & 0xff;
|
||||
wr[0] = (KP >> 24) & 0xff;
|
||||
wr[1] = (KP >> 16) & 0xff;
|
||||
|
||||
for (u32 i = 0; i < 12; i++)
|
||||
{
|
||||
const u32 k0 = (i * 2) + 0;
|
||||
const u32 k1 = (i * 2) + 1;
|
||||
|
||||
u32 tmp[2];
|
||||
|
||||
g (s_ftable, key, k0, wl, tmp);
|
||||
|
||||
tmp[0] ^= k0;
|
||||
|
||||
wr[0] ^= tmp[0];
|
||||
wr[1] ^= tmp[1];
|
||||
|
||||
g (s_ftable, key, k1, wr, tmp);
|
||||
|
||||
tmp[0] ^= k1;
|
||||
|
||||
wl[0] ^= tmp[0];
|
||||
wl[1] ^= tmp[1];
|
||||
}
|
||||
|
||||
const u32 r = ((wr[1] & 0xff) << 0)
|
||||
| ((wr[0] & 0xff) << 8)
|
||||
| ((wl[1] & 0xff) << 16)
|
||||
| ((wl[0] & 0xff) << 24);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
__kernel void m14900_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* s_ftable
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_l_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32 pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
|
||||
|
||||
const u32 pw_len = pw_l_len + pw_r_len;
|
||||
|
||||
/**
|
||||
* concat password candidate
|
||||
*/
|
||||
|
||||
u32 wordl0[4] = { 0 };
|
||||
u32 wordl1[4] = { 0 };
|
||||
u32 wordl2[4] = { 0 };
|
||||
u32 wordl3[4] = { 0 };
|
||||
|
||||
wordl0[0] = pw_buf0[0];
|
||||
wordl0[1] = pw_buf0[1];
|
||||
wordl0[2] = pw_buf0[2];
|
||||
wordl0[3] = pw_buf0[3];
|
||||
wordl1[0] = pw_buf1[0];
|
||||
wordl1[1] = pw_buf1[1];
|
||||
wordl1[2] = pw_buf1[2];
|
||||
wordl1[3] = pw_buf1[3];
|
||||
|
||||
u32 wordr0[4] = { 0 };
|
||||
u32 wordr1[4] = { 0 };
|
||||
u32 wordr2[4] = { 0 };
|
||||
u32 wordr3[4] = { 0 };
|
||||
|
||||
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
|
||||
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
|
||||
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
|
||||
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
|
||||
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
|
||||
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
|
||||
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
|
||||
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
|
||||
|
||||
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
|
||||
}
|
||||
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
u32 w3[4];
|
||||
|
||||
w0[0] = wordl0[0] | wordr0[0];
|
||||
w0[1] = wordl0[1] | wordr0[1];
|
||||
w0[2] = wordl0[2] | wordr0[2];
|
||||
w0[3] = wordl0[3] | wordr0[3];
|
||||
w1[0] = wordl1[0] | wordr1[0];
|
||||
w1[1] = wordl1[1] | wordr1[1];
|
||||
w1[2] = wordl1[2] | wordr1[2];
|
||||
w1[3] = wordl1[3] | wordr1[3];
|
||||
w2[0] = wordl2[0] | wordr2[0];
|
||||
w2[1] = wordl2[1] | wordr2[1];
|
||||
w2[2] = wordl2[2] | wordr2[2];
|
||||
w2[3] = wordl2[3] | wordr2[3];
|
||||
w3[0] = wordl3[0] | wordr3[0];
|
||||
w3[1] = wordl3[1] | wordr3[1];
|
||||
w3[2] = wordl3[2] | wordr3[2];
|
||||
w3[3] = wordl3[3] | wordr3[3];
|
||||
|
||||
/**
|
||||
* Skip32
|
||||
*/
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0[0] >> 0) & 0xff;
|
||||
key[1] = (w0[0] >> 8) & 0xff;
|
||||
key[2] = (w0[0] >> 16) & 0xff;
|
||||
key[3] = (w0[0] >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_M_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m14900_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* s_ftable
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_l_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32 pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
|
||||
|
||||
const u32 pw_len = pw_l_len + pw_r_len;
|
||||
|
||||
/**
|
||||
* concat password candidate
|
||||
*/
|
||||
|
||||
u32 wordl0[4] = { 0 };
|
||||
u32 wordl1[4] = { 0 };
|
||||
u32 wordl2[4] = { 0 };
|
||||
u32 wordl3[4] = { 0 };
|
||||
|
||||
wordl0[0] = pw_buf0[0];
|
||||
wordl0[1] = pw_buf0[1];
|
||||
wordl0[2] = pw_buf0[2];
|
||||
wordl0[3] = pw_buf0[3];
|
||||
wordl1[0] = pw_buf1[0];
|
||||
wordl1[1] = pw_buf1[1];
|
||||
wordl1[2] = pw_buf1[2];
|
||||
wordl1[3] = pw_buf1[3];
|
||||
|
||||
u32 wordr0[4] = { 0 };
|
||||
u32 wordr1[4] = { 0 };
|
||||
u32 wordr2[4] = { 0 };
|
||||
u32 wordr3[4] = { 0 };
|
||||
|
||||
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
|
||||
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
|
||||
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
|
||||
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
|
||||
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
|
||||
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
|
||||
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
|
||||
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
|
||||
|
||||
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
|
||||
}
|
||||
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
u32 w3[4];
|
||||
|
||||
w0[0] = wordl0[0] | wordr0[0];
|
||||
w0[1] = wordl0[1] | wordr0[1];
|
||||
w0[2] = wordl0[2] | wordr0[2];
|
||||
w0[3] = wordl0[3] | wordr0[3];
|
||||
w1[0] = wordl1[0] | wordr1[0];
|
||||
w1[1] = wordl1[1] | wordr1[1];
|
||||
w1[2] = wordl1[2] | wordr1[2];
|
||||
w1[3] = wordl1[3] | wordr1[3];
|
||||
w2[0] = wordl2[0] | wordr2[0];
|
||||
w2[1] = wordl2[1] | wordr2[1];
|
||||
w2[2] = wordl2[2] | wordr2[2];
|
||||
w2[3] = wordl2[3] | wordr2[3];
|
||||
w3[0] = wordl3[0] | wordr3[0];
|
||||
w3[1] = wordl3[1] | wordr3[1];
|
||||
w3[2] = wordl3[2] | wordr3[2];
|
||||
w3[3] = wordl3[3] | wordr3[3];
|
||||
|
||||
/**
|
||||
* Skip32
|
||||
*/
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0[0] >> 0) & 0xff;
|
||||
key[1] = (w0[0] >> 8) & 0xff;
|
||||
key[2] = (w0[0] >> 16) & 0xff;
|
||||
key[3] = (w0[0] >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_S_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m14900_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
359
OpenCL/m14900_a3.cl
Normal file
359
OpenCL/m14900_a3.cl
Normal file
@ -0,0 +1,359 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//too much register pressure
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
|
||||
__constant u8 c_ftable[256] =
|
||||
{
|
||||
0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4,
|
||||
0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9,
|
||||
0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e,
|
||||
0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28,
|
||||
0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68,
|
||||
0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53,
|
||||
0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19,
|
||||
0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2,
|
||||
0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b,
|
||||
0xee, 0xb4, 0x1a, 0xea, 0xd0, 0x91, 0x2f, 0xb8,
|
||||
0x55, 0xb9, 0xda, 0x85, 0x3f, 0x41, 0xbf, 0xe0,
|
||||
0x5a, 0x58, 0x80, 0x5f, 0x66, 0x0b, 0xd8, 0x90,
|
||||
0x35, 0xd5, 0xc0, 0xa7, 0x33, 0x06, 0x65, 0x69,
|
||||
0x45, 0x00, 0x94, 0x56, 0x6d, 0x98, 0x9b, 0x76,
|
||||
0x97, 0xfc, 0xb2, 0xc2, 0xb0, 0xfe, 0xdb, 0x20,
|
||||
0xe1, 0xeb, 0xd6, 0xe4, 0xdd, 0x47, 0x4a, 0x1d,
|
||||
0x42, 0xed, 0x9e, 0x6e, 0x49, 0x3c, 0xcd, 0x43,
|
||||
0x27, 0xd2, 0x07, 0xd4, 0xde, 0xc7, 0x67, 0x18,
|
||||
0x89, 0xcb, 0x30, 0x1f, 0x8d, 0xc6, 0x8f, 0xaa,
|
||||
0xc8, 0x74, 0xdc, 0xc9, 0x5d, 0x5c, 0x31, 0xa4,
|
||||
0x70, 0x88, 0x61, 0x2c, 0x9f, 0x0d, 0x2b, 0x87,
|
||||
0x50, 0x82, 0x54, 0x64, 0x26, 0x7d, 0x03, 0x40,
|
||||
0x34, 0x4b, 0x1c, 0x73, 0xd1, 0xc4, 0xfd, 0x3b,
|
||||
0xcc, 0xfb, 0x7f, 0xab, 0xe6, 0x3e, 0x5b, 0xa5,
|
||||
0xad, 0x04, 0x23, 0x9c, 0x14, 0x51, 0x22, 0xf0,
|
||||
0x29, 0x79, 0x71, 0x7e, 0xff, 0x8c, 0x0e, 0xe2,
|
||||
0x0c, 0xef, 0xbc, 0x72, 0x75, 0x6f, 0x37, 0xa1,
|
||||
0xec, 0xd3, 0x8e, 0x62, 0x8b, 0x86, 0x10, 0xe8,
|
||||
0x08, 0x77, 0x11, 0xbe, 0x92, 0x4f, 0x24, 0xc5,
|
||||
0x32, 0x36, 0x9d, 0xcf, 0xf3, 0xa6, 0xbb, 0xac,
|
||||
0x5e, 0x6c, 0xa9, 0x13, 0x57, 0x25, 0xb5, 0xe3,
|
||||
0xbd, 0xa8, 0x3a, 0x01, 0x05, 0x59, 0x2a, 0x46
|
||||
};
|
||||
|
||||
static void g (__local u8 s_ftable[256], const u32 *key, const int k, const u32 *wx, u32 *out)
|
||||
{
|
||||
const u32 g1 = wx[1];
|
||||
const u32 g2 = wx[0];
|
||||
const u32 g3 = s_ftable[g2 ^ key[(4 * k + 0) % 10]] ^ g1;
|
||||
const u32 g4 = s_ftable[g3 ^ key[(4 * k + 1) % 10]] ^ g2;
|
||||
const u32 g5 = s_ftable[g4 ^ key[(4 * k + 2) % 10]] ^ g3;
|
||||
const u32 g6 = s_ftable[g5 ^ key[(4 * k + 3) % 10]] ^ g4;
|
||||
|
||||
out[0] = g6;
|
||||
out[1] = g5;
|
||||
}
|
||||
|
||||
static u32 skip32 (__local u8 s_ftable[256], const u32 KP, const u32 *key)
|
||||
{
|
||||
u32 wl[2];
|
||||
u32 wr[2];
|
||||
|
||||
wl[0] = (KP >> 8) & 0xff;
|
||||
wl[1] = (KP >> 0) & 0xff;
|
||||
wr[0] = (KP >> 24) & 0xff;
|
||||
wr[1] = (KP >> 16) & 0xff;
|
||||
|
||||
for (u32 i = 0; i < 12; i++)
|
||||
{
|
||||
const u32 k0 = (i * 2) + 0;
|
||||
const u32 k1 = (i * 2) + 1;
|
||||
|
||||
u32 tmp[2];
|
||||
|
||||
g (s_ftable, key, k0, wl, tmp);
|
||||
|
||||
tmp[0] ^= k0;
|
||||
|
||||
wr[0] ^= tmp[0];
|
||||
wr[1] ^= tmp[1];
|
||||
|
||||
g (s_ftable, key, k1, wr, tmp);
|
||||
|
||||
tmp[0] ^= k1;
|
||||
|
||||
wl[0] ^= tmp[0];
|
||||
wl[1] ^= tmp[1];
|
||||
}
|
||||
|
||||
const u32 r = ((wr[1] & 0xff) << 0)
|
||||
| ((wr[0] & 0xff) << 8)
|
||||
| ((wl[1] & 0xff) << 16)
|
||||
| ((wl[0] & 0xff) << 24);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static void m14900m (__local u8 s_ftable[256], u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32 w0l = w0[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32 w0r = ix_create_bft (bfs_buf, il_pos);
|
||||
|
||||
const u32 w0lr = w0l | w0r;
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0lr >> 0) & 0xff;
|
||||
key[1] = (w0lr >> 8) & 0xff;
|
||||
key[2] = (w0lr >> 16) & 0xff;
|
||||
key[3] = (w0lr >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_M_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
static void m14900s (__local u8 s_ftable[256], u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
const u32 KP = salt_bufs[salt_pos].salt_buf[0];
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32 w0l = w0[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32 w0r = ix_create_bft (bfs_buf, il_pos);
|
||||
|
||||
const u32 w0lr = w0l | w0r;
|
||||
|
||||
u32 key[10];
|
||||
|
||||
key[0] = (w0lr >> 0) & 0xff;
|
||||
key[1] = (w0lr >> 8) & 0xff;
|
||||
key[2] = (w0lr >> 16) & 0xff;
|
||||
key[3] = (w0lr >> 24) & 0xff;
|
||||
key[4] = (w0[1] >> 0) & 0xff;
|
||||
key[5] = (w0[1] >> 8) & 0xff;
|
||||
key[6] = (w0[1] >> 16) & 0xff;
|
||||
key[7] = (w0[1] >> 24) & 0xff;
|
||||
key[8] = (w0[2] >> 0) & 0xff;
|
||||
key[9] = (w0[2] >> 8) & 0xff;
|
||||
|
||||
const u32 r = skip32 (s_ftable, KP, key);
|
||||
|
||||
const u32 z = 0;
|
||||
|
||||
COMPARE_S_SIMD (r, z, z, z);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m14900_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* sbox, kbox
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m14900m (s_ftable, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, oldoffice01_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m14900_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 lsz = get_local_size (0);
|
||||
|
||||
/**
|
||||
* sbox, kbox
|
||||
*/
|
||||
|
||||
__local u8 s_ftable[256];
|
||||
|
||||
for (u32 i = lid; i < 256; i += lsz)
|
||||
{
|
||||
s_ftable[i] = c_ftable[i];
|
||||
}
|
||||
|
||||
barrier (CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m14900s (s_ftable, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, oldoffice01_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m14900_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m14900_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const comb_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global oldoffice01_t *oldoffice01_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
@ -14,6 +14,7 @@
|
||||
- Added hash-mode 14600 = LUKS
|
||||
- Added hash-mode 14700 = iTunes Backup < 10.0
|
||||
- Added hash-mode 14800 = iTunes Backup >= 10.0
|
||||
- Added hash-mode 14900 = Skip32
|
||||
|
||||
##
|
||||
## Workarounds
|
||||
|
@ -47,6 +47,7 @@ NVidia users require "NVIDIA Driver" (367.x or later)
|
||||
- SHA-512
|
||||
- SHA-3 (Keccak)
|
||||
- SipHash
|
||||
- Skip32
|
||||
- RipeMD160
|
||||
- Whirlpool
|
||||
- DES (PT = $salt, key = $pass)
|
||||
|
@ -176,7 +176,7 @@ _hashcat ()
|
||||
{
|
||||
local VERSION=3.30
|
||||
|
||||
local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 900 1000 1100 1400 1410 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14700 14800"
|
||||
local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 900 1000 1100 1400 1410 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14700 14800 14900"
|
||||
local ATTACK_MODES="0 1 3 6 7"
|
||||
local OUTFILE_FORMATS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
|
||||
local OPENCL_DEVICE_TYPES="1 2 3"
|
||||
|
@ -1136,6 +1136,8 @@ typedef enum display_len
|
||||
DISPLAY_LEN_MAX_14400 = 40 + 1 + 20,
|
||||
DISPLAY_LEN_MIN_14700 = 15 + 1 + 1 + 1 + 80 + 1 + 1 + 1 + 40 + 1,
|
||||
DISPLAY_LEN_MAX_14700 = 15 + 1 + 2 + 1 + 80 + 1 + 6 + 1 + 40 + 1 + 9 + 1 + 40,
|
||||
DISPLAY_LEN_MIN_14900 = 8 + 1 + 8,
|
||||
DISPLAY_LEN_MAX_14900 = 8 + 1 + 8,
|
||||
DISPLAY_LEN_MIN_99999 = 1,
|
||||
DISPLAY_LEN_MAX_99999 = 55,
|
||||
|
||||
@ -1265,6 +1267,7 @@ typedef enum hash_type
|
||||
HASH_TYPE_LUKS = 55,
|
||||
HASH_TYPE_ITUNES_BACKUP_9 = 56,
|
||||
HASH_TYPE_ITUNES_BACKUP_10 = 57,
|
||||
HASH_TYPE_SKIP32 = 58,
|
||||
|
||||
} hash_type_t;
|
||||
|
||||
@ -1446,6 +1449,7 @@ typedef enum kern_type
|
||||
KERN_TYPE_LUKS_WHIRLPOOL_TWOFISH = 14653,
|
||||
KERN_TYPE_ITUNES_BACKUP_9 = 14700,
|
||||
KERN_TYPE_ITUNES_BACKUP_10 = 14800,
|
||||
KERN_TYPE_SKIP32 = 14900,
|
||||
KERN_TYPE_PLAINTEXT = 99999,
|
||||
|
||||
} kern_type_t;
|
||||
@ -1681,6 +1685,7 @@ int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_bu
|
||||
int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
|
||||
int luks_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig, const int keyslot_idx);
|
||||
int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
|
||||
int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
|
||||
|
||||
/**
|
||||
* hook functions
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "common.h"
|
||||
#include "benchmark.h"
|
||||
|
||||
const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT = 146;
|
||||
const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT = 147;
|
||||
|
||||
const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] =
|
||||
{
|
||||
@ -19,6 +19,7 @@ const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] =
|
||||
1700,
|
||||
5000,
|
||||
10100,
|
||||
14900,
|
||||
6000,
|
||||
6100,
|
||||
6900,
|
||||
|
@ -229,6 +229,7 @@ static const char HT_14400[] = "sha1(CX)";
|
||||
static const char HT_14600[] = "LUKS";
|
||||
static const char HT_14700[] = "iTunes Backup < 10.0";
|
||||
static const char HT_14800[] = "iTunes Backup >= 10.0";
|
||||
static const char HT_14900[] = "Skip32";
|
||||
static const char HT_99999[] = "Plaintext";
|
||||
|
||||
static const char HT_00011[] = "Joomla < 2.5.18";
|
||||
@ -13735,6 +13736,55 @@ int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MA
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig)
|
||||
{
|
||||
if (input_len != DISPLAY_LEN_MIN_14900) return (PARSER_GLOBAL_LENGTH);
|
||||
|
||||
u32 *digest = (u32 *) hash_buf->digest;
|
||||
salt_t *salt = hash_buf->salt;
|
||||
|
||||
/**
|
||||
* parse line
|
||||
*/
|
||||
|
||||
u8 *hash_pos = input_buf;
|
||||
|
||||
u8 *salt_pos = (u8 *) strchr ((const char *) hash_pos, ':');
|
||||
|
||||
if (salt_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED);
|
||||
|
||||
u32 salt_len = salt_pos - hash_pos;
|
||||
|
||||
salt_pos++;
|
||||
|
||||
/**
|
||||
* verify data
|
||||
*/
|
||||
|
||||
if (is_valid_hex_string (hash_pos, 8) == false) return (PARSER_HASH_ENCODING);
|
||||
|
||||
if (is_valid_hex_string (salt_pos, 8) == false) return (PARSER_SALT_ENCODING);
|
||||
|
||||
/**
|
||||
* store data
|
||||
*/
|
||||
|
||||
// digest
|
||||
|
||||
digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]);
|
||||
digest[1] = 0;
|
||||
digest[2] = 0;
|
||||
digest[3] = 0;
|
||||
|
||||
// salt
|
||||
|
||||
salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]);
|
||||
|
||||
salt->salt_len = salt_len / 2; // 4
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* hook functions
|
||||
*/
|
||||
@ -14320,6 +14370,7 @@ char *strhashtype (const u32 hash_mode)
|
||||
case 14600: return ((char *) HT_14600);
|
||||
case 14700: return ((char *) HT_14700);
|
||||
case 14800: return ((char *) HT_14800);
|
||||
case 14900: return ((char *) HT_14900);
|
||||
case 99999: return ((char *) HT_99999);
|
||||
}
|
||||
|
||||
@ -17343,6 +17394,10 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
||||
salt.salt_iter + 1,
|
||||
dpsl);
|
||||
}
|
||||
else if (hash_mode == 14900)
|
||||
{
|
||||
snprintf (out_buf, out_len - 1, "%08x:%08x", digest_buf[0], salt.salt_buf[0]);
|
||||
}
|
||||
else if (hash_mode == 99999)
|
||||
{
|
||||
char *ptr = (char *) digest_buf;
|
||||
@ -21387,6 +21442,22 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
hashconfig->dgst_pos3 = 3;
|
||||
break;
|
||||
|
||||
case 14900: hashconfig->hash_type = HASH_TYPE_SKIP32;
|
||||
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
|
||||
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_ST_GENERATE_LE
|
||||
| OPTS_TYPE_PT_NEVERCRACK;
|
||||
hashconfig->kern_type = KERN_TYPE_SKIP32;
|
||||
hashconfig->dgst_size = DGST_SIZE_4_4;
|
||||
hashconfig->parse_func = skip32_parse_hash;
|
||||
hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE;
|
||||
hashconfig->dgst_pos0 = 0;
|
||||
hashconfig->dgst_pos1 = 1;
|
||||
hashconfig->dgst_pos2 = 2;
|
||||
hashconfig->dgst_pos3 = 3;
|
||||
break;
|
||||
|
||||
case 99999: hashconfig->hash_type = HASH_TYPE_PLAINTEXT;
|
||||
hashconfig->salt_type = SALT_TYPE_NONE;
|
||||
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
@ -21650,6 +21721,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
break;
|
||||
case 14100: hashconfig->pw_min = 24;
|
||||
break;
|
||||
case 14900: hashconfig->pw_min = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
// pw_max
|
||||
@ -21721,6 +21794,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
break;
|
||||
case 14400: hashconfig->pw_max = 24;
|
||||
break;
|
||||
case 14900: hashconfig->pw_max = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -21939,6 +22014,8 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo
|
||||
break;
|
||||
case 14800: salt->salt_len = 20;
|
||||
break;
|
||||
case 14900: salt->salt_len = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
// special esalt handling
|
||||
@ -22215,6 +22292,8 @@ char *hashconfig_benchmark_mask (hashcat_ctx_t *hashcat_ctx)
|
||||
break;
|
||||
case 14100: mask = "?b?b?b?b?b?b?bxxxxxxxxxxxxxxxxx";
|
||||
break;
|
||||
case 14900: mask = "?b?b?b?b?bxxxxx";
|
||||
break;
|
||||
default: mask = "?b?b?b?b?b?b?b";
|
||||
break;
|
||||
}
|
||||
|
@ -162,6 +162,7 @@ static const char *USAGE_BIG[] =
|
||||
" 1760 | HMAC-SHA512 (key = $salt) | Raw Hash, Authenticated",
|
||||
" 14000 | DES (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 14100 | 3DES (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 14900 | Skip32 (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 400 | phpass | Generic KDF",
|
||||
" 8900 | scrypt | Generic KDF",
|
||||
" 11900 | PBKDF2-HMAC-MD5 | Generic KDF",
|
||||
|
@ -29,6 +29,7 @@ use Crypt::Rijndael;
|
||||
use Crypt::Twofish;
|
||||
use Crypt::Mode::ECB;
|
||||
use Crypt::UnixCrypt_XS qw (crypt_rounds fold_password base64_to_int24 block_to_base64 int24_to_base64);
|
||||
use Crypt::Skip32;
|
||||
use MIME::Base64;
|
||||
use Authen::Passphrase::NTHash;
|
||||
use Authen::Passphrase::MySQL323;
|
||||
@ -45,7 +46,7 @@ my $hashcat = "./hashcat";
|
||||
|
||||
my $MAX_LEN = 55;
|
||||
|
||||
my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 133, 140, 141, 150, 160, 200, 300, 400, 500, 900, 1000, 1100, 1300, 1400, 1410, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7100, 7200, 7300, 7400, 7500, 7600, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400, 13500, 13600, 13800, 13900, 14000, 14100, 14400, 14700, 14800, 99999);
|
||||
my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 133, 140, 141, 150, 160, 200, 300, 400, 500, 900, 1000, 1100, 1300, 1400, 1410, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7100, 7200, 7300, 7400, 7500, 7600, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400, 13500, 13600, 13800, 13900, 14000, 14100, 14400, 14700, 14800, 14900, 99999);
|
||||
|
||||
my %is_unicode = map { $_ => 1 } qw(30 40 130 131 132 133 140 141 1000 1100 1430 1440 1441 1730 1740 1731 5500 5600 8000 9400 9500 9600 9700 9800 11600 13500 13800);
|
||||
my %less_fifteen = map { $_ => 1 } qw(500 1600 1800 2400 2410 3200 6300 7400 10500 10700);
|
||||
@ -226,7 +227,7 @@ sub verify
|
||||
$word = substr ($line, $index + 1);
|
||||
}
|
||||
# hash:salt
|
||||
elsif ($mode == 10 || $mode == 11 || $mode == 12 || $mode == 20 || $mode == 21 || $mode == 22 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 112 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1100 || $mode == 1410 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 2410 || $mode == 2611 || $mode == 2711 || $mode == 2811 || $mode == 3100 || $mode == 3610 || $mode == 3710 || $mode == 3720 || $mode == 3800 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 4900 || $mode == 5800 || $mode == 7600 || $mode == 8400 || $mode == 11000 || $mode == 12600 || $mode == 13500 || $mode == 13800 || $mode == 13900 || $mode == 14000 || $mode == 14100 || $mode == 14400)
|
||||
elsif ($mode == 10 || $mode == 11 || $mode == 12 || $mode == 20 || $mode == 21 || $mode == 22 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 112 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1100 || $mode == 1410 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 2410 || $mode == 2611 || $mode == 2711 || $mode == 2811 || $mode == 3100 || $mode == 3610 || $mode == 3710 || $mode == 3720 || $mode == 3800 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 4900 || $mode == 5800 || $mode == 7600 || $mode == 8400 || $mode == 11000 || $mode == 12600 || $mode == 13500 || $mode == 13800 || $mode == 13900 || $mode == 14000 || $mode == 14100 || $mode == 14400 || $mode == 14900)
|
||||
{
|
||||
# get hash
|
||||
my $index1 = index ($line, ":");
|
||||
@ -3305,6 +3306,12 @@ sub passthrough
|
||||
{
|
||||
$tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, 40));
|
||||
}
|
||||
elsif ($mode == 14900)
|
||||
{
|
||||
next if length ($word_buf) != 10;
|
||||
|
||||
$tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, 8));
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ERROR: Unsupported hash type\n";
|
||||
@ -4152,6 +4159,13 @@ sub single
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($mode == 14900)
|
||||
{
|
||||
for (my $i = 1; $i < 8; $i++)
|
||||
{
|
||||
rnd ($mode, 10, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7751,6 +7765,16 @@ END_CODE
|
||||
|
||||
$tmp_hash = sprintf ("\$itunes_backup\$*10*%s*%i*%s*%i*%s", unpack ("H*", $WPKY), $iterations, unpack ("H*", $salt_buf), $DPIC, unpack ("H*", $DPSL));
|
||||
}
|
||||
elsif ($mode == 14900)
|
||||
{
|
||||
my $salt_bin = pack ("H*", $salt_buf);
|
||||
|
||||
my $skip32 = Crypt::Skip32->new ($word_buf);
|
||||
|
||||
my $hash = $skip32->encrypt ($salt_bin);
|
||||
|
||||
$tmp_hash = sprintf ("%08x:%s", unpack ("N*", $hash), $salt_buf);
|
||||
}
|
||||
elsif ($mode == 99999)
|
||||
{
|
||||
$tmp_hash = sprintf ("%s", $word_buf);
|
||||
|
158
tools/test.sh
158
tools/test.sh
@ -9,7 +9,7 @@ TDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# missing hash types: 5200,6251,6261,6271,6281
|
||||
|
||||
HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 200 300 400 500 900 1000 1100 1300 1400 1410 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12100 12200 12300 12400 12600 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 14000 14100 14400 14600 14700 14800 99999"
|
||||
HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 200 300 400 500 900 1000 1100 1300 1400 1410 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12100 12200 12300 12400 12600 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 14000 14100 14400 14600 14700 14800 14900 99999"
|
||||
|
||||
#ATTACK_MODES="0 1 3 6 7"
|
||||
ATTACK_MODES="0 1 3 7"
|
||||
@ -20,7 +20,7 @@ MATCH_PASS_ONLY="2500 5300 5400 6600 6800 8200"
|
||||
|
||||
HASHFILE_ONLY="2500"
|
||||
|
||||
NEVER_CRACK="11600"
|
||||
NEVER_CRACK="11600 14900"
|
||||
|
||||
SLOW_ALGOS="400 500 501 1600 1800 2100 2500 3200 5200 5800 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6251 6261 6271 6281 6300 6400 6500 6600 6700 6800 7100 7200 7400 7900 8200 8800 8900 9000 9100 9200 9300 9400 9500 9600 10000 10300 10500 10700 10900 11300 11600 11900 12000 12100 12200 12300 12400 12500 12800 12900 13000 13200 13400 13600 14600 14700 14800"
|
||||
|
||||
@ -244,22 +244,14 @@ function init()
|
||||
|
||||
min_len=0
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
min_len=7 # means length 8, since we start with 0
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
min_len=7
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
min_len=23
|
||||
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
min_len=9
|
||||
fi
|
||||
|
||||
while read -u 9 pass; do
|
||||
@ -300,22 +292,14 @@ function init()
|
||||
|
||||
min_len=0
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
min_len=7 # means length 8, since we start with 0
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
min_len=7
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
min_len=23
|
||||
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
min_len=9
|
||||
fi
|
||||
|
||||
# generate multiple pass/hash foreach len (2 to 8)
|
||||
@ -686,24 +670,26 @@ function attack_1()
|
||||
|
||||
offset=14
|
||||
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
offset=7
|
||||
elif [ ${hash_type} -eq 5800 ]; then
|
||||
elif [ ${hash_type} -eq 5800 ]; then
|
||||
offset=6
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
offset=6
|
||||
elif [ ${hash_type} -eq 2100 ]; then
|
||||
elif [ ${hash_type} -eq 2100 ]; then
|
||||
offset=11
|
||||
elif [ ${hash_type} -eq 1500 ]; then
|
||||
elif [ ${hash_type} -eq 1500 ]; then
|
||||
offset=7
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
offset=7
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
offset=7
|
||||
elif [ ${hash_type} -eq 14000 ]; then
|
||||
offset=7
|
||||
elif [ ${hash_type} -eq 14100 ]; then
|
||||
offset=23
|
||||
elif [ ${hash_type} -eq 14900 ]; then
|
||||
offset=9
|
||||
fi
|
||||
|
||||
hash_file=${OUTD}/${hash_type}_multihash_combi.txt
|
||||
@ -814,25 +800,18 @@ function attack_3()
|
||||
|
||||
# some algos have a minimum password length
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ];then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
mask_offset=7
|
||||
max=7
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
mask_offset=7
|
||||
max=7
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
mask_offset=23
|
||||
max=23
|
||||
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
mask_offset=9
|
||||
max=9
|
||||
fi
|
||||
|
||||
i=1
|
||||
@ -955,25 +934,18 @@ function attack_3()
|
||||
|
||||
increment_min=1
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
increment_min=8
|
||||
increment_max=9
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
increment_min=8
|
||||
increment_max=8
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
increment_min=24
|
||||
increment_max=24
|
||||
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
increment_min=10
|
||||
increment_max=10
|
||||
fi
|
||||
|
||||
hash_file=${OUTD}/${hash_type}_multihash_bruteforce.txt
|
||||
@ -997,7 +969,13 @@ function attack_3()
|
||||
|
||||
fi
|
||||
|
||||
mask=${mask_3[8]}
|
||||
mask_pos=8
|
||||
|
||||
if [ "${increment_min}" -gt ${mask_pos} ]; then
|
||||
mask_pos=${increment_min}
|
||||
fi
|
||||
|
||||
mask=${mask_3[${mask_pos}]}
|
||||
custom_charsets=""
|
||||
|
||||
# modify "default" mask if needed (and set custom charset to reduce keyspace)
|
||||
@ -1170,22 +1148,14 @@ function attack_6()
|
||||
|
||||
max=8
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
max=6
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
max=6
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
max=6
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
max=6
|
||||
|
||||
fi
|
||||
|
||||
while read -u 9 hash; do
|
||||
@ -1279,18 +1249,20 @@ function attack_6()
|
||||
|
||||
max=9
|
||||
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 14000 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 14100 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 14900 ]; then
|
||||
max=5
|
||||
fi
|
||||
|
||||
if ! contains ${hash_type} ${TIMEOUT_ALGOS}; then
|
||||
@ -1410,22 +1382,14 @@ function attack_7()
|
||||
|
||||
max=8
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
|
||||
if [ "${hash_type}" -eq 2500 ]; then
|
||||
max=5
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14000 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14000 ]; then
|
||||
max=5
|
||||
|
||||
fi
|
||||
|
||||
if [ "${hash_type}" -eq 14100 ]; then
|
||||
|
||||
elif [ "${hash_type}" -eq 14100 ]; then
|
||||
max=5
|
||||
elif [ "${hash_type}" -eq 14900 ]; then
|
||||
max=5
|
||||
|
||||
fi
|
||||
|
||||
i=1
|
||||
@ -1537,18 +1501,20 @@ function attack_7()
|
||||
|
||||
max=9
|
||||
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
if [ ${hash_type} -eq 2500 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
elif [ ${hash_type} -eq 3000 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
elif [ ${hash_type} -eq 7700 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
elif [ ${hash_type} -eq 8500 ]; then
|
||||
max=8
|
||||
elif [ ${hash_type} -eq 14000 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 14100 ]; then
|
||||
max=5
|
||||
elif [ ${hash_type} -eq 14900 ]; then
|
||||
max=5
|
||||
fi
|
||||
|
||||
if ! contains ${hash_type} ${TIMEOUT_ALGOS}; then
|
||||
|
Loading…
Reference in New Issue
Block a user