Debug debug debug.
This commit is contained in:
parent
295f17bd91
commit
5132183aa3
1 changed files with 6 additions and 0 deletions
|
@ -25,22 +25,28 @@ def get_clients_on_ap(capture, ap_bssid):
|
||||||
for packet in capture:
|
for packet in capture:
|
||||||
try:
|
try:
|
||||||
if not hasattr(packet, 'wlan'):
|
if not hasattr(packet, 'wlan'):
|
||||||
|
print("No WLAN layer found in packet")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sa = getattr(packet.wlan, 'sa', '').lower()
|
sa = getattr(packet.wlan, 'sa', '').lower()
|
||||||
da = getattr(packet.wlan, 'da', '').lower()
|
da = getattr(packet.wlan, 'da', '').lower()
|
||||||
bssid = getattr(packet.wlan, 'bssid', '').lower()
|
bssid = getattr(packet.wlan, 'bssid', '').lower()
|
||||||
|
print(f"Processing packet: SA={sa}, DA={da}, BSSID={bssid}")
|
||||||
|
|
||||||
# Count any frame *to or from* a client, if AP is involved
|
# Count any frame *to or from* a client, if AP is involved
|
||||||
if bssid == ap_bssid or sa == ap_bssid or da == ap_bssid:
|
if bssid == ap_bssid or sa == ap_bssid or da == ap_bssid:
|
||||||
|
print("Found packet related to AP")
|
||||||
# If it's the AP sending, add the destination (client)
|
# If it's the AP sending, add the destination (client)
|
||||||
if sa == ap_bssid and da and da != ap_bssid:
|
if sa == ap_bssid and da and da != ap_bssid:
|
||||||
|
print(f"Adding client: {da}")
|
||||||
clients.add(da)
|
clients.add(da)
|
||||||
# If it's the client sending, add the source
|
# If it's the client sending, add the source
|
||||||
elif sa and sa != ap_bssid:
|
elif sa and sa != ap_bssid:
|
||||||
|
print(f"Adding client: {sa}")
|
||||||
clients.add(sa)
|
clients.add(sa)
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
print("Attribute error in packet processing")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return len(clients)
|
return len(clients)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue