Skip to content

Commit d7fb2ff

Browse files
committed
Fixed both a false positive and a false negative in -m 21800. Previously,
only the first hash in a multihash list was marked as cracked, regardless of which hash was actually cracked. For example, if the second hash was cracked, it incorrectly marked the first as cracked and left the second uncracked. This issue only affected beta versions and only in multihash cracking mode. Added deep-comp kernel support for Kerberos modes 28800 and 28900, enabling multihash cracking for the same user in the same domain, even if the password was changed or the recording was bad. Added a rule ensuring that device buffer sizes for password candidates, hooks, and transport (tmps) must be smaller than 1/4 of the maximum allocatable memory. If not, hashcat now automatically reduces kernel-accel down to 1, then halves the number of threads and restores kernel-accel up to its maximum, repeating until the size requirement is met. Fixed salt length limit verification for -m 20712. Fixed password length limit for -m 14400. Fixed unit test salt generator for -m 21100, which could produce duplicate hashes under certain conditions. Added the OPTS_TYPE_NATIVE_THREADS flag to the following hash modes (after benchmarking): 7700, 7701, 9000, 1375x, 1376x, 14800, 19500, 23900.
1 parent f5fe1ad commit d7fb2ff

20 files changed

Lines changed: 46 additions & 15 deletions

OpenCL/m21800-pure.cl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,12 @@ KERNEL_FQ KERNEL_FA void m21800_comp (KERN_ATTR_TMPS_ESALT (electrum_tmp_t, elec
655655

656656
if ((entropy >= MIN_ENTROPY) && (entropy <= MAX_ENTROPY))
657657
{
658-
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
658+
if (hc_atomic_inc (&hashes_shown[digest_cur]) == 0)
659659
{
660-
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
660+
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, digest_cur, gid, 0, 0, 0);
661661
}
662662

663-
return;
663+
//return;
664664
}
665665
}
666666
}
@@ -676,11 +676,11 @@ KERNEL_FQ KERNEL_FA void m21800_comp (KERN_ATTR_TMPS_ESALT (electrum_tmp_t, elec
676676
((tmp[0] == 0x7b) && (tmp[1] == 0x0d) && (tmp[2] == 0x0a) && (tmp[3] == 0x20) &&
677677
(tmp[4] == 0x20) && (tmp[5] == 0x20) && (tmp[6] == 0x20) && (tmp[7] == 0x22)))
678678
{
679-
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
679+
if (hc_atomic_inc (&hashes_shown[digest_cur]) == 0)
680680
{
681-
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
681+
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, digest_cur, gid, 0, 0, 0);
682682
}
683683

684-
return;
684+
//return;
685685
}
686686
}

src/backend.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16329,10 +16329,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
1632916329
// let's add some extra space just to be sure.
1633016330
// now depends on the kernel-accel value (where scrypt and similar benefits), but also hard minimum 64mb and maximum 1024mb limit
1633116331
// let's see if we still need this now that we have low-level API to report free memory
16332+
// we don't want these get too big. if a plugin requires really a lot of memory, the extra buffer should be used instead.
1633216333

16333-
if (size_pws > device_param->device_maxmem_alloc) memory_limit_hit = 1;
16334-
if (size_tmps > device_param->device_maxmem_alloc) memory_limit_hit = 1;
16335-
if (size_hooks > device_param->device_maxmem_alloc) memory_limit_hit = 1;
16334+
if (size_pws > device_param->device_maxmem_alloc / 4) memory_limit_hit = 1;
16335+
if (size_tmps > device_param->device_maxmem_alloc / 4) memory_limit_hit = 1;
16336+
if (size_hooks > device_param->device_maxmem_alloc / 4) memory_limit_hit = 1;
1633616337

1633716338
// work around, for some reason apple opencl can't have buffers larger 2^31
1633816339
// typically runs into trap 6

src/interface.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
273273
CHECK_MANDATORY (module_ctx->module_hash_encode);
274274
}
275275

276+
// check deep comp kernel requirements
277+
if (hashconfig->opts_type & OPTS_TYPE_DEEP_COMP_KERNEL)
278+
{
279+
CHECK_MANDATORY (module_ctx->module_deep_comp_kernel);
280+
}
281+
276282
#undef CHECK_MANDATORY
277283

278284
if (user_options->keyboard_layout_mapping)

src/modules/module_07700.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2525
| OPTI_TYPE_NOT_ITERATED;
2626
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2727
| OPTS_TYPE_PT_GENERATE_LE
28+
| OPTS_TYPE_NATIVE_THREADS
2829
| OPTS_TYPE_PT_UPPER
2930
| OPTS_TYPE_ST_UPPER;
3031
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;

src/modules/module_07701.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2525
| OPTI_TYPE_NOT_ITERATED;
2626
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2727
| OPTS_TYPE_PT_GENERATE_LE
28+
| OPTS_TYPE_NATIVE_THREADS
2829
| OPTS_TYPE_PT_UPPER
2930
| OPTS_TYPE_ST_UPPER;
3031
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;

src/modules/module_09000.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static const u64 KERN_TYPE = 9000;
2222
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
2323
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2424
| OPTS_TYPE_PT_GENERATE_LE
25+
| OPTS_TYPE_NATIVE_THREADS
2526
| OPTS_TYPE_BINARY_HASHFILE
2627
| OPTS_TYPE_AUTODETECT_DISABLE
2728
| OPTS_TYPE_DYNAMIC_SHARED;

src/modules/module_13751.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2727
| OPTI_TYPE_REGISTER_LIMIT;
2828
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2929
| OPTS_TYPE_PT_GENERATE_LE
30+
| OPTS_TYPE_NATIVE_THREADS
3031
| OPTS_TYPE_BINARY_HASHFILE
3132
| OPTS_TYPE_LOOP_EXTENDED
3233
| OPTS_TYPE_MP_MULTI_DISABLE

src/modules/module_13752.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2727
| OPTI_TYPE_REGISTER_LIMIT;
2828
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2929
| OPTS_TYPE_PT_GENERATE_LE
30+
| OPTS_TYPE_NATIVE_THREADS
3031
| OPTS_TYPE_BINARY_HASHFILE
3132
| OPTS_TYPE_LOOP_EXTENDED
3233
| OPTS_TYPE_MP_MULTI_DISABLE

src/modules/module_13753.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2727
| OPTI_TYPE_REGISTER_LIMIT;
2828
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2929
| OPTS_TYPE_PT_GENERATE_LE
30+
| OPTS_TYPE_NATIVE_THREADS
3031
| OPTS_TYPE_BINARY_HASHFILE
3132
| OPTS_TYPE_LOOP_EXTENDED
3233
| OPTS_TYPE_MP_MULTI_DISABLE

src/modules/module_13761.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
2727
| OPTI_TYPE_REGISTER_LIMIT;
2828
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
2929
| OPTS_TYPE_PT_GENERATE_LE
30+
| OPTS_TYPE_NATIVE_THREADS
3031
| OPTS_TYPE_BINARY_HASHFILE
3132
| OPTS_TYPE_LOOP_EXTENDED
3233
| OPTS_TYPE_MP_MULTI_DISABLE

0 commit comments

Comments
 (0)