1
mirror of https://github.com/hashcat/hashcat synced 2025-03-22 21:14:22 +01:00

Use both LE and BE modes for nonce error correction if none or both modes are set

This commit is contained in:
jsteube 2019-04-18 22:50:53 +02:00
parent 5b97fe7514
commit 75b92c1ab1
2 changed files with 630 additions and 468 deletions

@ -376,12 +376,20 @@ KERNEL_FQ void m02500_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -396,6 +404,24 @@ KERNEL_FQ void m02500_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -445,6 +471,7 @@ KERNEL_FQ void m02500_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
}
}
}
}
KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t))
{
@ -534,12 +561,20 @@ KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -554,6 +589,24 @@ KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -598,6 +651,7 @@ KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
}
}
}
}
KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t))
{
@ -723,12 +777,20 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -743,6 +805,24 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -857,3 +937,4 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)
}
}
}
}

@ -246,12 +246,20 @@ KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -266,6 +274,24 @@ KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -315,6 +341,7 @@ KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
}
}
}
}
KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
{
@ -404,12 +431,20 @@ KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -424,6 +459,24 @@ KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -468,6 +521,7 @@ KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
}
}
}
}
KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
{
@ -593,12 +647,20 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
| pke[24] >> 8;
}
u32 bo_loops = wpa_eapol->detected_le + wpa_eapol->detected_be;
bo_loops = (bo_loops == 0) ? 2 : bo_loops;
const u32 nonce_error_corrections = wpa_eapol->nonce_error_corrections;
for (u32 nonce_error_correction = 0; nonce_error_correction <= nonce_error_corrections; nonce_error_correction++)
{
for (u32 bo_pos = 0; bo_pos < bo_loops; bo_pos++)
{
u32 t = to;
if (bo_loops == 1)
{
if (wpa_eapol->detected_le == 1)
{
t -= nonce_error_corrections / 2;
@ -613,6 +675,24 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
t = hc_swap32_S (t);
}
}
else
{
if (bo_pos == 0)
{
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
}
else if (bo_pos == 1)
{
t = hc_swap32_S (t);
t -= nonce_error_corrections / 2;
t += nonce_error_correction;
t = hc_swap32_S (t);
}
}
if (wpa_eapol->nonce_compare < 0)
{
@ -727,3 +807,4 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t))
}
}
}
}