Question Kali NetHunter with BT & Wifi in kernel for ROG 6? - Asus ROG Phone 6 / 6 Pro

I want to use nethunter wifi and bluetooth scanning tools with the current device wifi and bluetooth hardware.
I have a ROG 6, already rooted. Works great. Have NetHunter. Only issue is that Kali NH tools like airmon-ng (wifi scanning) and hciconfig (bluetooth scanning) cannot access the hardware. I understand that the Nethunter kernel needs to be changed in some way to allow this. Does anyone have any hints on where to start? (googling the past few days has not revealed any actionable methods)
Even with device rooted and sudo user in nh. the message is
Code:
# hciconfig scan
Can't open HCI Socket.: Permission Denied

Dread|Reaper said:
I want to use nethunter wifi and bluetooth scanning tools with the current device wifi and bluetooth hardware.
I have a ROG 6, already rooted. Works great. Have NetHunter. Only issue is that Kali NH tools like airmon-ng (wifi scanning) and hciconfig (bluetooth scanning) cannot access the hardware. I understand that the Nethunter kernel needs to be changed in some way to allow this. Does anyone have any hints on where to start? (googling the past few days has not revealed any actionable methods)
Even with device rooted and sudo user in nh. the message is
Code:
# hciconfig scan
Can't open HCI Socket.: Permission Denied
Click to expand...
Click to collapse
Follow this guide https://www.kali.org/docs/nethunter/porting-nethunter-kernel-builder/ or
Do you have a kernel source for your OS?

Dread|Reaper said:
I want to use nethunter wifi and bluetooth scanning tools with the current device wifi and bluetooth hardware.
I have a ROG 6, already rooted. Works great. Have NetHunter. Only issue is that Kali NH tools like airmon-ng (wifi scanning) and hciconfig (bluetooth scanning) cannot access the hardware. I understand that the Nethunter kernel needs to be changed in some way to allow this. Does anyone have any hints on where to start? (googling the past few days has not revealed any actionable methods)
Even with device rooted and sudo user in nh. the message is
Code:
# hciconfig scan
Can't open HCI Socket.: Permission Denied
Click to expand...
Click to collapse
hi! please write if you have any success in creating the core.

Related

[Guide] USB Tether Phone to XOOM (ICS)

