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 when profiling a OnePlus 11 5G. #168

Closed joshschmelzle closed 4 months ago

joshschmelzle commented 10 months ago

Describe the bug Profiler crashes when profiling a OnePlus 11 5G.

To Reproduce Happens every time.

Debug output Request to include two debug outputs:

wlanpi@wlanpi-3e4-dev:[~/wlanpi-profiler]: sudo venv/bin/python -m profiler --debug
2023-08-22 12:03:29,173 [DEBUG] start: profiler version 1.0.16-dev.1
2023-08-22 12:03:29,174 [DEBUG] start: python platform version is 3.9.2
2023-08-22 12:03:29,174 [DEBUG] start: scapy version is 2.4.5
2023-08-22 12:03:29,200 [DEBUG] start: profiler.manager pid 114408
2023-08-22 12:03:29,203 [DEBUG] start: config {'GENERAL': {'channel': 36, 'ssid': 'Profiler 3e4', 'interface': 'wlan0', 'ft_disabled': False, 'he_disabled': False, 'listen_only': False, 'hostname_ssid': False, 'files_path': '/var/www/html/profiler', 'frequency': 0}}
2023-08-22 12:03:29,272 [DEBUG] interface: wlan0 has a mac80211 stack
2023-08-22 12:03:29,303 [DEBUG] interface: phy0 maps to provided wlan0
2023-08-22 12:03:29,304 [DEBUG] interface: new wlan0mon will map to phy0
2023-08-22 12:03:29,305 [DEBUG] interface: frequency is set to 5180 which maps to channel 36
2023-08-22 12:03:29,362 [DEBUG] interface: reg domain set to country US: DFS-FCC
2023-08-22 12:03:29,363 [DEBUG] interface: see 'iw reg get' for details
2023-08-22 12:03:29,363 [DEBUG] interface: mac: 8c:88:2a:00:25:b3, channel: 36, driver: mt76x2u, driver-version: 6.1.38-v8-wlanpi+, chipset: MediaTek MT7612U 802.11a/b/g/n/ac
2023-08-22 12:03:29,363 [DEBUG] interface: start stage_interface
2023-08-22 12:03:29,373 [DEBUG] interface: wpa_cli version is v2.10
2023-08-22 12:03:29,386 [DEBUG] interface: ip utility, iproute2-5.9.0, libbpf 0.3.0
2023-08-22 12:03:29,397 [DEBUG] interface: iw version 5.19
2023-08-22 12:03:29,397 [DEBUG] interface: running '['wpa_cli', '-i', 'wlan0', 'terminate']'
2023-08-22 12:03:29,408 [DEBUG] interface: finished with '['wpa_cli', '-i', 'wlan0', 'terminate']'
2023-08-22 12:03:29,423 [DEBUG] interface: finish stage_interface
2023-08-22 12:03:29,424 [DEBUG] interface: run: iw phy0 interface add wlan0mon type monitor flags none
2023-08-22 12:03:29,449 [DEBUG] interface: run: ip link set wlan0mon up
2023-08-22 12:03:29,465 [DEBUG] interface: run: ip link set wlan0 down
2023-08-22 12:03:29,501 [DEBUG] interface: run: iw wlan0mon set freq 5180 HT20
2023-08-22 12:03:29,559 [DEBUG] start: finish interface setup and staging ...

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

