1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-04 11:52:32 +00:00

Update hccapx format to version 4

This commit is contained in:
jsteube 2017-02-21 20:07:18 +01:00
parent 2dd027af65
commit 9b08d4af0f
4 changed files with 10 additions and 9 deletions

View File

@ -789,7 +789,7 @@ typedef struct wpa
u32 pke[25]; u32 pke[25];
u32 eapol[64 + 16]; u32 eapol[64 + 16];
u16 eapol_len; u16 eapol_len;
u8 authenticated; u8 message_pair;
u8 keyver; u8 keyver;
u8 orig_mac_ap[6]; u8 orig_mac_ap[6];
u8 orig_mac_sta[6]; u8 orig_mac_sta[6];

View File

@ -177,7 +177,7 @@ typedef struct wpa
u32 pke[25]; u32 pke[25];
u32 eapol[64 + 16]; u32 eapol[64 + 16];
u16 eapol_len; u16 eapol_len;
u8 authenticated; u8 message_pair;
u8 keyver; u8 keyver;
u8 orig_mac_ap[6]; u8 orig_mac_ap[6];
u8 orig_mac_sta[6]; u8 orig_mac_sta[6];
@ -812,6 +812,7 @@ typedef struct struct_psafe2_hdr
} psafe2_hdr; } psafe2_hdr;
#define HCCAPX_VERSION 4
#define HCCAPX_SIGNATURE 0x58504348 // HCPX #define HCCAPX_SIGNATURE 0x58504348 // HCPX
// this is required to force mingw to accept the packed attribute // this is required to force mingw to accept the packed attribute
@ -821,7 +822,7 @@ struct hccapx
{ {
u32 signature; u32 signature;
u32 version; u32 version;
u8 authenticated; u8 message_pair;
u8 essid_len; u8 essid_len;
u8 essid[32]; u8 essid[32];
u8 keyver; u8 keyver;

View File

@ -2715,7 +2715,7 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED
if (in.signature != HCCAPX_SIGNATURE) return (PARSER_HCCAPX_SIGNATURE); if (in.signature != HCCAPX_SIGNATURE) return (PARSER_HCCAPX_SIGNATURE);
if (in.version != 3) return (PARSER_HCCAPX_VERSION); if (in.version != HCCAPX_VERSION) return (PARSER_HCCAPX_VERSION);
if (in.eapol_len < 1 || in.eapol_len > 255) return (PARSER_HCCAPX_EAPOL_LEN); if (in.eapol_len < 1 || in.eapol_len > 255) return (PARSER_HCCAPX_EAPOL_LEN);
@ -2780,7 +2780,7 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED
memcpy (wpa->orig_nonce_ap, in.nonce_ap, 32); memcpy (wpa->orig_nonce_ap, in.nonce_ap, 32);
memcpy (wpa->orig_nonce_sta, in.nonce_sta, 32); memcpy (wpa->orig_nonce_sta, in.nonce_sta, 32);
wpa->authenticated = in.authenticated; wpa->message_pair = in.message_pair;
wpa->keyver = in.keyver; wpa->keyver = in.keyver;
@ -14857,7 +14857,7 @@ void to_hccapx_t (hashcat_ctx_t *hashcat_ctx, hccapx_t *hccapx, const u32 salt_p
memset (hccapx, 0, sizeof (hccapx_t)); memset (hccapx, 0, sizeof (hccapx_t));
hccapx->signature = HCCAPX_SIGNATURE; hccapx->signature = HCCAPX_SIGNATURE;
hccapx->version = 3; hccapx->version = HCCAPX_VERSION;
const salt_t *salt = &salts_buf[salt_pos]; const salt_t *salt = &salts_buf[salt_pos];
@ -14868,7 +14868,7 @@ void to_hccapx_t (hashcat_ctx_t *hashcat_ctx, hccapx_t *hccapx, const u32 salt_p
wpa_t *wpas = (wpa_t *) esalts_buf; wpa_t *wpas = (wpa_t *) esalts_buf;
wpa_t *wpa = &wpas[salt_pos]; wpa_t *wpa = &wpas[salt_pos];
hccapx->authenticated = wpa->authenticated; hccapx->message_pair = wpa->message_pair;
hccapx->keyver = wpa->keyver; hccapx->keyver = wpa->keyver;
hccapx->eapol_len = wpa->eapol_len; hccapx->eapol_len = wpa->eapol_len;

View File

@ -4930,7 +4930,7 @@ sub gen_hash
# format the binary output (.hccapx version 3) # format the binary output (.hccapx version 3)
# #
my $HCCAPX_VERSION = 3; my $HCCAPX_VERSION = 4;
# signature # signature
$hash_buf = "HCPX"; $hash_buf = "HCPX";
@ -4939,7 +4939,7 @@ sub gen_hash
$hash_buf .= pack ("L<", $HCCAPX_VERSION); $hash_buf .= pack ("L<", $HCCAPX_VERSION);
# authenticated # authenticated
$hash_buf .= pack ("C", 1); $hash_buf .= pack ("C", 0);
# essid length # essid length
$essid_len = length ($salt_buf); $essid_len = length ($salt_buf);