Skip to content

Commit 492e19d

Browse files
author
=
committed
added monitor mode and packet injection test to rcascan=active
1 parent a560d4d commit 492e19d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

hcxdumptool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ static int apcountmax = APCOUNT_MAX;
140140
static int clientcountmax = CLIENTCOUNT_MAX;
141141

142142
static u64 packetcount = 1;
143+
static u64 beaconrcascancount = 0;
144+
static u64 proberesponsercascancount = 0;
143145
static size_t proberesponsetxindex = 0;
144146
static u32 proberesponsetxmax = PROBERESPONSETX_MAX;
145147

@@ -2670,6 +2672,7 @@ for(i = 0; i < APLIST_MAX - 1; i++)
26702672
if(__hcx16le(proberesponse->capability) & WLAN_CAPABILITY_PRIVACY) (aplist + i)->apdata->privacy = 'e';
26712673
else (aplist + i)->apdata->privacy = 'o';
26722674
get_tags((aplist + i)->apdata, proberesponselen, proberesponse->ie);
2675+
proberesponsercascancount++;
26732676
if(i > APLIST_HALF) qsort(aplist, i + 1, APLIST_SIZE, sort_aplist_by_tsakt);
26742677
return;
26752678
}
@@ -2682,6 +2685,7 @@ if(memcmp(macclientrg, macfrx->addr1, ETH_ALEN) != 0) (aplist + i)->apdata->tsre
26822685
if(__hcx16le(proberesponse->capability) & WLAN_CAPABILITY_PRIVACY) (aplist + i)->apdata->privacy = 'e';
26832686
else (aplist + i)->apdata->privacy = 'o';
26842687
get_tags((aplist + i)->apdata, proberesponselen, proberesponse->ie);
2688+
proberesponsercascancount++;
26852689
qsort(aplist, i + 1, APLIST_SIZE, sort_aplist_by_tsakt);
26862690
return;
26872691
}
@@ -2769,6 +2773,7 @@ for(i = 0; i < APLIST_MAX - 1; i++)
27692773
if(__hcx16le(beacon->capability) & WLAN_CAPABILITY_PRIVACY) (aplist + i)->apdata->privacy = 'e';
27702774
else (aplist + i)->apdata->privacy = 'o';
27712775
get_tags((aplist + i)->apdata, beaconlen, beacon->ie);
2776+
beaconrcascancount++;
27722777
if(i > APLIST_HALF) qsort(aplist, i + 1, APLIST_SIZE, sort_aplist_by_tsakt);
27732778
return;
27742779
}
@@ -2780,6 +2785,7 @@ memcpy((aplist + i)->apdata->maca, macfrx->addr2, ETH_ALEN);
27802785
if(__hcx16le(beacon->capability) & WLAN_CAPABILITY_PRIVACY) (aplist + i)->apdata->privacy = 'e';
27812786
else (aplist + i)->apdata->privacy = 'o';
27822787
get_tags((aplist + i)->apdata, beaconlen, beacon->ie);
2788+
beaconrcascancount++;
27832789
qsort(aplist, i + 1, APLIST_SIZE, sort_aplist_by_tsakt);
27842790
return;
27852791
}
@@ -5797,6 +5803,11 @@ close_lists();
57975803
if(rooterrorflag == true) exit(EXIT_FAILURE);
57985804
if((monitormodeflag == true) || (interfacelistflag == true) || (interfaceinfoflag == true) || (interfacelistshortflag == true)) return EXIT_SUCCESS;
57995805
fprintf(stdout, "\n\033[?25h");
5806+
if(rcascanmode == RCASCAN_ACTIVE)
5807+
{
5808+
if(beaconrcascancount == 0) fprintf(stderr, "0 BEACONs received (monitor mode is possibly broken)\n");
5809+
if(proberesponsercascancount == 0) fprintf(stderr, "0 PROBERESPONSEs received (packet injection is possibly broken)\n");
5810+
}
58005811
if(errorcount > 0) fprintf(stderr, "%u ERROR(s) during runtime (mostly caused by a broken driver)\n", errorcount);
58015812
if(errortxcount > 0) fprintf(stderr, "%u TX ERROR(s) during runtime (mostly caused by a broken driver)\n", errortxcount);
58025813
fprintf(stdout, "%u Packet(s) captured by kernel\n", lStats.tp_packets);

0 commit comments

Comments
 (0)