Disclaimer: I am not responsible for any damage you do to yourself or your device by following this guide (Although it seems very unlikely to happen).
USB Tether Phone to XOOM Guide.
I could not find a guide for this anywhere and it took me quite a while to figure out how it works so I thought I'll post a guide for other noobs like me, who want to share their phones data plan with their XOOM via USB tethering.
Since I only got a Wifi XOOM because I didn't want to spend money on a second data plan I used to wifi-tether my phone to my XOOM for internet connection. Unfortunately, Wifi-tethering drains the battery of my phone quite fast and the battery gets extremely hot so I was looking for an alternative.
Finally, I managed to share my phones internet connection with my XOOM via USB tether. Here is how it goes:
What you need:
* USB OTG cable (micro! not mini) - can be found at amazon, ebay, etc. for $5
* Phone that is capable of USB tethering (e.g. Xperia X8 \w miniCM7 / nAa kernel)
* XOOM running Team EOS ICS
* Tegra Development Overlay Rev 4 [link]
* Terminal Emulator (can be found in the play store)
I wont cover how to install Team EOS ICS since this can be found elsewhere.
What to do:
Step One - Install and Load the Drivers Needed
After you downloaded the Tegra Development overlay, flash it using eg. CMW over your existing Team EOS ICS. This will ad a whole bunch of extra modules (drivers) and a couple of init files to your system. Including the modules needed to USB tether your phone to the XOOM.
I don't know what would happen if you flashed the Development Overlay over any other ROM/Kernel than the one provided by Team EOS. But I would not recommend it!
[ADDITIONAL REMARK]
Note: If you really dont know anything about working with adb just ignore the following lines and go straight to Step Two. This is not necessary to get USB tethering working.
The Tegra Development Overlay contains the modules (drivers) needed for USB tethering a phone to the XOOM (and loads of others). The modules needed are: rndis_wlan.ko and rndis_host.ko.
After you flash the Dev Overlay, there will be a file called 06modules at /system/etc/init.d/. This file loads all 99 modules found at /system/lib/modules/. Since you actually just need 1 of those modules you might want to delete the "06modules" file and load the module needed manually by typing the following into your terminal emulator:
Code:
[STRIKE]modprobe rndis_wlan[/STRIKE]
modprobe rndis_host
This should load the module. You can check if the module was loaded successfully by using the following command:
Code:
lsmod
This will list all currently loaded modules.
Step Two - Connecting Your Phone
Switch on USB tethering on your phone and connect it to your XOOM via the OTG cable.
In the Terminal Emulator type:
Code:
dmesg
the output should look something like this:
Code:
[...]
<6>[ 150.829115] usb 2-1: new high speed USB device number 2 using tegra-ehci
<3>[ 154.608633] usb 2-1: device not accepting address 2, error -71
<3>[ 154.667257] hub 2-0:1.0: unable to enumerate USB device on port 1
<6>[ 154.945974] usb 2-1: new high speed USB device number 4 using tegra-ehci
<6>[ 155.002843] usb 2-1: New USB device found, idVendor=0fce, idProduct=812e
<6>[ 155.003359] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 155.004103] usb 2-1: Product: SEMC HSUSB Device
<6>[ 155.004388] usb 2-1: Manufacturer: SEMC
<6>[ 155.004658] usb 2-1: SerialNumber: CB511N60A1
<6>[ 155.066353] rndis_host 2-1:1.0: [B]usb0[/B]: register 'rndis_host' at usb-tegra-ehci.0-1, RNDIS device, 4e:7e:5d:7e:b9:1d
This indicates that your phone was successfully connected to your XOOM and the respective modules were loaded. Note the last line, right where it says rndis_host 2-1:1.0: usb0. Don't worry if it does not say "usb0" but e.g. "usb1" just keep it in mind for later.
Step Three - Assigning an IP Adress and Setting up the DNS server
Now that your phone is connected and registered the xoom needs to get an ip adress and a DNS server. This is done by typing the following into the Terminal Emulator:
Code:
su
dhcpcd [B]usb0[/B]
setprop net.dns1 8.8.8.8
"su" grants the terminal emulator SuperUser rights which are needed for the next step.
"dhcpcd usb0" starts an DHCP client for the interface "usb0" and asks for an IP adress. Now if you did not get "usb0" in step two but e.g. "usb1" then change the command accordingly.
"setprop net.dns1 8.8.8.8" sets the DNS server to Google's DNS Server (8.8.8.8), but you can, of course, use any DNS server you like.
If you write "ifconfig" in the Terminal Emulator you now should get an output like
Code:
usb0 Link encap:Ethernet HWaddr 4E:7E:5D:7E:B9:1D
[B]inet addr:192.168.42.187 [/B] Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::4c7e:5dff:fe7e:b91d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:295 errors:0 dropped:0 overruns:0 frame:0
TX packets:420 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:108787 (106.2 KiB) TX bytes:81153 (79.2 KiB)
Indicating that an IP adress has been successfully assigned to your XOOM.
And voilà. Now you have a working internet connection via USB tethering from your phone to your XOOM.
Unfortunately there are a couple of downsides:
* There seems to be a glitch in the rndis_wlan.ko or rndis_host.ko module causing a reboot of the XOOM whenever you disconnect your phone from your XOOM after USB tether or force unload the module after you tethered your phone. This issue is known and I hope it will be fixed in the future.
* The procedure described will only enable internet for your Browser, not for your mail apps (confirmed) and possibly not for any other app (did not try yet). Apparently you need to alter some settings (like adding the DNS server for the Browser) to make those apps work properly. Now, this might be very easy but since I'm a linux/android noob I did not yet figure out how.
TO DO
* The modules need to be fixed to solve the reboot issue. However, I am likely not skilled enough to do so, so this is up to Team EOS.
* Settings need to be passed to mail apps. Now this should be fairly easy and I'll try to figure that out.
* A one click app to configure the internet connection would be great. I never did any linux/android coding, but I'll give it a shot.
Thanks a lot to bigrushdog for helping with the rndis_host.ko bugs!!!
Any suggestions or thanks are welcome!
I'm gonna grab this spot cause you are gonna need some help on this one. Good post.
I have a lot of info on this, and will post what I got shortly. LTE devices use usb0 to facilitate radio operations. So rndis host assigns usb1 in this case. I'm not sure about the other builds. Also, ill take a fresh look at the hard reboot issue. I know something causes a kernel panic, but I'm not sure where the fail lies.
modprobe rndis_host
The rndis_wlan is not needed. That's for a rare build of wireless dongles.
I just tried to use USB tethering a couple days ago and had an issue... Thanks for this I was hoping it would be implemented in an updated kernel...
playya said:
I just tried to use USB tethering a couple days ago and had an issue... Thanks for this I was hoping it would be implemented in an updated kernel...
Click to expand...
Click to collapse
I'm about 100% sure it won't be in the release versions of the tiamat kernel. Rndis is just too unstable and wonky to be in a distro kernel. We need the distro kernel to be as stable as possible. That's why I do the overlay. Also, I use overlay users a guinea pigs to see what works and what don't. My test build with a new rndis driver doesn't work. Ill keep at it.
bigrushdog said:
I'm gonna grab this spot cause you are gonna need some help on this one. Good post.
I have a lot of info on this, and will post what I got shortly. LTE devices use usb0 to facilitate radio operations. So rndis host assigns usb1 in this case. I'm not sure about the other builds. Also, ill take a fresh look at the hard reboot issue. I know something causes a kernel panic, but I'm not sure where the fail lies.
modprobe rndis_host
The rndis_wlan is not needed. That's for a rare build of wireless dongles.
Click to expand...
Click to collapse
Thanks a lot for your help on this!
Wow! Awesome this really works , thanks for sharing this mate, and I hope the reboot problem will be fix.
just curious, if your phone have support by cm7, you can also use bluetooth tethering which is less of a work. My wife's htc hero doesn't support infrastructure mode but her phone run cm7 and in there I can bluetooh tether to the xoom without a single problem. Just thought I'd ask.
dumb question. why use usb tether. wifi tether works just fine on my tbolt using opengarden wi-tether. dont think the battery drains any different since data pull is more. Also what device do you have that the battery is getting hot?
I got an Xperia X8 running MiniCM7. The X8 doesnt offer any kinder of tethering from stock and miniCM7/nAa kernel only offers usb or wifi tether. So bluetooth tether is no option for me.
And my phone is draining a large amount of battery when wifi AP and 3G is enabled. This also results in the phone getting hot. It needs excessive amounts of power and this heats up the battery.
Using USB tethering has a couple of advantages. First it is safer since you dont use wireless connections apart from 3G, second you consume less battery (wifi AP does need a lot of power) and third I actually charge my battery while sharing my internet connection with my XOOM.
Also I really just like the idea of USB tethering my phone to my XOOM...
MagicVie said:
I got an Xperia X8 running MiniCM7. The X8 doesnt offer any kinder of tethering from stock and miniCM7/nAa kernel only offers usb or wifi tether. So bluetooth tether is no option for me.
And my phone is draining a large amount of battery when wifi AP and 3G is enabled. This also results in the phone getting hot. It needs excessive amounts of power and this heats up the battery.
Using USB tethering has a couple of advantages. First it is safer since you dont use wireless connections apart from 3G, second you consume less battery (wifi AP does need a lot of power) and third I actually charge my battery while sharing my internet connection with my XOOM.
Also I really just like the idea of USB tethering my phone to my XOOM...
Click to expand...
Click to collapse
Fair enough but according to Cyanogenmod site your x8 can run cm7.1. In CM7.1 when you paired the xoom and your x8, and going into the xoom bluetooth properties there's an option to share internet from your paired phone (x8).
Just thought I'd give you an alternative option from usb tether that's all. Take care!
I'm running the Team EOS wingray "nightly build 90" and can't seem to get past "modprobe rndis_host" (the lsmod output does not include rndis_host - when I execute "modprobe rndis_host" without "su" first, I get "modprobe: 'rndis_host.ko': Operation not permitted" - if I execute after su, I get "modprobe: 'rndis_host.ko': invalid module format") - any suggestions?
Tom
tadiv said:
I'm running the Team EOS wingray "nightly build 90" and can't seem to get past "modprobe rndis_host" (the lsmod output does not include rndis_host - when I execute "modprobe rndis_host" without "su" first, I get "modprobe: 'rndis_host.ko': Operation not permitted" - if I execute after su, I get "modprobe: 'rndis_host.ko': invalid module format") - any suggestions?
Tom
Click to expand...
Click to collapse
I fell back to build 84 and got the same results...
Sent from my Xoom using XDA
I think I understand
tadiv said:
I fell back to build 84 and got the same results...
Sent from my Xoom using XDA
Click to expand...
Click to collapse
Other related posts (such as http://forum.xda-developers.com/showthread.php?t=1513490 ) suggest that this overlay is for version 3.0.5 of the kernel - both of the builds I noted above have later versions of the kernel...
Tom
---------- Post added at 10:30 AM ---------- Previous post was at 09:44 AM ----------
tadiv said:
Other related posts (such as http://forum.xda-developers.com/showthread.php?t=1513490 ) suggest that this overlay is for version 3.0.5 of the kernel - both of the builds I noted above have later versions of the kernel...
Tom
Click to expand...
Click to collapse
Yup, I loaded the Team EOS 1.0.0 and it works - in fact, this post is via usb tethering from my Xoom!
Tom
---------- Post added at 10:52 AM ---------- Previous post was at 10:30 AM ----------
MagicVie said:
.
TO DO
* The modules need to be fixed to solve the reboot issue. However, I am likely not skilled enough to do so, so this is up to Team EOS.
* Settings need to be passed to mail apps. Now this should be fairly easy and I'll try to figure that out.
* A one click app to configure the internet connection would be great. I never did any linux/android coding, but I'll give it a shot.
Thanks a lot to bigrushdog for helping with the rndis_host.ko bugs!!!
Any suggestions or thanks are welcome!
Click to expand...
Click to collapse
I have successfully used the 'scripter' app to set this up -
My script is as follows:
modprobe rndis_host
dhcpcd usb0
setprop net.dns1 8.8.8.8
Scripter reports errors, but it works...
Tom
The latest overlay contains our 3.0.9 version kernel. And the overlay works with any eos build and likely any rom. We continue to research the reboot issue .
I do show the 3.0.9 kernel now with the overlay on the 1.0.0 ROM - but I assure you, I could not load the module with the nightly builds I mentioned above...
Tom
tadiv said:
I do show the 3.0.9 kernel now with the overlay on the 1.0.0 ROM - but I assure you, I could not load the module with the nightly builds I mentioned above...
Tom
Click to expand...
Click to collapse
With the overlay, there is no need to load any modules. They load automatically on boot.
bigrushdog said:
With the overlay, there is no need to load any modules. They load automatically on boot.
Click to expand...
Click to collapse
Sure enough - I don't know what I was doing wrong before, but now I have rndis_host in the lsmod output like it should be on the nightly build 90 and the overlay... As a point of detail, I restored my nandroid of nightly 90 then applied the overlay and it just worked.
Thanks!!
Tom
P.S. The working scripter script is now:
dhcpcd usb0
setprop net.dns1 8.8.8.8
Modified 06modules
Instead of deleting the 06modules file, I edited it to look like:
--------------------------------
#!/system/bin/sh
#
# Load any extra modules
#
#MODPATH=/system/lib/modules/
#
#for i in `ls $MODPATH`
#do
#modprobe `basename $i .ko` >/dev/null 2>&1
#done
#exit 0
modprobe rndis_host
--------------------------------
commenting out everything but the last line that I added. This way I keep the original code, but only load the module I want to use... The editor I used created a 06modules.bak and that file had to be deleted, because it was also executed with the result of loading all the modules... Once it was deleted, only the rndis_host module is being loaded.
Tom
For the adventurous type look here
http://forum.xda-developers.com/showthread.php?t=1494891
This is a thread on using 3g dongles. However, there is a.wealth of information on IP routing that should apply here as well.

KVM Kernel

Hello everyone.
As in subject, I'm looking for a KVM Enabled Kernel, to flash on my device.
I'm looking for:
1) File to download
2) Commands to FastBoot
3) A way to ensure it works
Thanks in advance for any help.
Bye, Ivano.
P.S.: I forgot to mention, it's a ZE551ML Z00AD
P.P.S.: Nevermind, I successfully flashed KVM on device, but I can't use it on Limbo yet (I get an error about missing modules, but they're there).
Any help greatly appreciated.
I never got limbo to work, I have exact same model you have (Z00AD) and I've got kvm working with QEMU.. Limbo doesnt detect kvm properly it doesn't see the kernel modules loaded..
Theres a few guides on here how to use QEMU but as a VERY rough idea on what you need to do is:
Install a chroot linux on the phone (I used Linux Deploy to set up Ubuntu with Xterm)
After chroot setup, install qemu-kvm with apt. And on the Android OS install aSpice client from play store
Move the install images/hdd images to the phone storage (if preinstalled os hdd with Virtualbox or something)
Launch qemu with --enable-kvm and -cpu host to get kvm working, adjust other options as needed
Sorry for such a quick write up I'm busy atm, can help more later
My problem is that gpu won't work with chroot
You wont get gpu access with chroot, some devices have GPU's that have some support but unfortunately our
specific PowerVR chips dont have support.. using QEMU with kvm will allow you to still use all other parts of your hardware, and using spice will allow the use of the QXL video driver that provides some basic acceleration in the guest.
Either that or in the chroot compile and build your own version of qemu with -virglrenderer enabled, but the virgl option is very beta and may not work
Edit: Limbo is just a front end to QEMU so you wont have any new features that qemu doesn't have.. just Limbo is a port of qemu that's stripped down to work on Android
In this case, I don't need this anymore.
Thanks for your help.
What kind of 3D software/GPU needy task are you needing? Because in theory I've read that a linux chroot may still have some graphics acceleration on android devices due to some linux device firmware has OpenGL ES support (which is what runs on android devices, a subset of standard OpenGL) but how I personally am not sure.. I know there is GL4ES that supposed to allow OpenGL calls to be converted/linked to OpenGL ES calls but you would have to compile it from source as it's aimed at arm hardware..

