Skip to content

Commit 1eb9942

Browse files
committed
added EAPOL AUTHENTICATIN LEN MAX measurement
1 parent e10c312 commit 1eb9942

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

hcxpcapngtool.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ static int endianness;
148148
static uint16_t versionmajor;
149149
static uint16_t versionminor;
150150

151+
static uint16_t eapolm1authlen;
152+
static uint16_t eapolm2authlen;
153+
static uint16_t eapolm3authlen;
154+
static uint16_t eapolm4authlen;
155+
151156
static int opensslversionmajor;
152157
static int opensslversionminor;
153158

@@ -636,20 +641,24 @@ eapolm1count = 0;
636641
eapolm1kdv0count = 0;
637642
eapolm1ancount = 0;
638643
eapolm1errorcount = 0;
644+
eapolm1authlen = 0;
639645
eapolm2count = 0;
640646
eapolm2oversizedcount = 0;
641647
eapolm2kdv0count = 0;
642648
eapolm2ftpskcount = 0;
643649
eapolm2errorcount = 0;
650+
eapolm2authlen = 0;
644651
eapolm3count = 0;
645652
eapolm3oversizedcount = 0;
646653
eapolm3kdv0count = 0;
647654
eapolm3errorcount = 0;
655+
eapolm3authlen = 0;
648656
eapolm4count = 0;
649657
eapolm4oversizedcount = 0;
650658
eapolm4zeroedcount = 0;
651659
eapolm4kdv0count = 0;
652660
eapolm4errorcount = 0;
661+
eapolm4authlen = 0;
653662
eapolwrittencount = 0;
654663
eapolnotwrittencount = 0;
655664
eapolncwrittencount = 0;
@@ -863,15 +872,19 @@ if(eapolnccount == 0)
863872
fprintf(stdout, "EAPOL ANONCE error corrections (NC)......: not detected\n");
864873
if(rcgapmax > 0) fprintf(stdout, "REPLAYCOUNT gap (measured maximum).......: %" PRIu64 "\n", rcgapmax);
865874
}
875+
fprintf(stdout, "EAPOL M1 authentication length (max).....: %" PRIu16 "\n", eapolm1authlen);
866876
if(eapolm1count > 0) fprintf(stdout, "EAPOL M1 messages (total)................: %ld\n", eapolm1count);
867877
if(eapolm1kdv0count > 0) fprintf(stdout, "EAPOL M1 messages (KDV:0 AKM defined)....: %ld (not supported by hashcat/JtR)\n", eapolm1kdv0count);
878+
fprintf(stdout, "EAPOL M2 authentication length (max).....: %" PRIu16 "\n", eapolm2authlen);
868879
if(eapolm2count > 0) fprintf(stdout, "EAPOL M2 messages (total)................: %ld\n", eapolm2count);
869880
if(eapolm2oversizedcount > 0) fprintf(stdout, "EAPOL M2 messages (oversized)............: %ld\n", eapolm2oversizedcount);
870881
if(eapolm2kdv0count > 0) fprintf(stdout, "EAPOL M2 messages (KDV:0 AKM defined)....: %ld (not supported by hashcat/JtR)\n", eapolm2kdv0count);
871882
if(eapolm2ftpskcount > 0) fprintf(stdout, "EAPOL M2 messages (FT using PSK).........: %ld (JtR)\n", eapolm2ftpskcount);
883+
fprintf(stdout, "EAPOL M3 authentication length (max).....: %" PRIu16 "\n", eapolm3authlen);
872884
if(eapolm3count > 0) fprintf(stdout, "EAPOL M3 messages (total)................: %ld\n", eapolm3count);
873885
if(eapolm3oversizedcount > 0) fprintf(stdout, "EAPOL M3 messages (oversized)............: %ld\n", eapolm3oversizedcount);
874886
if(eapolm3kdv0count > 0) fprintf(stdout, "EAPOL M3 messages (KDV:0 AKM defined)....: %ld (not supported by hashcat/JtR)\n", eapolm3kdv0count);
887+
fprintf(stdout, "EAPOL M4 authentication length (max).....: %" PRIu16 "\n", eapolm4authlen);
875888
if(eapolm4count > 0) fprintf(stdout, "EAPOL M4 messages (total)................: %ld\n", eapolm4count);
876889
if(eapolm4oversizedcount > 0) fprintf(stdout, "EAPOL M4 messages (oversized)............: %ld\n", eapolm4oversizedcount);
877890
if(eapolm4zeroedcount > 0) fprintf(stdout, "EAPOL M4 messages (zeroed NONCE).........: %ld\n", eapolm4zeroedcount);
@@ -3568,6 +3581,7 @@ eapauth = (eapauth_t*)eapauthptr;
35683581
authlen = ntohs(eapauth->len);
35693582
if(authlen == 0) return;
35703583
if(authlen +EAPAUTH_SIZE > restlen) return;
3584+
if(authlen > eapolm4authlen) eapolm4authlen = authlen;
35713585
if((authlen +EAPAUTH_SIZE) > EAPOL_AUTHLEN_MAX)
35723586
{
35733587
eapolm4oversizedcount++;
@@ -3732,6 +3746,7 @@ if((authlen +EAPAUTH_SIZE) > EAPOL_AUTHLEN_MAX)
37323746
eapolm3oversizedcount++;
37333747
return;
37343748
}
3749+
if(authlen > eapolm3authlen) eapolm3authlen = authlen;
37353750
wpakptr = eapauthptr +EAPAUTH_SIZE;
37363751
wpak = (wpakey_t*)wpakptr;
37373752
keyver = ntohs(wpak->keyinfo) & WPA_KEY_INFO_TYPE_MASK;
@@ -3915,6 +3930,7 @@ eapauth = (eapauth_t*)eapauthptr;
39153930
authlen = ntohs(eapauth->len);
39163931
if(authlen == 0) return;
39173932
if(authlen +EAPAUTH_SIZE > restlen) return;
3933+
if(authlen > eapolm2authlen) eapolm2authlen = authlen;
39183934
wpakptr = eapauthptr +EAPAUTH_SIZE;
39193935
wpak = (wpakey_t*)wpakptr;
39203936
keyver = ntohs(wpak->keyinfo) & WPA_KEY_INFO_TYPE_MASK;
@@ -4119,6 +4135,7 @@ if(authlen > restlen)
41194135
eapolm1errorcount++;
41204136
return;
41214137
}
4138+
if(authlen > eapolm1authlen) eapolm1authlen = authlen;
41224139
wpakptr = eapauthptr +EAPAUTH_SIZE;
41234140
wpak = (wpakey_t*)wpakptr;
41244141
keyver = ntohs(wpak->keyinfo) & WPA_KEY_INFO_TYPE_MASK;

0 commit comments

Comments
 (0)