WLAN-Pi / wlanpi-profiler

Wi-Fi client capabilities analyzer tool built for the WLAN Pi
BSD 3-Clause "New" or "Revised" License
23 stars 8 forks source link

profiler "crashes" #190

Open gcastle2007 opened 3 months ago

gcastle2007 commented 3 months ago

MCUZone Wi-FI 7 board with BE200.

Wlanpi image 3.2.0.

Everything has been updated to the latest versions (the errors were similar before the update).

sudo apt update sudo upgrade sudo wlanpi-update

wlanpi@wlanpi-d58:~ $ wlanpi-stats

┌────────────┐ │ WLAN Pi M4 │ └────────────┘ Mode: classic Release: 3.2.0 Uptime: 0 days, 0 hrs 20 mins 2 secs Date: Fri 22 Mar 2024 05:41:19 AM CDT Memory: Total: 1896MB, Used: 331MB, Free: 1304MB Disk: Total: 6.9GB, Used: 3.4GB, Free: 3.2GB CPU temp: 46°C CPU util: 4 % Internet: Reachable

Network interfaces: eth0 192.168.1.103 pan0 169.254.43.1

┌─────┐ │ Tip │ └─────┘ Check current IP settings of eth0 interface, speed, duplex, DHCP server details, and MAC address using "ipconfig".

wlanpi@wlanpi-d58:~ $

Afret start profiler create interface wlan0mon:

wlanpi@wlanpi-d58:~ $ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether d8:3a:dd:7d:6d:58 brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global dynamic eth0 valid_lft 28537sec preferred_lft 28537sec inet6 fe80::da3a:ddff:fe7d:6d58/64 scope link valid_lft forever preferred_lft forever 3: pan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether da:52:6f:9b:0d:db brd ff:ff:ff:ff:ff:ff inet 169.254.43.1/24 brd 169.254.43.255 scope global pan0 valid_lft forever preferred_lft forever 4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 link/ether e4:60:17:ec:46:09 brd ff:ff:ff:ff:ff:ff 5: wlan0mon: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 link/ieee802.11/radiotap e4:60:17:ec:46:09 brd ff:ff:ff:ff:ff:ff

The profiler "crashes":

wlanpi@wlanpi-d58:~ $ sudo profiler [sudo] password for wlanpi: 2024-03-22 05:28:34,880 [WARNING] interface: No IR found in iw channel information for 36 (5180) which may cause packet injection to fail! Problem with discovery? Try a different channel / frequency. Confirm we're beaconing via OTA capture from a different interface or device.

Starting a fake AP using wlan0mon on channel 36 (5180)

Getting started:

 - Associate your Wi-Fi client to *our* SSID: Profiler d58
 - Enter any random password to connect
 - Authentication will fail, which is OK
 - We should receive an association request to e4:60:17:ec:46:09
 - Results are then saved locally and printed on the shell