There is an internal problem with your device

Hey!
I try to port nethunter kernel to redmi 7.
But every restart i got this message: "There is an internal problem with your device ..."
build.date, build.date.utc, build.fingerprint lines are the same at /vendor/build.prop and /system/build.prop files.
When I not change anything in the source code, and build and install then no message.
Only System V IPC & Generic IEEE 802.11 Networking Stack (mac80211) & Ralink WLAN USB Driver Enabled.
Everything works fine no kernel panic or etc. just the message is confusing.
Can I somehow find out the cause of the problem?
I'm not alone
I'm on the same problem but I know only show that error when activate System V IPC option, I'm also try to do with nethunter and that exactly drivers, but I'm doing in a Moto E5 Play.
EDIT:
I found that android disable this feature: "System V IPC" Because it cause a security vulnerability, they using "Android Shared Memory"(ASHMEM) instead, and there is a repo that emulates the System V using ASHMEM
So, the warning is because android dislikes that system, nothing to worry if you can take the risk, and the message doesn't bother you, I'll try the "android-shmem" from pelya.
Good luck.
reno_axel said:
I'm not alone
I'm on the same problem but I know only show that error when activate System V IPC option, I'm also try to do with nethunter and that exactly drivers, but I'm doing in a Moto E5 Play.
EDIT:
I found that android disable this feature: "System V IPC" Because it cause a security vulnerability, they using "Android Shared Memory"(ASHMEM) instead, and there is a repo that emulates the System V using ASHMEM
So, the warning is because android dislikes that system, nothing to worry if you can take the risk, and the message doesn't bother you, I'll try the "android-shmem" from pelya.
Good luck.
Click to expand...
Click to collapse
Zer0nite said:
Hey!
I try to port nethunter kernel to redmi 7.
But every restart i got this message: "There is an internal problem with your device ..."
build.date, build.date.utc, build.fingerprint lines are the same at /vendor/build.prop and /system/build.prop files.
When I not change anything in the source code, and build and install then no message.
Only System V IPC & Generic IEEE 802.11 Networking Stack (mac80211) & Ralink WLAN USB Driver Enabled.
Everything works fine no kernel panic or etc. just the message is confusing.
Can I somehow find out the cause of the problem?
Click to expand...
Click to collapse
It means that kernel is not compatible with you ROM bro.
Zer0nite said:
Hey!
I try to port nethunter kernel to redmi 7.
But every restart i got this message: "There is an internal problem with your device ..."
build.date, build.date.utc, build.fingerprint lines are the same at /vendor/build.prop and /system/build.prop files.
When I not change anything in the source code, and build and install then no message.
Only System V IPC & Generic IEEE 802.11 Networking Stack (mac80211) & Ralink WLAN USB Driver Enabled.
Everything works fine no kernel panic or etc. just the message is confusing.
Can I somehow find out the cause of the problem?
Click to expand...
Click to collapse
Every KERNEL have / has compatible Android version. And every kernel has / have a compatible ROM. Don't ignore that bro. Just restore your stock kernel.

