Fixed detection of unique ESSID in WPA-PMKID-* parser

pull/1678/head
Jens Steube 6 years ago
parent 0339b3bca0
commit 466ea8eaba

@ -210,6 +210,11 @@ __kernel void m16800_loop (__global pw_t *pws, __global const kernel_rule_t *rul
}
__kernel void m16800_comp (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global wpa_pbkdf2_tmp_t *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 wpa_pmkid_t *wpa_pmkid_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 u64 gid_max)
{
// not in use here, special case...
}
__kernel void m16800_aux1 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global wpa_pbkdf2_tmp_t *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 wpa_pmkid_t *wpa_pmkid_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 u64 gid_max)
{
const u64 gid = get_global_id (0);
const u64 lid = get_local_id (0);
@ -235,11 +240,17 @@ __kernel void m16800_comp (__global pw_t *pws, __global const kernel_rule_t *rul
w[14] = 0;
w[15] = 0;
const u32 digest_pos = loop_pos;
const u32 digest_cur = digests_offset + digest_pos;
__global const wpa_pmkid_t *wpa_pmkid = &wpa_pmkid_bufs[digest_cur];
sha1_hmac_ctx_t sha1_hmac_ctx;
sha1_hmac_init (&sha1_hmac_ctx, w, 32);
sha1_hmac_update_global_swap (&sha1_hmac_ctx, wpa_pmkid_bufs[digests_offset].pmkid_data, 20);
sha1_hmac_update_global_swap (&sha1_hmac_ctx, wpa_pmkid->pmkid_data, 20);
sha1_hmac_final (&sha1_hmac_ctx);

@ -110,11 +110,17 @@ __kernel void m16801_comp (__global pw_t *pws, __global const kernel_rule_t *rul
w[14] = 0;
w[15] = 0;
const u32 digest_pos = loop_pos;
const u32 digest_cur = digests_offset + digest_pos;
__global const wpa_pmkid_t *wpa_pmkid = &wpa_pmkid_bufs[digest_cur];
sha1_hmac_ctx_t sha1_hmac_ctx;
sha1_hmac_init (&sha1_hmac_ctx, w, 32);
sha1_hmac_update_global_swap (&sha1_hmac_ctx, wpa_pmkid_bufs[digests_offset].pmkid_data, 20);
sha1_hmac_update_global_swap (&sha1_hmac_ctx, wpa_pmkid->pmkid_data, 20);
sha1_hmac_final (&sha1_hmac_ctx);

@ -27214,7 +27214,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
case 16800: hashconfig->hash_type = HASH_TYPE_WPA_PMKID_PBKDF2;
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_AUX1;
hashconfig->kern_type = KERN_TYPE_WPA_PMKID_PBKDF2;
hashconfig->dgst_size = DGST_SIZE_4_4;
hashconfig->parse_func = wpa_pmkid_pbkdf2_parse_hash;
@ -27231,7 +27232,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
case 16801: hashconfig->hash_type = HASH_TYPE_WPA_PMKID_PMK;
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_AUX1;
hashconfig->kern_type = KERN_TYPE_WPA_PMKID_PMK;
hashconfig->dgst_size = DGST_SIZE_4_4;
hashconfig->parse_func = wpa_pmkid_pmk_parse_hash;

@ -1440,6 +1440,22 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
if (status_ctx->run_thread_level2 == false) break;
}
}
else if ((hashconfig->hash_mode == 16800) || (hashconfig->hash_mode == 16801))
{
const u32 loops_cnt = hashes->salts_buf[salt_pos].digests_cnt;
for (u32 loops_pos = 0; loops_pos < loops_cnt; loops_pos++)
{
device_param->kernel_params_buf32[28] = loops_pos;
device_param->kernel_params_buf32[29] = loops_cnt;
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX1, pws_cnt, false, 0);
if (CL_rc == -1) return -1;
if (status_ctx->run_thread_level2 == false) break;
}
}
else
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_3, pws_cnt, false, 0);

@ -432,6 +432,15 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (CL_rc == -1) return -1;
}
else if ((hashconfig->hash_mode == 16800) || (hashconfig->hash_mode == 16801))
{
device_param->kernel_params_buf32[28] = 0;
device_param->kernel_params_buf32[29] = 1;
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX1, 1, false, 0);
if (CL_rc == -1) return -1;
}
else
{
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_3, 1, false, 0);

Loading…
Cancel
Save