0000 00 00 08 00 00 00 00 00 80 00 00 00 FF FF FF FF ................ 0010 FF FF E4 60 17 EC 46 09 E4 60 17 EC 46 09 00 00 .....F....F... 0020 00 00 00 00 00 00 00 00 64 00 11 11 00 0C 50 72 ........d.....Pr 0030 6F 66 69 6C 65 72 20 64 35 38 01 08 8C 12 98 24 ofiler d58.....$ 0040 B0 48 60 6C 03 01 24 05 06 05 04 00 03 00 00 2D .H`l..$........- 0050 1A EF 19 1B FF FF FF FF 00 00 00 00 00 00 00 00 ................ 0060 20 00 00 00 00 00 00 00 00 00 00 30 18 01 00 00 ..........0.... 0070 0F AC 04 01 00 00 0F AC 04 02 00 00 0F AC 02 00 ................ 0080 0F AC 04 8C 00 36 03 45 C2 00 3D 16 24 00 04 00 .....6.E..=.$... 0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00a0 00 00 46 05 02 00 00 00 00 7F 08 00 00 08 00 00 ..F............. 00b0 00 00 40 BF 0C 32 00 80 03 AA FF 00 00 AA FF 00 ..@..2.......... 00c0 00 C0 05 00 24 00 00 00 DD 13 31 41 59 00 00 06 ....$.....1AY... 00d0 31 2E 30 2E 31 36 01 05 33 2E 32 2E 30 DD 18 00 1.0.16..3.2.0... 00e0 50 F2 02 01 01 8A 00 03 A4 00 00 27 A4 00 00 42 P..........'...B 00f0 43 5E 00 62 32 2F 00 FF 23 23 0D 01 00 02 40 00 C^.b2/..##....@. 0100 04 70 0C 89 7F 03 80 04 00 00 00 AA AA AA AA 7B .p.............{ 0110 1C C7 71 1C C7 71 1C C7 71 1C C7 71 FF 07 24 F4 ..q..q..q..q..$. 0120 3F 00 19 FC FF FF 03 27 05 00 FF 0E 26 09 03 A4 ?......'....&... 0130 28 27 A4 28 42 73 28 62 72 28 FF 09 6A 05 11 00 ('.(Bs(br(..j... 0140 00 00 FB 4F 3F FF 15 6C 00 00 E2 FF DB 00 18 36 ...O?..l.......6 0150 D8 1E 00 44 44 44 44 44 44 44 44 44 ...DDDDDDDDD 2024-03-22 05:28:34,996 [INFO] fakeap.py: starting beacon transmissions Process sniffer: Traceback (most recent call last): File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, *self._kwargs) File "/opt/wlanpi-profiler/lib/python3.9/site-packages/profiler/fakeap.py", line 591, in init sniff( File "/opt/wlanpi-profiler/lib/python3.9/site-packages/scapy/sendrecv.py", line 1311, in sniff sniffer._run(args, **kwargs) File "/opt/wlanpi-profiler/lib/python3.9/site-packages/scapy/sendrecv.py", line 1254, in _run session.on_packet_received(p) File "/opt/wlanpi-profiler/lib/python3.9/site-packages/scapy/sessions.py", line 109, in on_packet_received result = self.prn(pkt) File "/opt/wlanpi-profiler/lib/python3.9/site-packages/profiler/fakeap.py", line 632, in received_frame ssid = packet[Dot11Elt].info File "/opt/wlanpi-profiler/lib/python3.9/site-packages/scapy/packet.py", line 1327, in getitem raise IndexError("Layer [%s] not found" % name) IndexError: Layer [Dot11Elt] not found 2024-03-22 05:28:50,474 [WARNING] fakeap.py: beacon(): network is down or no such device (wlan0mon) ... exiting ... wlanpi@wlanpi-d58:~ $

What actions can I try in this situation?

adriangranados commented 3 months ago

No 5 or 6 GHz channels can be used with the profiler when using a BE200 module. See "No IR" error message:

2024-03-22 05:28:34,880 [WARNING] interface: No IR found in iw channel information for 36 (5180) which may cause packet injection to fail! Problem with discovery? Try a different channel / frequency. Confirm we're beaconing via OTA capture from a different interface or device.

Try a 2.4 GHz channel instead. For example:

sudo profiler -c 11

gcastle2007 commented 3 months ago

Yes, everything works in 2.4. Thank you. I'm sorry, I see the errors and skip at this message... But for some reason it still ends strangely...

wlanpi@wlanpi-d58:~ $ sudo profiler -c 11 [sudo] password for wlanpi:

Starting a fake AP using wlan0mon on channel 11 (2462)

Getting started:

 - Associate your Wi-Fi client to *our* SSID: Profiler d58
 - Enter any random password to connect
 - Authentication will fail, which is OK
 - We should receive an association request to e4:60:17:ec:46:09
 - Results are then saved locally and printed on the shell

dump removed...

2024-03-22 11:47:53,462 [INFO] fakeap.py: starting beacon transmissions 2024-03-22 11:47:59,042 [INFO] profiler.py: generating text report for 62:6b:2c:f4:22:bc

Key: [X]: Supported, [ ]: Not supported

adriangranados commented 3 months ago

So, just to clarify, is the profiler still crashing after outputting the report, or is it printing the stack trace after you terminate the profiler?

gcastle2007 commented 3 months ago

I have create video for you https://youtu.be/IAzSaech7oo

adriangranados commented 3 months ago

Thanks. The stack trace when exiting is not an error. It'd be nice if it exited cleanly, but it's not an error.

gcastle2007 commented 3 months ago

So this is normal situation?

If I run the profiler via the web interface, it also stops after some time.

adriangranados commented 3 months ago

Exiting unexpectedly is not normal. We'll need to investigate.

gcastle2007 commented 3 months ago

If I can help with this in any way, please write with what and how.