[MOD][MAGISK][LineageOS] Iptables TTL/Unthrottled Hotspot

Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
Confirmed OS's that work: LineageOS18.1, LineageOS19.1
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App: (Shouldn't be necessary if running latest script since that does this step for you on every boot)
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Updates:
* I updated the thread title since no one reporting the Android 12 kernel mod is working (only 11 works this far)
* I added "ttl_magisk_L19.zip" script which runs the iptables command for you on every boot. I just tested this on LineageOS19.1 and it works good. I'm working on testing it on LineageOS20.0...
Based on what @fddm said though, it sounds like a Magisk module like this will not work on stock AOSP because it "enforces signatures on modules". If anyone can confirm that, or a workaround that would be helpful. Also https://forum.xda-developers.com/t/...l-tether-lineageos-18-1.4295601/post-86173703 indicates we'll want to disable IP6 via these commands:
ndc interface ipv6 rndis0 disable
ndc interface ipv6 wlan0 disable
If anyone wants to test & get back that'll be great. With Tmobile I didn't need to do that (yet), but again feedback would be great.
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
fddm said:
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
Click to expand...
Click to collapse
So you think this should work on stock? Thanks man! I need my phone for work so can't put it offline for hours atm, but maybe over the weekend I can. I'd like to reflash android 12 stock & see if this works. I'd have to assume there's some interest in this... Someone else to test...who knows
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
creezalird said:
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
Click to expand...
Click to collapse
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
kevin71246 said:
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
Click to expand...
Click to collapse
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
kevin71246 said:
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
Click to expand...
Click to collapse
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
creezalird said:
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
Click to expand...
Click to collapse
Mind going into your phone settings & post your kernel version? Thx
kevin71246 said:
Mind going into your phone settings & post your kernel version? Thx
Click to expand...
Click to collapse
sure, here you go
kevin71246 said:
Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App:
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Click to expand...
Click to collapse
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
ankur414 said:
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
Click to expand...
Click to collapse
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
kevin71246 said:
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
Click to expand...
Click to collapse
Hi, thanks for the response. I am using a Pixel 4a 5G:
LineageOS 18.1-20220116
Build: lineage_bramble-userdebug 11 RQ3A.211001.00110038514
Kernel: 4.19.160-ge469934bead0
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Sorry.
tested the ttl A12 zip
Termux commands in op gave no error.
also ran #ndc interface ipv6 wlan0 disable (accepted)
#ndc interface ipv6 rndis0 disable would not take
noT Mobile buy metropolitition
if anyone could give me some advice for my quest2 multiplayer problem would have much love ... its the main reason I run hotspot.
OnePlus 6T
Model: A6013
Android 12
Sec. patch 1/5/2022
ProtronExtended version
12.2.1
[ROM][12L][fajita] ProtonXtended (PXOSP) [AOSP]
ProtonXtended (PXOSP) Android 12 based ROM About Project PXOSP (Proton Xtended Open Source Project) is a fork based on ProtonAOSP to enhance the user experience with useful addition features. Screenshots Screenshots of the PXOSP Installation...
forum.xda-developers.com
Kernel ver.
4.9.227Syberia+-g44a024f66f1a
#1 Tue Jan 25 19:55:25 UTC 2022
Linux version 4.9.227Syberia+-g44a024f66f1a ([email protected]) (Android (7485623, based on r416183b1) clang version 12.0.7 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)) #1 SMP PREEMPT Tue Jan 25 19:55:25 UTC 2022
Magisk custom update channel
24.1 (24100)
@topjohnwu
kevin71246 said:
That iptables command should be persistent across a reboot.
Click to expand...
Click to collapse
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
everburn said:
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Click to expand...
Click to collapse
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
fddm said:
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
Click to expand...
Click to collapse
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
everburn said:
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
Click to expand...
Click to collapse
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
kevin71246 said:
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
Click to expand...
Click to collapse
thats probably it right there thanks
Have tried both on Pixel 4a 5G, Android 11 stock, rooted, RQ1C.210205.006
"unknown option --ttl-set" on both