Getting started:

 - Associate your Wi-Fi client to *our* SSID: Profiler 3e4
 - Enter any random password to connect
 - Authentication will fail, which is OK
 - We should receive an association request to 8c:88:2a:00:25:b3
 - Results are then saved locally and printed on the shell
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2023-08-22 12:03:29,563 [DEBUG] start: beacon process
2023-08-22 12:03:29,566 [DEBUG] update_ssid_record: updated /var/run/wlanpi-profiler.ssid record with: Profiler 3e4
2023-08-22 12:03:29,577 [DEBUG] start: sniffer process
2023-08-22 12:03:29,605 [DEBUG] fakeap.py: beacon pid: 114531; parent pid: 114408
2023-08-22 12:03:29,609 [DEBUG] fakeap.py: sniffer pid: 114532; parent pid: 114408
2023-08-22 12:03:29,622 [DEBUG] fakeap.py: <socket.socket fd=10, family=AddressFamily.AF_PACKET, type=SocketKind.SOCK_RAW, proto=768, laddr=('wlan0mon', 3, 0, 803, b'\x8c\x88*\x00%\xb3')>
2023-08-22 12:03:29,625 [DEBUG] start: profiler process
2023-08-22 12:03:29,630 [DEBUG] fakeap.py: <socket.socket fd=12, family=AddressFamily.AF_PACKET, type=SocketKind.SOCK_RAW, proto=768, laddr=('wlan0mon', 3, 0, 803, b'\x8c\x88*\x00%\xb3')>
2023-08-22 12:03:29,648 [DEBUG] profiler.py: profiler pid: 114533; parent pid: 114408
0000  00 00 08 00 00 00 00 00 80 00 00 00 FF FF FF FF  ................
0010  FF FF 8C 88 2A 00 25 B3 8C 88 2A 00 25 B3 00 00  ....*.%...*.%...
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 33 65 34 01 08 8C 12 98 24  ofiler 3e4.....$
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 3D 16 24 00 04 00 00 00 00 00 00  .....=.$........
0090  00 00 00 00 00 00 00 00 00 00 00 00 00 36 03 45  .............6.E
00a0  C2 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 FF 23 23 0D 01 00 02 40  ....$....##....@
00d0  00 04 70 0C 89 7F 03 80 04 00 00 00 AA AA AA AA  ..p.............
00e0  7B 1C C7 71 1C C7 71 1C C7 71 1C C7 71 FF 07 24  {..q..q..q..q..$
00f0  F4 3F 00 19 FC FF FF 03 27 05 00 FF 0E 26 09 03  .?......'....&..
0100  A4 28 27 A4 28 42 73 28 62 72 28 FF 03 3B 00 00  .('.(Bs(br(..;..
0110  DD 18 00 50 F2 02 01 01 8A 00 03 A4 00 00 27 A4  ...P..........'.
0120  00 00 42 43 5E 00 62 32 2F 00                    ..BC^.b2/.
2023-08-22 12:03:29,676 [DEBUG] fakeap.py: origin beacon hexdump None
2023-08-22 12:03:29,676 [INFO] fakeap.py: starting beacon transmissions
2023-08-22 12:03:30,803 [DEBUG] fakeap.py: sent probe resp to a8:8e:24:a1:06:f3
2023-08-22 12:03:30,824 [DEBUG] fakeap.py: sent probe resp to a8:8e:24:a1:06:f3
2023-08-22 12:03:35,873 [DEBUG] fakeap.py: sent probe resp to 30:bb:7d:c7:c1:2b
2023-08-22 12:03:35,916 [DEBUG] fakeap.py: sent probe resp to 30:bb:7d:c7:c1:2b
2023-08-22 12:03:41,121 [DEBUG] fakeap.py: sent probe resp to a8:8e:24:a1:06:f3
2023-08-22 12:03:41,149 [DEBUG] fakeap.py: sent probe resp to a8:8e:24:a1:06:f3
2023-08-22 12:03:41,489 [DEBUG] fakeap.py: adding assoc req from 8a:c0:99:a1:7d:c4 to queue
2023-08-22 12:03:41,491 [DEBUG] fakeap.py: assoc req seen for b'Profiler 3e4' (8c:88:2a:00:25:b3) by MAC 8a:c0:99:a1:7d:c4
2023-08-22 12:03:41,517 [DEBUG] profiler.py: detected freq from assoc is 5180
2023-08-22 12:03:41,520 [DEBUG] update_last_profile_record: updated /var/run/wlanpi-profiler.last_profile record with: 8ac099a17dc4
2023-08-22 12:03:41,520 [DEBUG] profiler.py: detected freq from assoc maps to channel 36
2023-08-22 12:03:41,522 [DEBUG] analyze_assoc_req: 13 IEs detected in assoc req from 8a:c0:99:a1:7d:c4: dict_keys([0, 1, 33, 36, 48, 70, 54, 59, 45, 127, 191, 255, 221])
Process profiler:
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 "/home/wlanpi/wlanpi-profiler/profiler/profiler.py", line 91, in __init__
    self.run(queue)
  File "/home/wlanpi/wlanpi-profiler/profiler/profiler.py", line 118, in run
    self.profile(frame)
  File "/home/wlanpi/wlanpi-profiler/profiler/profiler.py", line 169, in profile
    ssid, oui_manuf, chipset, capabilities = self.analyze_assoc_req(frame, is_6ghz)
  File "/home/wlanpi/wlanpi-profiler/profiler/profiler.py", line 1148, in analyze_assoc_req
    oui_manuf = self.resolve_oui_manuf(frame.addr2, dot11_elt_dict)
  File "/home/wlanpi/wlanpi-profiler/profiler/profiler.py", line 505, in resolve_oui_manuf
    element_data[0], element_data[1], element_data[2]
IndexError: list index out of range
2023-08-22 12:03:41,556 [DEBUG] removeVif: Removing monitor vif ...
2023-08-22 12:03:41,556 [DEBUG] interface: run: ip link set wlan0mon down
2023-08-22 12:03:42,199 [DEBUG] interface: run: iw dev wlan0mon del
2023-08-22 12:03:42,259 [DEBUG] interface: run: ip link set wlan0 up
2023-08-22 12:03:42,280 [WARNING] fakeap.py: beacon(): network is down or no such device (wlan0mon) ... exiting ...
2023-08-22 12:03:42,854 [DEBUG] start: shutdown profiler process (1)
2023-08-22 12:03:42,955 [DEBUG] start: shutdown txbeacons process (14)
2023-08-22 12:03:43,179 [DEBUG] start: shutdown sniffer process (-9)