Skip to content

Commit

Permalink
better handling of garbage hccap and hccapx files
Browse files Browse the repository at this point in the history
  • Loading branch information
ZerBea committed Dec 20, 2023
1 parent 3b9a8a6 commit 58d9bc2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions hcxhashtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,15 +1992,18 @@ for(c = 0; c < hccapxrecords; c++)
}
if(keyver != hccapxptr->keyver)
{
correctedcount++;
readerrorcount++;
if(keyver > 3) continue;
if(keyver == 0) continue;
correctedcount++;
}
eapa = (eapauth_t*)hccapxptr->eapol;
keylen = ntohs(eapa->len) +EAPAUTH_SIZE;
if(keylen != hccapxptr->eapol_len)
{
correctedcount++;
readerrorcount++;
if(keylen > 255) continue;
correctedcount++;
}
memcpy(zeiger->ap, hccapxptr->ap, 6);
memcpy(zeiger->client, hccapxptr->client, 6);
Expand Down Expand Up @@ -2068,15 +2071,18 @@ for(c = 0; c < hccaprecords; c++)
}
if(keyver != hccapptr->keyver)
{
correctedcount++;
readerrorcount++;
if(keyver > 3) continue;
if(keyver == 0) continue;
correctedcount++;
}
eapa = (eapauth_t*)hccapptr->eapol;
keylen = ntohs(eapa->len) +EAPAUTH_SIZE;
if(keylen != hccapptr->eapol_size)
{
correctedcount++;
readerrorcount++;
if(keylen > 255) continue;
correctedcount++;
continue;
}
memcpy(zeiger->ap, hccapptr->ap, 6);
Expand Down

0 comments on commit 58d9bc2

Please sign in to comment.