How To Guide Get BCM4389 into monitor mode for WIFI sniffing

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.
Getting the BCM4389 in Pixel 6 into monitor mode for tcpdump/Wireshark WIFI sniffing
A little side project to debug a WIFI 6E TP-Link mesh network in my house, went from "This sounds easy!" to "This is impossible!" to "It can...
chrisf4.blogspot.com
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
Is there any real difference from doing it this way?
GitHub - kimocoder/qualcomm_android_monitor_mode: Qualcomm QCACLD WiFi monitor mode for Android
Qualcomm QCACLD WiFi monitor mode for Android. Contribute to kimocoder/qualcomm_android_monitor_mode development by creating an account on GitHub.
github.com
x56x said:
Is there any real difference from doing it this way?
GitHub - kimocoder/qualcomm_android_monitor_mode: Qualcomm QCACLD WiFi monitor mode for Android
Qualcomm QCACLD WiFi monitor mode for Android. Contribute to kimocoder/qualcomm_android_monitor_mode development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
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
ccfries said:
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
Click to expand...
Click to collapse
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.
x56x said:
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.
Click to expand...
Click to collapse
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
Are you on Android 12, 12.1, or 13? I got it to work on 12 when the phone first came out, so something had to have changed.
I worked on Pixel 6 kernel software and this didn't change..
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
GitHub - Biohazardousrom/nh-magisk-wifi-firmware-gs101-gs201: This Magisk module adds the required firmware for external wireless adapters to be used with NetHunter.
This Magisk module adds the required firmware for external wireless adapters to be used with NetHunter. - GitHub - Biohazardousrom/nh-magisk-wifi-firmware-gs101-gs201: This Magisk module adds the r...
github.com
Duhjoker said:
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
GitHub - Biohazardousrom/nh-magisk-wifi-firmware-gs101-gs201: This Magisk module adds the required firmware for external wireless adapters to be used with NetHunter.
This Magisk module adds the required firmware for external wireless adapters to be used with NetHunter. - GitHub - Biohazardousrom/nh-magisk-wifi-firmware-gs101-gs201: This Magisk module adds the r...
github.com
Click to expand...
Click to collapse
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
try this zip. github is weird sometimes with magisk modules source when you download it.
as for the binaries and the firmware they are located in the system/vendor folder in the zip
Duhjoker said:
try this zip. github is weird sometimes with magisk modules source when you download it.
as for the binaries and the firmware they are located in the system/vendor folder in the zip
Click to expand...
Click to collapse
WORKS PERFECT, THANKS A MILLION!!!!
raven(bear)claws said:
WORKS PERFECT, THANKS A MILLION!!!!
Click to expand...
Click to collapse
on a side note, i am getting "permission denied" while trying to run "wifi_sniffer start". on a rooted pixel 6 pro, factory image but have ro.userdebugging enabled. adb sees the process just does not have access to view it. Could be my goof since i am not using userdebug build
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
Duhjoker said:
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
Click to expand...
Click to collapse
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
Duhjoker said:
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
Click to expand...
Click to collapse
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

Categories

Resources