HCCAPX management: Use advanced hints in message_pair stored by hcxtools about endian bitness of replay counter
Fixed missing code section in -m 2500 and -m 2501 to crack corrupted handshakes with a LE endian bitness base
This commit is contained in:
52
src/hashes.c
52
src/hashes.c
@@ -831,7 +831,54 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
||||
wpa->message_pair = (u8) user_options->hccapx_message_pair;
|
||||
}
|
||||
|
||||
wpa->nonce_error_corrections = user_options->nonce_error_corrections;
|
||||
if (wpa->message_pair & (1 << 4))
|
||||
{
|
||||
// ap-less attack detected, nc not needed
|
||||
|
||||
wpa->nonce_error_corrections = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wpa->message_pair & (1 << 7))
|
||||
{
|
||||
// replaycount not checked, nc needed
|
||||
|
||||
wpa->nonce_error_corrections = user_options->nonce_error_corrections;
|
||||
}
|
||||
else
|
||||
{
|
||||
// replaycount checked, nc not needed, but we allow user overwrites
|
||||
|
||||
if (user_options->nonce_error_corrections_chgd == true)
|
||||
{
|
||||
wpa->nonce_error_corrections = user_options->nonce_error_corrections;
|
||||
}
|
||||
else
|
||||
{
|
||||
wpa->nonce_error_corrections = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// now some optimization related to replay counter endianess
|
||||
// hcxtools has techniques to detect them
|
||||
// since we can not guarantee to get our handshakes from hcxtools we enable both by default
|
||||
// this means that we check both even if both are not set!
|
||||
// however if one of them is set, we can assume that the endianess has been checked and the other one is not needed
|
||||
|
||||
wpa->detected_le = 1;
|
||||
wpa->detected_be = 1;
|
||||
|
||||
if (wpa->message_pair & (1 << 5))
|
||||
{
|
||||
wpa->detected_le = 1;
|
||||
wpa->detected_be = 0;
|
||||
}
|
||||
else if (wpa->message_pair & (1 << 6))
|
||||
{
|
||||
wpa->detected_le = 0;
|
||||
wpa->detected_be = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1652,6 +1699,9 @@ int hashes_init_selftest (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
wpa_t *wpa = (wpa_t *) st_esalts_buf;
|
||||
|
||||
wpa->detected_le = 1;
|
||||
wpa->detected_be = 0;
|
||||
|
||||
wpa->nonce_error_corrections = 3;
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
|
||||
|
||||
@@ -396,7 +396,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break;
|
||||
case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = hc_strtoul (optarg, NULL, 10);
|
||||
user_options->hccapx_message_pair_chgd = true; break;
|
||||
case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = hc_strtoul (optarg, NULL, 10); break;
|
||||
case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = hc_strtoul (optarg, NULL, 10);
|
||||
user_options->nonce_error_corrections_chgd = true; break;
|
||||
case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break;
|
||||
case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break;
|
||||
case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = hc_strtoul (optarg, NULL, 10); break;
|
||||
|
||||
Reference in New Issue
Block a user