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

Add `-f` Option Allowing User to Specify Frequency #88

Closed joshschmelzle closed 2 years ago

joshschmelzle commented 2 years ago

This PR enables us to use the profiler to stage the Intel AX210 on a particular Wi-Fi 6E frequency and passively listen for association requests.

-f is mutually exclusive with -c, one or the other must be provided, but not both.

Example:

(venv) wlanpi@wlanpi-emmc-513-ioboard:[~/dev/wlanpi-profiler]: sudo venv/bin/python3 -m profiler --noAP -f 5975
[sudo] password for wlanpi: 
2021-11-11 23:14:26,120 [INFO] interface: performing scan on wlan0
2021-11-11 23:14:26,121 [INFO] interface: run: ip link set wlan0 down
2021-11-11 23:14:26,148 [INFO] interface: run: iw dev wlan0 set type managed
2021-11-11 23:14:26,157 [INFO] interface: run: ip link set wlan0 up
2021-11-11 23:14:26,446 [INFO] interface: run: iw wlan0 scan
2021-11-11 23:14:28,994 [INFO] interface: run: iw phy0 interface add wlan0mon type monitor flags none
2021-11-11 23:14:29,014 [INFO] interface: run: ip link set wlan0mon up
2021-11-11 23:14:29,026 [INFO] interface: run: ip link set wlan0 down
2021-11-11 23:14:29,043 [INFO] interface: run: iw wlan0mon set freq 5975 HT20

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting profiler in listen only mode using wlan0mon on 5 (5975):

Instructions:
 - Associate your Wi-Fi client to *any* SSID on the listening frequency above
 - We should hear and passively receive any association requests
 - Results are saved locally and printed to screen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2021-11-11 23:14:29,071 [WARNING] start: beacon process not started because user requested listen only mode
2021-11-11 23:14:37,941 [INFO] profiler.py: discovered association request for 10:3d:1c:aa:22:cc to 6ghzonlyssid
2021-11-11 23:14:37,941 [INFO] profiler.py: generating text report for 10:3d:1c:aa:22:cc
---------------------------------------------
 - SSID: 6ghzonlyssid
 - Client MAC: 10:3d:1c:aa:22:cc
 - OUI manufacturer lookup: Intel
 - Frequency band: 6 GHz
 - Capture channel: 5
---------------------------------------------
802.11k              Supported           
802.11r              Not reported*       
802.11v              Supported           
802.11w              Supported           
802.11n              Not reported*       
802.11ac             Not reported*       
802.11ax             Supported (2ss), MCS 0-11, [X] 160 MHz, [ ] TWT, [ ] Punctured Preamble, [ ] SU Beamformer, [X] SU Beamformee, [X] HE ER SU PPDU, [ ] UORA, [ ] BSR
Max Power            15 dBm              
Supported Channels   Not reported        

Key: [X]: Supported, [ ]: Not supported
* Reported client capabilities are dependent on available features at the time of client association.
** Reported channels do not factor local regulatory domain. Detected channel sets are assumed contiguous.
^CDetected SIGINT or Control-C ... Removing monitor interface ...
2021-11-11 23:14:39,837 [INFO] interface: run: ip link set wlan0mon down
2021-11-11 23:14:39,871 [INFO] interface: run: iw dev wlan0mon del
2021-11-11 23:14:39,915 [INFO] interface: run: ip link set wlan0 up
Exiting ...
joshschmelzle commented 2 years ago

Tested adapters:

Tested platforms: