-
Notifications
You must be signed in to change notification settings - Fork 392
/
hcxpcapngtool.c
6979 lines (6731 loc) · 251 KB
/
hcxpcapngtool.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <inttypes.h>
#include <libgen.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#if defined (__APPLE__) || defined(__OpenBSD__)
#include <sys/socket.h>
#endif
#ifdef _WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
#include <openssl/core.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/params.h>
#include <openssl/types.h>
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define BIG_ENDIAN_HOST
#endif
#include "include/hcxpcapngtool.h"
#include "include/ieee80211.c"
#include "include/strings.c"
#include "include/byteops.c"
#include "include/fileops.c"
#include "include/hashops.c"
#include "include/pcap.c"
#ifdef WANTZLIB
#include "include/gzops.c"
#endif
/*===========================================================================*/
struct hccap_s
{
char essid[36];
unsigned char ap[6];
unsigned char client[6];
unsigned char snonce[32];
unsigned char anonce[32];
unsigned char eapol[256];
int eapol_size;
int keyver;
unsigned char keymic[16];
};
typedef struct hccap_s hccap_t;
#define HCCAP_SIZE (sizeof(hccap_t))
/*===========================================================================*/
struct hccapx_s
{
uint32_t signature;
#define HCCAPX_SIGNATURE 0x58504348
uint32_t version;
#define HCCAPX_VERSION 4
uint8_t message_pair;
uint8_t essid_len;
uint8_t essid[32];
uint8_t keyver;
uint8_t keymic[16];
uint8_t ap[6];
uint8_t anonce[32];
uint8_t client[6];
uint8_t snonce[32];
uint16_t eapol_len;
uint8_t eapol[256];
} __attribute__((packed));
typedef struct hccapx_s hccapx_t;
#define HCCAPX_SIZE (sizeof(hccapx_t))
/*===========================================================================*/
/*===========================================================================*/
/* global var */
static EVP_MAC *hmac;
static EVP_MAC *cmac;
static EVP_MAC_CTX *ctxhmac;
static EVP_MAC_CTX *ctxcmac;
static OSSL_PARAM paramsmd5[3];
static OSSL_PARAM paramssha1[3];
static OSSL_PARAM paramssha256[3];
static OSSL_PARAM paramsaes128[3];
static size_t magicblockcount;
static maclist_t *aplist, *aplistptr;
static messagelist_t *messagelist;
static handshakelist_t *handshakelist, *handshakelistptr;
static pmkidlist_t *pmkidlist, *pmkidlistptr;
static eapmd5msglist_t *eapmd5msglist;
static eapmd5hashlist_t *eapmd5hashlist, *eapmd5hashlistptr;
static eapleaphashlist_t *eapleaphashlist, *eapleaphashlistptr;
static eapleapmsglist_t *eapleapmsglist;
static eapmschapv2hashlist_t *eapmschapv2hashlist, *eapmschapv2hashlistptr;
static eapmschapv2msglist_t *eapmschapv2msglist;
static tacacsplist_t *tacacsplist, *tacacsplistptr;
static char *jtrbasenamedeprecated;
static FILE *fh_pmkideapol;
static FILE *fh_pmkideapolclient;
static FILE *fh_eapmd5;
static FILE *fh_eapmd5john;
static FILE *fh_eapleap;
static FILE *fh_tacacsp;
static FILE *fh_essid;
static FILE *fh_essidproberequest;
static FILE *fh_deviceinfo;
static FILE *fh_identity;
static FILE *fh_username;
static FILE *fh_nmea;
static FILE *fh_csv;
static FILE *fh_raw_out;
static FILE *fh_lts;
static FILE *fh_log;
static FILE *fh_pmkideapoljtrdeprecated;
static FILE *fh_pmkiddeprecated;
static FILE *fh_hccapxdeprecated;
static FILE *fh_hccapdeprecated;
static int maclistmax;
static int handshakelistmax;
static int pmkidlistmax;
static int eapmd5hashlistmax;
static int eapleaphashlistmax;
static int eapmschapv2hashlistmax;
static int tacacsplistmax;
static int fd_pcap;
static int gzipstat;
static int pcapngstat;
static int capstat;
static int endianness;
static uint16_t versionmajor;
static uint16_t versionminor;
static int opensslversionmajor;
static int opensslversionminor;
static uint32_t iface;
static uint32_t dltlinktype[MAX_INTERFACE_ID +1];
static uint32_t timeresolval[MAX_INTERFACE_ID +1];
static long int radiotaperrorcount;
static long int nmeacount;
static long int nmeaerrorcount;
static long int rawpacketcount;
static long int pcapreaderrors;
static long int skippedpacketcount;
static long int zeroedtimestampcount;
static long int fcsframecount;
static long int fcsgoodframecount;
static long int fcsbadframecount;
static long int band24count;
static long int band5count;
static long int band6count;
static long int wdscount;
static long int actioncount;
static long int actionessidcount;
static long int awdlcount;
static long int beaconcount;
static long int beaconssidunsetcount;
static long int beaconssidzeroedcount;
static long int beaconssidoversizedcount;
static long int beaconhcxcount;
static long int beaconerrorcount;
static long int broadcastmacerrorcount;
static long int pagcount;
static long int proberesponsecount;
static long int proberesponsessidunsetcount;
static long int proberesponsessidzeroedcount;
static long int proberequestundirectedcount;
static long int proberequestdirectedcount;
static long int mgtreservedcount;
static long int deauthenticationcount;
static long int disassociationcount;
static long int authenticationcount;
static long int authopensystemcount;
static long int authseacount;
static long int authsharedkeycount;
static long int authfbtcount;
static long int authfilscount;
static long int authfilspfs;
static long int authfilspkcount;
static long int authnetworkeapcount;
static long int authunknowncount;
static long int associationrequestcount;
static long int associationrequestpskcount;
static long int associationrequestftpskcount;
static long int associationrequestpsk256count;
static long int associationrequestsae256count;
static long int associationrequestsae384bcount;
static long int associationrequestowecount;
static long int reassociationrequestcount;
static long int reassociationrequestpskcount;
static long int reassociationrequestftpskcount;
static long int reassociationrequestpsk256count;
static long int reassociationrequestsae256count;
static long int reassociationrequestsae384bcount;
static long int reassociationrequestowecount;
static long int ipv4count;
static long int icmp4count;
static long int ipv6count;
static long int icmp6count;
static long int tcpcount;
static long int udpcount;
static long int grecount;
static long int protochapcount;
static long int protochapreqcount;
static long int protochaprespcount;
static long int protochapsuccesscount;
static long int protopapcount;
static long int tacacspcount;
static long int tacacsp2count;
static long int tacacsp3count;
static long int tacacspwrittencount;
static long int wepenccount;
static long int wpaenccount;
static long int eapcount;
static long int eapsimcount;
static long int eapakacount;
static long int eappeapcount;
static long int eapmd5count;
static long int eapmd5hashcount;
static long int eapleapcount;
static long int eapleaphashcount;
static long int eapmschapv2count;
static long int eapmschapv2hashcount;
static long int eaptlscount;
static long int eapexpandedcount;
static long int eapidcount;
static long int eapcodereqcount;
static long int eapcoderespcount;
static long int radiusrequestcount;
static long int radiuschallengecount;
static long int radiusacceptcount;
static long int radiusrejectcount;
static long int zeroedpmkidpskcount;
static long int zeroedpmkidpmkcount;
static long int zeroedeapolpskcount;
static long int zeroedeapolpmkcount;
static long int pmkidcount;
static long int pmkidbestcount;
static long int pmkidroguecount;
static long int pmkiduselesscount;
static long int pmkidfaultycount;
static long int pmkidakmcount;
static long int pmkidwrittenhcount;
static long int pmkidclientwrittenhcount;
static long int pmkidwrittenjcountdeprecated;
static long int pmkidwrittencountdeprecated;
static long int eapolrc4count;
static long int eapolrsncount;
static long int eapolwpacount;
static long int eapolmsgcount;
static long int eapolrelayedcount;
static long int eapolnccount;
static long int eapolmsgerrorcount;
static long int eapolmsgtimestamperrorcount;
static long int eapolmpcount;
static long int eapolmpbestcount;
static long int eapolm1count;
static long int eapolm1kdv0count;
static long int eapolm1ancount;
static long int eapolm1errorcount;
static long int eapolm2count;
static long int eapolm2oversizedcount;
static long int eapolm2kdv0count;
static long int eapolm2ftpskcount;
static long int eapolm2errorcount;
static long int eapolm3count;
static long int eapolm3oversizedcount;
static long int eapolm3kdv0count;
static long int eapolm3errorcount;
static long int eapolm4count;
static long int eapolm4oversizedcount;
static long int eapolm4zeroedcount;
static long int eapolm4kdv0count;
static long int eapolm4errorcount;
static long int eapolwrittencount;
static long int eapolncwrittencount;
static long int eapolaplesscount;
static long int eapolwrittenjcountdeprecated;
static long int eapolwrittenhcpxcountdeprecated;
static long int eapolncwrittenhcpxcountdeprecated;
static long int eapolwrittenhcpcountdeprecated;
static long int eapolm12e2count;
static long int eapolm14e4count;
static long int eapolm32e2count;
static long int eapolm32e3count;
static long int eapolm34e3count;
static long int eapolm34e4count;
static long int eapmd5writtencount;
static long int eapmd5johnwrittencount;
static long int eapleapwrittencount;
static long int eapmschapv2writtencount;
static long int identitycount;
static long int usernamecount;
static uint64_t rcgapmax;
static long int taglenerrorcount;
static long int essidcount;
static long int essiderrorcount;
static long int deviceinfocount;
static long int sequenceerrorcount;
static long int essiddupemax;
static long int malformedcount;
static uint64_t timestampstart;
static uint64_t timestampmin;
static uint64_t timestampmax;
static uint64_t timestampdiff;
static uint64_t eaptimegapmax;
static uint64_t captimestampold;
static uint64_t eapoltimeoutvalue;
static uint64_t ncvalue;
static int essidsvalue;
static uint16_t frequency;
static int nmealen;
static bool addtimestampflag;
static bool ignoreieflag;
static bool donotcleanflag;
static bool ancientdumpfileformat;
static bool radiotappresent;
static bool ieee80211flag;
static const uint8_t fakenonce1[] =
{
0x07, 0xbc, 0x92, 0xea, 0x2f, 0x5a, 0x1e, 0xe2, 0x54, 0xf6, 0xb1, 0xb7, 0xe0, 0xaa, 0xd3, 0x53,
0xf4, 0x5b, 0x0a, 0xac, 0xf9, 0xc9, 0x90, 0x2f, 0x90, 0xd8, 0x78, 0x80, 0xb7, 0x03, 0x0a, 0x20
};
static const uint8_t fakenonce2[] =
{
0x95, 0x30, 0xd1, 0xc7, 0xc3, 0x55, 0xb9, 0xab, 0xe6, 0x83, 0xd6, 0xf3, 0x7e, 0xcb, 0x78, 0x02,
0x75, 0x1f, 0x53, 0xcc, 0xb5, 0x81, 0xd1, 0x52, 0x3b, 0xb4, 0xba, 0xad, 0x23, 0xab, 0x01, 0x07
};
static char rssi;
static int interfacechannel;
static uint8_t myaktap[6];
static uint8_t myaktclient[6];
static uint8_t myaktanonce[32];
static uint8_t myaktsnonce[32];
static uint64_t myaktreplaycount;
static char pcapnghwinfo[OPTIONLEN_MAX];
static char pcapngosinfo[OPTIONLEN_MAX];
static char pcapngapplinfo[OPTIONLEN_MAX];
static char pcapngoptioninfo[OPTIONLEN_MAX];
static char pcapngweakcandidate[OPTIONLEN_MAX];
static uint8_t pcapngdeviceinfo[6];
static uint8_t pcapngtimeresolution;
static char nmeasentence[OPTIONLEN_MAX];
static char gpwplold[OPTIONLEN_MAX];
static char zeroedpsk[8];
static uint8_t zeroedpmk[32];
static uint8_t calculatedpmk[32];
static uint16_t usedfrequency[0xffff];
static uint8_t beaconchannel[CHANNEL_MAX];
/*===========================================================================*/
/*
static inline void debugprint(int len, uint8_t *ptr)
{
static int p;
fprintf(stdout, "\nRAW: ");
for(p = 0; p < len; p++)
{
fprintf(stdout, "%02x", ptr[p]);
}
fprintf(stdout, "\n");
return;
}
*/
/*===========================================================================*/
static void closelists(void)
{
if(aplist != NULL) free(aplist);
if(messagelist != NULL) free(messagelist);
if(handshakelist != NULL) free(handshakelist);
if(pmkidlist != NULL) free(pmkidlist);
if(eapmd5msglist != NULL) free(eapmd5msglist);
if(eapmd5hashlist != NULL) free(eapmd5hashlist);
if(eapleapmsglist != NULL) free(eapleapmsglist);
if(eapleaphashlist != NULL) free(eapleaphashlist);
if(eapmschapv2msglist != NULL) free(eapmschapv2msglist);
if(eapmschapv2hashlist != NULL) free(eapmschapv2hashlist);
if(tacacsplist != NULL) free(tacacsplist);
return;
}
/*===========================================================================*/
static bool initlists(void)
{
static const char nastring[] = { "N/A" };
maclistmax = MACLIST_MAX;
if((aplist = (maclist_t*)calloc((maclistmax +1), MACLIST_SIZE)) == NULL) return false;
aplistptr = aplist;
if((messagelist = (messagelist_t*)calloc((MESSAGELIST_MAX +1), MESSAGELIST_SIZE)) == NULL) return false;
handshakelistmax = HANDSHAKELIST_MAX;
if((handshakelist = (handshakelist_t*)calloc((handshakelistmax +1), HANDSHAKELIST_SIZE)) == NULL) return false;
handshakelistptr = handshakelist;
pmkidlistmax = PMKIDLIST_MAX;
if((pmkidlist = (pmkidlist_t*)calloc((pmkidlistmax +1),PMKIDLIST_SIZE)) == NULL) return false;
pmkidlistptr = pmkidlist;
if((eapmd5msglist = (eapmd5msglist_t*)calloc((EAPMD5MSGLIST_MAX +1), EAPMD5MSGLIST_SIZE)) == NULL) return false;
eapmd5hashlistmax = EAPMD5HASHLIST_MAX;
if((eapmd5hashlist = (eapmd5hashlist_t*)calloc((eapmd5hashlistmax +1), EAPMD5HASHLIST_SIZE)) == NULL) return false;
eapmd5hashlistptr = eapmd5hashlist;
if((eapleapmsglist = (eapleapmsglist_t*)calloc((EAPLEAPMSGLIST_MAX +1), EAPLEAPMSGLIST_SIZE)) == NULL) return false;
eapleaphashlistmax = EAPLEAPHASHLIST_MAX;
if((eapleaphashlist = (eapleaphashlist_t*)calloc((eapleaphashlistmax +1), EAPLEAPHASHLIST_SIZE)) == NULL) return false;
eapleaphashlistptr = eapleaphashlist;
if((eapmschapv2msglist = (eapmschapv2msglist_t*)calloc((EAPMSCHAPV2MSGLIST_MAX +1), EAPMSCHAPV2MSGLIST_SIZE)) == NULL) return false;
eapmschapv2hashlistmax = EAPMSCHAPV2HASHLIST_MAX;
if((eapmschapv2hashlist = (eapmschapv2hashlist_t*)calloc((eapmschapv2hashlistmax +1), EAPMSCHAPV2HASHLIST_SIZE)) == NULL) return false;
eapmschapv2hashlistptr = eapmschapv2hashlist;
tacacsplistmax = TACACSPLIST_MAX;
if((tacacsplist = (tacacsplist_t*)calloc((TACACSPLIST_MAX +1), TACACSPLIST_SIZE)) == NULL) return false;
tacacsplistptr = tacacsplist;
memset(&pcapnghwinfo, 0, OPTIONLEN_MAX);
memset(&pcapngosinfo, 0, OPTIONLEN_MAX);
memset(&pcapngapplinfo, 0, OPTIONLEN_MAX);
memset(&pcapngoptioninfo, 0, OPTIONLEN_MAX);
memset(&pcapngweakcandidate, 0 ,OPTIONLEN_MAX);
memset(&pcapngdeviceinfo, 0 ,6);
pcapngtimeresolution = TSRESOL_USEC;
memset(&myaktap, 0 ,6);
memset(&myaktclient, 0 ,6);
memset(&nmeasentence, 0, OPTIONLEN_MAX);
memset(&gpwplold, 0, OPTIONLEN_MAX);
memcpy(&pcapnghwinfo, nastring, 3);
memcpy(&pcapngosinfo, nastring, 3);
memcpy(&pcapngapplinfo, nastring, 3);
memcpy(&pcapngoptioninfo, nastring, 3);
memcpy(&pcapngweakcandidate, nastring, 3);
ieee80211flag = false;
radiotaperrorcount = 0;
nmeacount = 0;
nmeaerrorcount = 0;
endianness = 0;
rawpacketcount = 0;
pcapreaderrors = 0;
skippedpacketcount = 0;
zeroedtimestampcount = 0;
fcsframecount = 0;
fcsgoodframecount = 0;
fcsbadframecount = 0;
band24count = 0;
band5count = 0;
band6count = 0;
wdscount = 0;
actioncount = 0;
actionessidcount = 0;
awdlcount = 0;
beaconcount = 0;
beaconssidunsetcount = 0;
beaconssidzeroedcount = 0;
beaconssidoversizedcount = 0;
beaconhcxcount = 0;
beaconerrorcount = 0;
broadcastmacerrorcount = 0;
pagcount = 0;
proberesponsecount = 0;
proberesponsessidunsetcount = 0;
proberesponsessidzeroedcount = 0;
proberequestundirectedcount = 0;
proberequestdirectedcount = 0;
mgtreservedcount = 0;
deauthenticationcount = 0;
disassociationcount = 0;
authenticationcount = 0;
authopensystemcount = 0;
authseacount = 0;
authsharedkeycount = 0;
authfbtcount = 0;
authfilscount = 0;
authfilspfs = 0;
authfilspkcount = 0;
authnetworkeapcount = 0;
authunknowncount = 0;
associationrequestcount = 0;
associationrequestpskcount = 0;
associationrequestftpskcount = 0;
associationrequestpsk256count = 0;
associationrequestsae256count = 0;
associationrequestsae384bcount = 0;
associationrequestowecount = 0;
reassociationrequestcount = 0;
reassociationrequestpskcount = 0;
reassociationrequestpsk256count = 0;
reassociationrequestsae256count = 0;
reassociationrequestsae384bcount = 0;
reassociationrequestowecount = 0;
ipv4count = 0;
icmp4count = 0;
ipv6count = 0;
icmp6count = 0;
tcpcount = 0;
udpcount = 0;
grecount = 0;
protochapcount = 0;
protochapreqcount = 0;
protochaprespcount = 0;
protochapsuccesscount = 0;
protopapcount = 0;
tacacspcount = 0;
tacacsp2count = 0;
tacacsp3count = 0;
tacacspwrittencount = 0;
wepenccount = 0;
wpaenccount = 0;
eapcount = 0;
eapsimcount = 0;
eapakacount = 0;
eappeapcount = 0;
eapmd5count = 0;
eapmd5hashcount = 0;
eapleapcount = 0;
eapleaphashcount = 0;
eapmschapv2count = 0;
eapmschapv2hashcount = 0;
eaptlscount = 0;
eapexpandedcount = 0;
eapidcount = 0;
eapcodereqcount = 0;
eapcoderespcount = 0;
radiusrequestcount = 0;
radiuschallengecount = 0;
radiusacceptcount = 0;
radiusrejectcount = 0;
zeroedpmkidpskcount = 0;
zeroedpmkidpmkcount = 0;
zeroedeapolpskcount = 0;
zeroedeapolpmkcount = 0;
pmkidcount = 0;
pmkidbestcount = 0;
pmkidroguecount = 0;
pmkiduselesscount = 0;
pmkidfaultycount = 0;
pmkidakmcount = 0;
pmkidwrittenhcount = 0;
pmkidclientwrittenhcount = 0;
eapolwrittenjcountdeprecated = 0;
pmkidwrittenjcountdeprecated = 0;
pmkidwrittencountdeprecated = 0;
eapolrc4count = 0;
eapolrsncount = 0;
eapolwpacount = 0;
eapolmsgcount = 0;
eapolrelayedcount = 0;
eapolnccount = 0;
eapolmsgerrorcount = 0;
eapolmsgtimestamperrorcount = 0;
eapolmpbestcount = 0;
eapolmpcount = 0;
eapolm1count = 0;
eapolm1kdv0count = 0;
eapolm1ancount = 0;
eapolm1errorcount = 0;
eapolm2count = 0;
eapolm2oversizedcount = 0;
eapolm2kdv0count = 0;
eapolm2ftpskcount = 0;
eapolm2errorcount = 0;
eapolm3count = 0;
eapolm3oversizedcount = 0;
eapolm3kdv0count = 0;
eapolm3errorcount = 0;
eapolm4count = 0;
eapolm4oversizedcount = 0;
eapolm4zeroedcount = 0;
eapolm4kdv0count = 0;
eapolm4errorcount = 0;
eapolwrittencount = 0;
eapolncwrittencount = 0;
eapolaplesscount = 0;
eapolwrittenjcountdeprecated = 0;
eapolwrittenhcpxcountdeprecated = 0;
eapolwrittenhcpcountdeprecated = 0;
eapolm12e2count = 0;
eapolm14e4count = 0;
eapolm32e2count = 0;
eapolm32e3count = 0;
eapolm34e3count = 0;
eapolm34e4count = 0;
eapmd5writtencount = 0;
eapmd5johnwrittencount = 0;
eapleapwrittencount = 0;
eapmschapv2writtencount = 0;
identitycount = 0;
usernamecount = 0;
taglenerrorcount = 0;
essidcount = 0;
essiderrorcount = 0;
deviceinfocount = 0;
sequenceerrorcount = 0;
essiddupemax = 0;
rcgapmax = 0;
eaptimegapmax = 0;
malformedcount = 0;
timestampmin = 0;
timestampmax = 0;
timestampdiff = 0;
timestampstart = 0;
captimestampold = 0;
memset(&zeroedpsk, 0, 8);
memset(&zeroedpmk, 0, 32);
memset(&beaconchannel, 0, sizeof(beaconchannel));
memset(&usedfrequency, 0, sizeof(usedfrequency));
return true;
}
/*===========================================================================*/
static void printcontentinfo(void)
{
static int c;
static uint8_t i;
static uint16_t p;
if(nmeacount > 0) fprintf(stdout, "NMEA PROTOCOL............................: %ld\n", nmeacount);
if(nmeaerrorcount > 0) fprintf(stdout, "NMEA PROTOCOL checksum errors............: %ld\n", nmeaerrorcount);
if(endianness == 0) fprintf(stdout, "endianness (capture system)..............: little endian\n");
else fprintf(stdout, "endianness (capture system)..............: big endian\n");
if(rawpacketcount > 0) fprintf(stdout, "packets inside...........................: %ld\n", rawpacketcount);
if(skippedpacketcount > 0) fprintf(stdout, "skipped packets..........................: %ld\n", skippedpacketcount);
if(fcsframecount > 0) fprintf(stdout, "frames with FCS (radiotap)...............: %ld\n", fcsframecount);
if(fcsgoodframecount > 0) fprintf(stdout, "frames with correct FCS (crc)............: %ld\n", fcsgoodframecount);
if(fcsbadframecount > 0) fprintf(stdout, "frames with bad FCS (radiotap)...........: %ld\n", fcsbadframecount);
if(band24count > 0) fprintf(stdout, "packets received on 2.4 GHz..............: %ld\n", band24count);
if(band5count > 0) fprintf(stdout, "packets received on 5 GHz................: %ld\n", band5count);
if(band6count > 0) fprintf(stdout, "packets received on 6 GHz................: %ld\n", band6count);
if(wdscount > 0) fprintf(stdout, "WIRELESS DISTRIBUTION SYSTEM.............: %ld\n", wdscount);
if(deviceinfocount > 0) fprintf(stdout, "frames containing device information.....: %ld\n", deviceinfocount);
if(essidcount > 0) fprintf(stdout, "ESSID (total unique).....................: %ld\n", essidcount);
if(essiddupemax > 0)
{
if((essidsvalue > 1) || (donotcleanflag == true)) fprintf(stdout, "ESSID changes (detected maximum).........: %ld\n", essiddupemax);
else fprintf(stdout, "ESSID changes (detected maximum).........: %ld (information: option --max-essids=%ld and --all recommended)\n", essiddupemax, essiddupemax +1);
}
if(beaconcount > 0)
{
fprintf(stdout, "BEACON (total)...........................: %ld\n", beaconcount);
if((beaconchannel[0] &GHZ24) == GHZ24)
{
fprintf(stdout, "BEACON on 2.4 GHz channel (from IE_TAG)..: ");
for(i = 1; i <= 14; i++)
{
if(beaconchannel[i] != 0) fprintf(stdout, "%d ", i);
}
fprintf(stdout, "\n");
}
if((beaconchannel[0] &GHZ5) == GHZ5)
{
fprintf(stdout, "BEACON on 5/6 GHz channel (from IE_TAG)..: ");
for(i = 15; i < CHANNEL_MAX; i++)
{
if(beaconchannel[i] != 0) fprintf(stdout, "%d ", i);
}
fprintf(stdout, "\n");
}
}
if(beaconssidunsetcount > 0) fprintf(stdout, "BEACON (SSID wildcard/unset).............: %ld\n", beaconssidunsetcount);
if(beaconssidzeroedcount > 0) fprintf(stdout, "BEACON (SSID zeroed).....................: %ld\n", beaconssidzeroedcount);
if(beaconssidoversizedcount > 0) fprintf(stdout, "BEACON (oversized SSID length)...........: %ld\n", beaconssidoversizedcount);
if(pagcount > 0) fprintf(stdout, "BEACON (pwnagotchi)......................: %ld\n", pagcount);
if(beaconhcxcount > 0) fprintf(stdout, "BEACON (hcxhash2cap).....................: %ld\n", beaconhcxcount);
if(actioncount > 0) fprintf(stdout, "ACTION (total)...........................: %ld\n", actioncount);
if(actionessidcount > 0) fprintf(stdout, "ACTION (containing ESSID)................: %ld\n", actionessidcount);
if(awdlcount > 0) fprintf(stdout, "AWDL (Apple Wireless Direct Link)........: %ld\n", awdlcount);
if(proberequestundirectedcount > 0) fprintf(stdout, "PROBEREQUEST (undirected)................: %ld\n", proberequestundirectedcount);
if(proberequestdirectedcount > 0) fprintf(stdout, "PROBEREQUEST (directed)..................: %ld\n", proberequestdirectedcount);
if(proberesponsecount > 0) fprintf(stdout, "PROBERESPONSE (total)....................: %ld\n", proberesponsecount);
if(proberesponsessidunsetcount > 0) fprintf(stdout, "PROBERESPONSE (SSID unset)...............: %ld\n", proberesponsessidunsetcount);
if(proberesponsessidzeroedcount > 0) fprintf(stdout, "PROBERESPONSE (SSID zeroed)..............: %ld\n", proberesponsessidzeroedcount);
if(deauthenticationcount > 0) fprintf(stdout, "DEAUTHENTICATION (total).................: %ld\n", deauthenticationcount);
if(disassociationcount > 0) fprintf(stdout, "DISASSOCIATION (total)...................: %ld\n", disassociationcount);
if(authenticationcount > 0) fprintf(stdout, "AUTHENTICATION (total)...................: %ld\n", authenticationcount);
if(authopensystemcount > 0) fprintf(stdout, "AUTHENTICATION (OPEN SYSTEM).............: %ld\n", authopensystemcount);
if(authseacount > 0) fprintf(stdout, "AUTHENTICATION (SAE).....................: %ld\n", authseacount);
if(authsharedkeycount > 0) fprintf(stdout, "AUTHENTICATION (SHARED KEY)..............: %ld\n", authsharedkeycount);
if(authfbtcount > 0) fprintf(stdout, "AUTHENTICATION (FBT).....................: %ld\n", authfbtcount);
if(authfilscount > 0) fprintf(stdout, "AUTHENTICATION (FILS)....................: %ld\n", authfilscount);
if(authfilspfs > 0) fprintf(stdout, "AUTHENTICATION (FILS PFS)................: %ld\n", authfilspfs);
if(authfilspkcount > 0) fprintf(stdout, "AUTHENTICATION (FILS PK..................: %ld\n", authfilspkcount);
if(authnetworkeapcount > 0) fprintf(stdout, "AUTHENTICATION (NETWORK EAP).............: %ld\n", authnetworkeapcount);
if(authunknowncount > 0) fprintf(stdout, "AUTHENTICATION (unknown).................: %ld\n", authunknowncount);
if(associationrequestcount > 0) fprintf(stdout, "ASSOCIATIONREQUEST (total)...............: %ld\n", associationrequestcount);
if(associationrequestpskcount > 0) fprintf(stdout, "ASSOCIATIONREQUEST (PSK).................: %ld\n", associationrequestpskcount);
if(associationrequestftpskcount > 0) fprintf(stdout, "ASSOCIATIONREQUEST (FT using PSK)........: %ld\n", associationrequestftpskcount);
if(associationrequestpsk256count > 0) fprintf(stdout, "ASSOCIATIONREQUEST (PSK SHA256)..........: %ld\n", associationrequestpsk256count);
if(associationrequestsae256count > 0) fprintf(stdout, "ASSOCIATIONREQUEST (SAE SHA256)..........: %ld\n", associationrequestsae256count);
if(associationrequestsae384bcount > 0) fprintf(stdout, "ASSOCIATIONREQUEST (SAE SHA384 SUITE B)..: %ld\n", associationrequestsae384bcount);
if(associationrequestowecount > 0) fprintf(stdout, "ASSOCIATIONREQUEST (OWE).................: %ld\n", associationrequestowecount);
if(reassociationrequestcount > 0) fprintf(stdout, "REASSOCIATIONREQUEST (total).............: %ld\n", reassociationrequestcount);
if(reassociationrequestpskcount > 0) fprintf(stdout, "REASSOCIATIONREQUEST (PSK)...............: %ld\n", reassociationrequestpskcount);
if(reassociationrequestftpskcount > 0) fprintf(stdout, "REASSOCIATIONREQUEST (FT using PSK)......: %ld\n", reassociationrequestftpskcount);
if(reassociationrequestpsk256count > 0) fprintf(stdout, "REASSOCIATIONREQUEST (PSK SHA256)........: %ld\n", reassociationrequestpsk256count);
if(reassociationrequestsae256count > 0) fprintf(stdout, "REASSOCIATIONREQUEST (SAE SHA256)........: %ld\n", reassociationrequestsae256count);
if(reassociationrequestsae384bcount > 0)fprintf(stdout, "REASSOCIATIONREQUEST (SAE SHA384 SUITE B): %ld\n", reassociationrequestsae384bcount);
if(reassociationrequestowecount > 0) fprintf(stdout, "REASSOCIATIONREQUEST (OWE)...............: %ld\n", reassociationrequestowecount);
if(mgtreservedcount > 0) fprintf(stdout, "RESERVED MANAGEMENT frame................: %ld\n", mgtreservedcount);
if(wpaenccount > 0) fprintf(stdout, "WPA encrypted............................: %ld\n", wpaenccount);
if(wepenccount > 0) fprintf(stdout, "WEP encrypted............................: %ld\n", wepenccount);
if(ipv4count > 0) fprintf(stdout, "IPv4 (total).............................: %ld\n", ipv4count);
if(icmp4count > 0) fprintf(stdout, "ICMPv4...................................: %ld\n", icmp4count);
if(ipv6count > 0) fprintf(stdout, "IPv6 (total).............................: %ld\n", ipv6count);
if(icmp6count > 0) fprintf(stdout, "ICMPv6...................................: %ld\n", icmp6count);
if(tcpcount > 0) fprintf(stdout, "TCP (total)..............................: %ld\n", tcpcount);
if(udpcount > 0) fprintf(stdout, "UDP (total)..............................: %ld\n", udpcount);
if(grecount > 0) fprintf(stdout, "GRE (total)..............................: %ld\n", grecount);
if(protochapcount > 0) fprintf(stdout, "PPP-CHAP (total).........................: %ld\n", protochapcount);
if(protochapreqcount > 0) fprintf(stdout, "PPP-CHAP request.........................: %ld\n", protochapreqcount);
if(protochaprespcount > 0) fprintf(stdout, "PPP-CHAP response........................: %ld\n", protochaprespcount);
if(protochapsuccesscount > 0) fprintf(stdout, "PPP-CHAP success.........................: %ld\n", protochapsuccesscount);
if(protopapcount > 0) fprintf(stdout, "PPP-PAP..................................: %ld\n", protopapcount);
if(tacacspcount > 0) fprintf(stdout, "TACACS+ v1...............................: %ld\n", tacacspcount);
if(tacacsp2count > 0) fprintf(stdout, "TACACS+ v2...............................: %ld (unsupported)\n", tacacsp2count);
if(tacacsp3count > 0) fprintf(stdout, "TACACS+ v3...............................: %ld (unsupported)\n", tacacsp3count);
if(tacacspwrittencount > 0) fprintf(stdout, "TACACS+ written..........................: %ld\n", tacacspwrittencount);
if(identitycount > 0) fprintf(stdout, "IDENTITIES...............................: %ld\n", identitycount);
if(usernamecount > 0) fprintf(stdout, "USERNAMES................................: %ld\n", usernamecount);
if(radiusrequestcount > 0) fprintf(stdout, "RADIUS AUTHENTICATION (REQUEST)..........: %ld\n", radiusrequestcount);
if(radiuschallengecount > 0) fprintf(stdout, "RADIUS AUTHENTICATION (CHALLENGE)........: %ld\n", radiuschallengecount);
if(radiusacceptcount > 0) fprintf(stdout, "RADIUS AUTHENTICATION (ACCEPT)...........: %ld\n", radiusacceptcount);
if(radiusrejectcount > 0) fprintf(stdout, "RADIUS AUTHENTICATION (REJECT)...........: %ld\n", radiusrejectcount);
if(eapcount > 0) fprintf(stdout, "EAP (total)..............................: %ld\n", eapcount);
if(eapexpandedcount > 0) fprintf(stdout, "EAP-EXPANDED.............................: %ld\n", eapexpandedcount);
if(eapcodereqcount > 0) fprintf(stdout, "EAP CODE request.........................: %ld\n", eapcodereqcount);
if(eapcoderespcount > 0) fprintf(stdout, "EAP CODE response........................: %ld\n", eapcoderespcount);
if(eapidcount > 0) fprintf(stdout, "EAP ID...................................: %ld\n", eapidcount);
if(eapsimcount > 0) fprintf(stdout, "EAP-SIM..................................: %ld\n", eapsimcount);
if(eapakacount > 0) fprintf(stdout, "EAP-AKA..................................: %ld\n", eapakacount);
if(eappeapcount > 0) fprintf(stdout, "EAP-PEAP.................................: %ld\n", eappeapcount);
if(eapmd5count > 0) fprintf(stdout, "EAP-MD5 messages.........................: %ld\n", eapmd5count);
if(eapmd5hashcount > 0) fprintf(stdout, "EAP-MD5 pairs............................: %ld\n", eapmd5hashcount);
if(eapmd5writtencount > 0) fprintf(stdout, "EAP-MD5 pairs written....................: %ld\n", eapmd5writtencount);
if(eapmd5johnwrittencount > 0) fprintf(stdout, "EAP-MD5 pairs written to JtR.............: %ld\n", eapmd5johnwrittencount);
if(eapleapcount > 0) fprintf(stdout, "EAP-LEAP messages........................: %ld\n", eapleapcount);
if(eapleapwrittencount > 0) fprintf(stdout, "EAP-LEAP pairs written...................: %ld\n", eapleapwrittencount);
if(eapmschapv2count > 0) fprintf(stdout, "EAP-MSCHAPV2 messages....................: %ld\n", eapmschapv2count);
if(eapmschapv2writtencount > 0) fprintf(stdout, "EAP-MSCHAPV2 pairs written...............: %ld\n", eapmschapv2writtencount);
if(eaptlscount > 0) fprintf(stdout, "EAP-TLS messages.........................: %ld\n", eaptlscount);
if(eapolmsgcount > 0) fprintf(stdout, "EAPOL messages (total)...................: %ld\n", eapolmsgcount);
if(eapolrelayedcount > 0) fprintf(stdout, "EAPOL messages relayed (ignored).........: %ld\n", eapolrelayedcount);
if(eapolrc4count > 0) fprintf(stdout, "EAPOL RC4 messages.......................: %ld\n", eapolrc4count);
if(eapolrsncount > 0) fprintf(stdout, "EAPOL RSN messages.......................: %ld\n", eapolrsncount);
if(eapolwpacount > 0) fprintf(stdout, "EAPOL WPA messages.......................: %ld\n", eapolwpacount);
if(eaptimegapmax > 0) fprintf(stdout, "EAPOLTIME gap (measured maximum msec)....: %" PRIu64 "\n", eaptimegapmax / 1000000);
if(rcgapmax > 1024) rcgapmax = 1024;
if((eapolnccount > 0) && (eapolmpcount > 0))
{
printf ("EAPOL ANONCE error corrections (NC)......: working\n");
if(rcgapmax > 0) fprintf(stdout, "REPLAYCOUNT gap (suggested NC)...........: %" PRIu64 "\n", (rcgapmax *2 +1));
if(rcgapmax == 0) fprintf(stdout, "REPLAYCOUNT gap (recommended NC).........: 8\n");
}
if(eapolnccount == 0)
{
fprintf(stdout, "EAPOL ANONCE error corrections (NC)......: not detected\n");
if(rcgapmax > 0) fprintf(stdout, "REPLAYCOUNT gap (measured maximum).......: %" PRIu64 "\n", rcgapmax);
}
if(eapolm1count > 0) fprintf(stdout, "EAPOL M1 messages (total)................: %ld\n", eapolm1count);
if(eapolm1kdv0count > 0) fprintf(stdout, "EAPOL M1 messages (KDV:0 AKM defined)....: %ld (PMK not recoverable)\n", eapolm1kdv0count);
if(eapolm2count > 0) fprintf(stdout, "EAPOL M2 messages (total)................: %ld\n", eapolm2count);
if(eapolm2oversizedcount > 0) fprintf(stdout, "EAPOL M2 messages (oversized)............: %ld\n", eapolm2oversizedcount);
if(eapolm2kdv0count > 0) fprintf(stdout, "EAPOL M2 messages (KDV:0 AKM defined)....: %ld (PMK not recoverable)\n", eapolm2kdv0count);
if(eapolm2ftpskcount > 0) fprintf(stdout, "EAPOL M2 messages (FT using PSK).........: %ld (PMK not recoverable)\n", eapolm2ftpskcount);
if(eapolm3count > 0) fprintf(stdout, "EAPOL M3 messages (total)................: %ld\n", eapolm3count);
if(eapolm3oversizedcount > 0) fprintf(stdout, "EAPOL M3 messages (oversized)............: %ld\n", eapolm3oversizedcount);
if(eapolm3kdv0count > 0) fprintf(stdout, "EAPOL M3 messages (KDV:0 AKM defined)....: %ld (PMK not recoverable)\n", eapolm3kdv0count);
if(eapolm4count > 0) fprintf(stdout, "EAPOL M4 messages (total)................: %ld\n", eapolm4count);
if(eapolm4oversizedcount > 0) fprintf(stdout, "EAPOL M4 messages (oversized)............: %ld\n", eapolm4oversizedcount);
if(eapolm4zeroedcount > 0) fprintf(stdout, "EAPOL M4 messages (zeroed NONCE).........: %ld\n", eapolm4zeroedcount);
if(eapolm4kdv0count > 0) fprintf(stdout, "EAPOL M4 messages (KDV:0 AKM defined)....: %ld (PMK not recoverable)\n", eapolm4kdv0count);
if(eapolmpcount > 0) fprintf(stdout, "EAPOL pairs (total)......................: %ld\n", eapolmpcount);
if(zeroedeapolpskcount > 0) fprintf(stdout, "EAPOL (from zeroed PSK)..................: %ld (not converted by default options - use --all)\n", zeroedeapolpskcount);
if(zeroedeapolpmkcount > 0) fprintf(stdout, "EAPOL (from zeroed PMK)..................: %ld (not converted by default options - use --all)\n", zeroedeapolpmkcount);
if(donotcleanflag == false)
{
if(eapolmpbestcount > 0) fprintf(stdout, "EAPOL pairs (best).......................: %ld\n", eapolmpbestcount);
}
else
{
if(eapolmpbestcount > 0) fprintf(stdout, "EAPOL pairs (useful).....................: %ld\n", eapolmpbestcount);
}
if(eapolaplesscount > 0) fprintf(stdout, "EAPOL ROGUE pairs........................: %ld\n", eapolaplesscount);
if(eapolwrittencount > 0) fprintf(stdout, "EAPOL pairs written to 22000 hash file...: %ld (RC checked)\n", eapolwrittencount);
if(eapolncwrittencount > 0) fprintf(stdout, "EAPOL pairs written to 22000 hash file...: %ld (RC not checked)\n", eapolncwrittencount);
if(eapolwrittenhcpxcountdeprecated > 0) fprintf(stdout, "EAPOL pairs written to old format hccapx.: %ld (RC checked)\n", eapolwrittenhcpxcountdeprecated);
if(eapolncwrittenhcpxcountdeprecated > 0) fprintf(stdout, "EAPOL pairs written to old format hccapx.: %ld (RC not checked)\n", eapolncwrittenhcpxcountdeprecated);
if(eapolwrittenhcpcountdeprecated > 0) fprintf(stdout, "EAPOL pairs written to old format hccap..: %ld (RC checked)\n", eapolwrittenhcpcountdeprecated);
if(eapolwrittenjcountdeprecated > 0) fprintf(stdout, "EAPOL pairs written to old format JtR....: %ld (RC checked)\n", eapolwrittenjcountdeprecated);
if(eapolm12e2count > 0) fprintf(stdout, "EAPOL M12E2 (challenge)..................: %ld\n", eapolm12e2count);
if(eapolm14e4count > 0) fprintf(stdout, "EAPOL M14E4 (authorized).................: %ld\n", eapolm14e4count);
if(eapolm32e2count > 0) fprintf(stdout, "EAPOL M32E2 (authorized).................: %ld\n", eapolm32e2count);
if(eapolm32e3count > 0) fprintf(stdout, "EAPOL M32E3 (authorized).................: %ld\n", eapolm32e3count);
if(eapolm34e3count > 0) fprintf(stdout, "EAPOL M34E3 (authorized).................: %ld\n", eapolm34e3count);
if(eapolm34e4count > 0) fprintf(stdout, "EAPOL M34E4 (authorized).................: %ld\n", eapolm34e4count);
if(pmkiduselesscount > 0) fprintf(stdout, "RSN PMKID (useless)......................: %ld\n", pmkiduselesscount);
if(pmkidfaultycount > 0) fprintf(stdout, "RSN PMKID (faulty).......................: %ld\n", pmkidfaultycount);
if(pmkidcount > 0) fprintf(stdout, "RSN PMKID (total)........................: %ld\n", pmkidcount);
if(zeroedpmkidpskcount > 0) fprintf(stdout, "RSN PMKID (from zeroed PSK)..............: %ld (not converted by default options - use --all)\n", zeroedpmkidpskcount);
if(zeroedpmkidpmkcount > 0) fprintf(stdout, "RSN PMKID (from zeroed PMK)..............: %ld (not converted by default options - use --all)\n", zeroedpmkidpmkcount);
if(donotcleanflag == false)
{
if(pmkidbestcount > 0) fprintf(stdout, "RSN PMKID (best).........................: %ld\n", pmkidbestcount);
}
else
{
if(pmkidbestcount > 0) fprintf(stdout, "RSN PMKID (useful).......................: %ld\n", pmkidbestcount);
}
if(pmkidroguecount > 0) fprintf(stdout, "RSN PMKID ROGUE..........................: %ld\n", pmkidroguecount);
if(pmkidakmcount > 0) fprintf(stdout, "RSN PMKID (KDV:0 AKM defined)............: %ld (PMK not recoverable)\n", pmkidakmcount);
if(pmkidwrittenhcount > 0) fprintf(stdout, "RSN PMKID written to 22000 hash file.....: %ld\n", pmkidwrittenhcount);
if(pmkidclientwrittenhcount > 0) fprintf(stdout, "RSN PMKID written to 22000 hash file.....: %ld (possible MESH/REPEATER PMKIDs)\n", pmkidclientwrittenhcount);
if(pmkidwrittenjcountdeprecated > 0) fprintf(stdout, "RSN PMKID written to old format JtR......: %ld\n", pmkidwrittenjcountdeprecated);
if(pmkidwrittencountdeprecated > 0) fprintf(stdout, "RSN PMKID written to old format (1680x)..: %ld\n", pmkidwrittencountdeprecated);
if(pcapreaderrors > 0) fprintf(stdout, "packet read error........................: %ld\n", pcapreaderrors);
if(radiotaperrorcount > 0) fprintf(stdout, "packet with damaged radiotap header......: %ld\n", radiotaperrorcount);
if(zeroedtimestampcount > 0) fprintf(stdout, "packets with zeroed timestamps...........: %ld\n", zeroedtimestampcount);
if(eapolmsgtimestamperrorcount > 0) fprintf(stdout, "EAPOL frames with wrong timestamp........: %ld\n", eapolmsgtimestamperrorcount);
malformedcount = beaconerrorcount +broadcastmacerrorcount +taglenerrorcount +essiderrorcount +eapolmsgerrorcount;
if(malformedcount > 0) fprintf(stdout, "malformed packets (total)................: %ld\n", malformedcount);
beaconerrorcount += broadcastmacerrorcount;
if(beaconerrorcount > 0) fprintf(stdout, "BEACON error (total malformed packets)...: %ld\n", beaconerrorcount);
if(broadcastmacerrorcount > 0) fprintf(stdout, "BROADCAST MAC error (malformed packets)..: %ld\n", broadcastmacerrorcount);
if(taglenerrorcount > 0) fprintf(stdout, "IE TAG length error (malformed packets)..: %ld\n", taglenerrorcount);
if(essiderrorcount > 0) fprintf(stdout, "ESSID error (malformed packets)..........: %ld\n", essiderrorcount);
eapolmsgerrorcount = eapolmsgerrorcount +eapolm1errorcount +eapolm2errorcount +eapolm3errorcount +eapolm4errorcount;
if(eapolmsgerrorcount > 0) fprintf(stdout, "EAPOL messages (malformed packets).......: %ld\n", eapolmsgerrorcount);
if(radiotappresent == true)
{
c = 0;
fprintf(stdout, "\nfrequency statistics from radiotap header (frequency: received packets)\n"
"-----------------------------------------------------------------------\n");
for(p = 2412; p <= 7115; p ++)
{
if(usedfrequency[p] != 0)
{
fprintf(stdout, "% 5d: %d\t", p, usedfrequency[p]);
c++;
if((c %4) == 0) fprintf(stdout, "\n");
}
}
fprintf(stdout, "\n");
}
if(zeroedtimestampcount > 0)
{
fprintf(stdout, "\nWarning: missing timestamps!\n"
"This dump file contains frames with zeroed timestamps.\n"
"It prevent calculation of EAPOL TIMEOUT values.\n"
"That is a bug of the capturing/cleaning tool.\n");
}
if(eapolmsgtimestamperrorcount > 0)
{
fprintf(stdout, "\nWarning: wrong timestamps!\n"
"This dump file contains frames with wrong timestamps.\n"
"It prevent calculation of EAPOL TIMEOUT values.\n"
"That is a bug of the capturing/cleaning tool.\n");
}
if(sequenceerrorcount > 0)
{
fprintf(stdout, "\nWarning: out of sequence timestamps!\n"
"This dump file contains frames with out of sequence timestamps.\n"
"That is a bug of the capturing/cleaning tool.\n");
}
if(ancientdumpfileformat == true)
{
fprintf(stdout, "\nInformation: limited dump file format detected!\n"
"This file format is a very basic format to save captured network data.\n"
"It is recommended to use PCAP Next Generation dump file format (or pcapng for short) instead. "
"The PCAP Next Generation dump file format is an attempt to overcome the limitations "
"of the currently widely used (but very limited) libpcap (cap, pcap) format.\n"
"https://www.wireshark.org/docs/wsug_html_chunked/AppFiles.html#ChAppFilesCaptureFilesSection\n"
"https://github.com/pcapng/pcapng\n");
}
if(ieee80211flag == false)
{
fprintf(stdout, "\n");
return;
}
if(radiotappresent == false)
{
fprintf(stdout, "\nInformation: radiotap header is missing!\n"
"Radiotap is a de facto standard for 802.11 frame injection and "
"reception. The radiotap header format is a mechanism to supply "
"additional information about frames, from the driver to userspace applications.\n"
"https://www.radiotap.org/\n");
}
if(magicblockcount > 1)
{
fprintf(stdout, "\nWarning: this dump file contains more than one custom block!\n"
"This always happens if dump files are merged!\n"
"Do not merge dump files, because this destroys assigned hash values!\n");
}
if(((deauthenticationcount +disassociationcount) >= 100) && ((deauthenticationcount +disassociationcount) <= 10000))
{
fprintf(stdout, "\nWarning: too many deauthentication/disassociation frames detected!\n"
"That can cause that an ACCESS POINT change channel, reset EAPOL TIMER, "
"renew ANONCE and set PMKID to zero. "
"This could prevent to calculate a valid EAPOL MESSAGE PAIR, to get a valid PMKID "
"or to decrypt the traffic.\n");
}
if((deauthenticationcount +disassociationcount) > 10000)
{
fprintf(stdout, "\nWarning: excessive number of deauthentication/disassociation frames detected!\n"
"That can cause that an ACCESS POINT change channel, reset EAPOL TIMER, "
"renew ANONCE and set PMKID to zero. "
"This could prevent to calculate a valid EAPOL MESSAGE PAIR, to get a valid PMKID "
"or to decrypt the traffic.\n");
}
if(((beaconcount + proberesponsecount) == 0) && ((associationrequestcount + reassociationrequestcount) == 0))
{
fprintf(stdout, "\nInformation: missing frames!\n"
"This dump file does not contain BEACON or PROBERESPONSE frames.\n"
"This frames contain the ESSID which is mandatory to calculate a PMK.\n"
"It always happens if the capture file was cleaned or "
"it could happen if filter options are used during capturing. "
"That makes it impossible to recover the PSK.\n");
}
if(proberequestundirectedcount == 0)
{
fprintf(stdout, "\nInformation: missing frames!\n"
"This dump file does not contain undirected proberequest frames.\n"
"An undirected proberequest may contain information about the PSK. "
"It always happens if the capture file was cleaned or "
"it could happen if filter options are used during capturing.\n"
"That makes it hard to recover the PSK.\n");
}
if((authenticationcount +associationrequestcount +reassociationrequestcount) == 0)
{
fprintf(stdout, "\nInformation: missing frames!\n"
"This dump file does not contain important frames like authentication, association or reassociation.\n"
"It always happens if the capture file was cleaned or "
"it could happen if filter options are used during capturing. "
"That makes it hard to recover the PSK.\n");
if(timestampdiff < 60000000000) fprintf(stdout, "Duration of the dump tool was a way too short to capture enough additional information.\n");
}
if(eapolm1ancount <= 1)
{
fprintf(stdout, "\nInformation: missing frames!\n"
"This dump file does not contain enough EAPOL M1 frames.\n"
"It always happens if the capture file was cleaned or "
"it could happen if filter options are used during capturing.\n"
"That makes it impossible to calculate nonce-error-correction values.\n"
"https://hashcat.net/forum/thread-6361.html\n");
if(timestampdiff < 60000000000) fprintf(stdout, "Duration of the dump tool was a way too short to capture enough additional information.\n");
}
if((eapolm1count + eapolm2count + eapolm4count > 0) && (eapolm3count == 0))
{
fprintf(stdout, "\nInformation: missing EAPOL M3 frames!\n"
"This dump file does not contain EAPOL M3 frames (possible packet loss).\n"
"It strongly recommended to recapture the traffic or "
"to use --all option to convert all possible EAPOL MESSAGE PAIRs.\n");
}
if(malformedcount > 5)
{
fprintf(stdout, "\nInformation: malformed packets detected!\n"
"In monitor mode the adapter does not check to see if the cyclic redundancy check (CRC) "