How To Guide Get BCM4389 into monitor mode for WIFI sniffing

Search This thread

ccfries

Member
Mar 19, 2015
11
50
Chicago
Google Pixel 6 Pro
Hey all,

I was trying to watch beacon frames transmitted by my access point, but had no capable hardware in my house to sniff it. Or did I?

Turns out, Pixel 6 / Pixel 6 Pro can do it. Here's my howto.

Short answer: Flash an aosp_raven-userdebug build from Google, then use wifi_sniffer and some related system properties to configure frequency and bandwidth, and enable monitor mode using a special firmware that is shipped in the userdebug build. Then, use tcpdump on the newly created radiotap0 interface.

Enjoy,
Chris
 

ccfries

Member
Mar 19, 2015
11
50
Chicago
Google Pixel 6 Pro
Is there any real difference from doing it this way?

Hi x56x, a dependency for that is "3. WiFi chipset that actually uses the QCACLD driver/firmware."

Since Pixel 6 uses a Broadcom WIFI chip and not Qualcomm, you would need my directions for Pixel 6 and 6 Pro.

-Chris
 

x56x

Member
Jan 20, 2021
13
4
Google Nexus 5
Samsung Galaxy S5
Hi x56x, a dependency for that is "3. WiFi chipset that actually uses the QCACLD driver/firmware."

Since Pixel 6 uses a Broadcom WIFI chip and not Qualcomm, you would need my directions for Pixel 6 and 6 Pro.

-Chris
I actually used these commands for qualcomm on a rooted stock A12 P6P and it worked flawlessly. Never got a chance to mess around with packet sniffing. I am curious as to how you found this? Maybe someone can take a deeper look at the firmware and start working on packet injection.
 

ccfries

Member
Mar 19, 2015
11
50
Chicago
Google Pixel 6 Pro
I actually used these commands for qualcomm on a rooted stock A12 P6P and it worked flawlessly. Never got a chance to mess around with packet sniffing. I am curious as to how you found this? Maybe someone can take a deeper look at the firmware and start working on packet injection.

I don't think it could work

raven:/ # ls -l /sys/module/wlan/parameters/con_mode
ls: /sys/module/wlan/parameters/con_mode: No such file or directory
 

ccfries

Member
Mar 19, 2015
11
50
Chicago
Google Pixel 6 Pro
Just to be sure, you can sniff WIFI packets that the kernel sees, without any changes and just root, using tcpdump. If you want to see other traffic that the WIFI chip would normally filter out, you need monitor mode and you need to load this separate firmware to get into monitor mode.
 
I pulled the wifi sniffer binary, firmware and .rc files needed to get monitor mode working and packed them into a magisk module. you can find it here on my github

 
Mar 24, 2023
5
1
I pulled the wifi sniffer binary, firmware and .rc files needed to get monitor mode working and packed them into a magisk module. you can find it here on my github

Tried to install today, Didnt see a Release on the Github page, tried to manually compile the magisk module and just get error "Failed to unzip" in magisk. Any ideas? Thanks regardless, been searching up and down for the Wifi_Sniffer binary
 
Mar 24, 2023
5
1
go to data/adb/modules look for the module and go to system/vendor/bin and change the permissions with

chmod a+x wifi_sniffer
chmod a+x wifi_perf_diag

i guess i need to fix that somehow
It starts now!! time for me to fiddle with this "Unable to open /sys/wifi/firmware_path, Failed to up radiotap0" error, surely i made a mistake.
 
i havent had much time to play with it. i was really hoping someone could figure it out and recount thier steps here.

i noticed some sepolicy stuff reguarding wifi_sniffer while building a few roms for pixel 7, theres an incomplete package to build it. right now adding the package to the device trees to build enables the sepolicy for it but thats it. we may not be able to use them with out using a beta preview until android 14 is released. thats speculation though, cause i dont know.

but please anyone that gets this working please share your steps
 
Mar 24, 2023
5
1
i havent had much time to play with it. i was really hoping someone could figure it out and recount thier steps here.

i noticed some sepolicy stuff reguarding wifi_sniffer while building a few roms for pixel 7, theres an incomplete package to build it. right now adding the package to the device trees to build enables the sepolicy for it but thats it. we may not be able to use them with out using a beta preview until android 14 is released. thats speculation though, cause i dont know.

but please anyone that gets this working please share your steps
I actually got useful help from ChatGPT. dmesg has an output of [wlan] wl_cfg80211_alert ←[0m: In : error alert eventing, reason=0x6, which indicated firmware corruption. Will start looking at the firmware file its self momentarily.
 
This is how i get wifi_sniffer to work. first download and install the nethunter firmware magisk module. check permissions of the binaries.

next reboot your device and disable wifi and data. This must be done in order to restart the wlan in monitor mode

now open terminal emulator and either type or copy and paste the commands below

in su shell

Code:
su

# Set bandwidth to 160 MHz for sniffing on 2.4 GHz

Code:
setprop persist.vendor.wifi.sniffer.bandwidth 160

# Set 2.4GHz band

Code:
setprop persist.vendor.wifi.sniffer.freq 2412

# start wifi sniffer

Code:
wifi_sniffer start

#tcp dump to .pcap file

Code:
tcpdump -i radiotap0 type mgt subtype beacon -w /data/beacon-capture.pcap
 

Top Liked Posts