Question Making magisk module with TTL-set - OnePlus 11

I read that the kernel source for the op11 was released. Does anyone know how to make a module to add ttl-set to the kernel? If not does anyone know how to build a kernel? I know during building I can add xt_HL.ko. I can't believe how hard it is to add ttl-set to iptables.

Check out this link where they achieve patching using magiskboot.
It does not work... · Issue #13 · cyborg-one/nfqttl
I am connected to the phone using USB tethering. Ping from phone to google: 64 bytes from 172.217.21.14: icmp_seq=1 ttl=106 time=94.7 ms Ping from pc to same address: 64 bytes from 172.217.21.14: i...
github.com

That guy zibri has a better patch that works great on my Pixel 7 Pro. This is a kernel patch that gets rid of code that decrements the TTL during routing. See: https://github.com/Zibri/ttl_fix

Related

openvpn anyone?

hi,
did anyone find a way to use openvpn on htc hero?
Catscrash said:
hi,
did anyone find a way to use openvpn on htc hero?
Click to expand...
Click to collapse
Not yet, but I am using the CyanogenMod 4.0.1 on my Dream and I have seen Donut on the HTC Click -- in both cases, Settings --> Wireless Controls is showing an option for VPN Settings, so I'm guessing that it would be a matter of time before this is available on the Hero and Magic firmware
Be patient, or wait for someone to cook a ROM with this feature
VPN wil be in Donut.
For now, it seems possible to implement it.
For the program GUI, it should good to extand that program to support openvpn and pptp vpn.
First of all tun driver is needed, you'll find it here.
Install and, as root, type:
# insmod /system/lib/modules/tun.ko
lsmod command should give you:
tun 11300 0 - Live 0xbf000000
That should load the tun kernel module.
I think we should then have to compile openvpn using android ndk.
A guy did it for the dream. Worth trying it. Maybe someone else could tell if binaries compiled for Dream can work on Hero
OpenVPN ist working on hero. I used the binaries for the G1. But the CIPHER is different: AES-256-CBC. I'm now testing it and if it's stable, perhaps I'm gonna compile openvpn with complete static openssl, so all functions should work.
If someone is interested, I can post my scripts and settings.
gogh57 said:
OpenVPN ist working on hero. I used the binaries for the G1. But the CIPHER is different: AES-256-CBC. I'm now testing it and if it's stable, perhaps I'm gonna compile openvpn with complete static openssl, so all functions should work.
If someone is interested, I can post my scripts and settings.
Click to expand...
Click to collapse
I am REALLY interested to now how you compiled it.
Hi!
I haven't compiled openvpn until now. I used this one:
https://www.digital-bit.ch/wiki/OpenVPN_auf_dem_G1
Just tried, may work. But i can't connect to my astaro because the key needs auth wit user and pw.
This Version hasnt been compiled with --auth-ask-pass. And reading from commandline doesn't work either..
I did compile it on my G1 with CyanogenMod ROM.
As far as I can see, it is working perfectly: I'm using it with certificates for 3 different VPNs.
Only issue: I wasn't able to complile a shared version of liblzo, so the binary is statically linked against liblzo.a (751 KB... )
Ah, yes, of course no GUI interface, shell only...
Hi!
Cool, could you post the binary? Could you give me a hint how you did it? I had several problems.
Would be perfect if someone could compile openvpn with " --enable-password-save"
Please post it, when a OpenVPN GUI for the HTC Hero / Magic is available.
Thans alot
wolfiedk said:
Please post it, when a OpenVPN GUI for the HTC Hero / Magic is available.
Thans alot
Click to expand...
Click to collapse
The great spam protection measures in this forum deny posting links for new users, so you have to manually follow them.
See: github.com/fries/android-external-openvpn
There is also an app and a statically linked openvpn binary at github.com/fries/android-external-openvpn/downloads
The openvpn binary has the following features:
* --enable-password-save
* statically linked against a blowfish enabled openssl
* statically linked against liblzo
Build:
* openvpn-static.bz2 was build on a donut-tree (1.6) for htc-magic
* openvpn-android-2.1.tar.bz2 was build on a cupcake (1.5) tree for htc-magic
* should run on a verity of (rooted) phones, please try it an give feedback.
A dynamically linked version is also available. The above git repo integrates seamless into the android build system. Some instructions may be found here: wiki.github.com/fries/android-external-openvpn/
Any feedback is welcome. Enjoy.
read this first -> http://sourceforge.net/projects/tunneldroid/files/README/download
First make sure kernel is compile with tun module
install tunneldroid from market
binary download -> http://sourceforge.net/projects/tunneldroid/files/openvpn-binary.zip/download
The newest version of my 'OpenVPN Settings' app is available at github.com/fries/android-external-openvpn/downloads

fhd kernel ( ZE551 ) & POSSIBLY hd (ZE550) with KVM & Bridge compiled. *need help*

fhd kernel ( ZE551 ) & POSSIBLY hd (ZE550) with KVM & Bridge compiled. *need help*
MODERATOR NOTICE:
All thread posted in the Development section must have a link to kernel sources to meet GPLv2 requirements. Because this thread does not have proper sources linked and because development has stopped, the thread has been closed.
This is my first time working with Android kernels, but I compiled the 2.12.40 kernel source adding in support for KVM ( Kernel supported Virtual Machines, ie running Windows almost full speed ) and Bridge ( to allow qemu-kvm to set up network adapters bridged with the current wifi adapter ).
I tar'd the bzImage & modules, but don't know what to do to make something installable/flashable so will need help on that end of things.
Edit:
I uploaded a new flashable kernel img based off 2.19. This one should support: kvm, bridge and NTFS read/ *LIMITED* write, swap and ignore kernel module signatures. XDA only allows 8mb for .img files, so I tar'd it.
Edit2:
I compiled a ZE550 kernel ( called hd ) and if some brave souls want to try it, I also put together a boot.img.
Edit3:
New fhd kernel has been compiled with additional usb modules. Kernel should now load kvm related modules automatically, so you shouldn't need to use the script anymore.
Anyone brave/crazy enough to try it out? I'm guessing you need an unlocked bootloader & root.
Edit 4:
New fhd & hd kernels for 2.20
Edit 5:
New exfat.ko module
ycavan said:
This is my first time working with Android kernels, but I compiled the 2.12.40 kernel source adding in support for KVM ( Kernel supported Virtual Machines, ie running Windows almost full speed ) and Bridge ( to allow qemu-kvm to set up network adapters bridged with the current wifi adapter ).
I tar'd the bzImage & modules, but don't know what to do to make something installable/flashable so will need help on that end of things.
Anyone brave/crazy enough to try it out? I'm guessing you need an unlocked bootloader & root.
Click to expand...
Click to collapse
Why 2.12? 2.18 kernel source is available...
That just happened to be the kernel source linked in Android development. If this test works out, I can probably do the same thing with whichever kernel source is available.
Our phones are pretty amazing to be able to compile their own kernels natively on the device.
Sent from my ASUS_Z00AD using XDA Free mobile app
Finally able to compile the 2.18 kernel.. it's a bit weird since it acted like it was missing some files. Untar'd the 2.18 kernel source over 2.12's kernel source and that allowed it compile.
Anyway, it's in the OP called fhd_kernel_20150629.tar and should have KVM ( kernel supported virtualization ), Bridge ( for Qemu-KVM to create bridging ethernet adapters ) & NTFS Read/ *LIMITED* Write.
Once again, it's in the form of bzImage and the modules since I don't know how to replace the kernel on Android devices. ( normally, I'd just make a test linux line in the boot menu for Linux )
One suggestion would be to flash the zImage using
Code:
fastboot flash zImage nameofzImage
or test it using
Code:
fastboot boot nameofzImage
but I dont know if the phone supports the "boot" command.
I´m not sure about the modules either and I can´t test it, as my phone didn´t arrive yet.
Other solution, try this:
http://forum.xda-developers.com/showthread.php?t=2670512
ycavan said:
Finally able to compile the 2.18 kernel.. it's a bit weird since it acted like it was missing some files. Untar'd the 2.18 kernel source over 2.12's kernel source and that allowed it compile.
Anyway, it's in the OP called fhd_kernel_20150629.tar and should have KVM ( kernel supported virtualization ), Bridge ( for Qemu-KVM to create bridging ethernet adapters ) & NTFS Read/Write.
Once again, it's in the form of bzImage and the modules since I don't know how to replace the kernel on Android devices. ( normally, I'd just make a test linux line in the boot menu for Linux )
Click to expand...
Click to collapse
Can I ask how you included NTFS r/w support into your kernel? Did you just set the CONFIG_NTFS_FS flag?
TheSSJ said:
Can I ask how you included NTFS r/w support into your kernel? Did you just set the CONFIG_NTFS_FS flag?
Click to expand...
Click to collapse
I added CONFIG_NTFS_FS=m ( you could set to that y ) and CONFIG_NTFS_RW=y in /{working directory}/device/asus/moorefield/fhd/mofd_fhd_diffconfig
when you make the kernel, it's going to ***** about the config files not matching; follow the directions and manually update all of the other config files and it will finally compile.
Building for Android is a pita. )
Well, then here come the disappointing news (I discovered that when I wanted to include NTFS USB-OTG support directly by the kernel for my TWRP and it didn't mount it as R/W):
CONFIG_NTFS_RW is just a partial write support. It won't create files or folders, it can only overwrite existing files and only by the size they currently have
config NTFS_RW
bool "NTFS write support"
This enables the partial, but safe, write support in the NTFS driver. The only supported operation is overwriting existing files, without changing the file length. No file or directory creation, deletion or renaming is possible. Note only non-resident files can be written to so you may find that some very small files (<500 bytes or so) cannot be written to.
Click to expand...
Click to collapse
Only possibility available is to include ntfs-3g driver using fuse
Yeah, that is a bit of a downer. Now to figure out why nobody finished the NTFS kernel module.
ycavan said:
Yeah, that is a bit of a downer. Now to figure out why nobody finished the NTFS kernel module.
Click to expand...
Click to collapse
Please keep me posted, I'd like to remove the dependency of ntfs-3g in recovery. I fear there actually is no native support of NTFS (googling was not helpful unfortunately)
1) modify module loading function to ignore module version/magic strings.
2) compile the kernel with toolchain used by ASUS (or close to it)
3) use pre-compiled tntfs.ko from original boot.img
I don't have right now the patch for module loading procedure. Need to check old Galaxy S3/S4 custom kernels source (but it's should be easy to patch by finding error string). In time when exFat module source wasn't available, this trick was very common in samsung custom kernels for exFat support.
Thanks
Wait wait wait. Did I read that correctly? Full speed windows? On the zenfone? I think I just died. Does this mean windows 8/10 or windows xp and below?
I know a bit about android kernel, and i'm thinking about buying this device. Well, i'm going to try to build a kernel for this device as soon as i got this device. One thing you should know is, android is an open-source, so before you uploading your compiled kernel, make sure you have already uploaded the sources
LUCKYSHOT52 said:
Wait wait wait. Did I read that correctly? Full speed windows? On the zenfone? I think I just died. Does this mean windows 8/10 or windows xp and below?
Click to expand...
Click to collapse
It's only in theory.
In reality, there is no Z35xx support in windows, and i doubt anyone will write drivers by himself (windows isn't opensource). Officially Z35xx is Android-only SoC.
FajarMF28 said:
I know a bit about android kernel, and i'm thinking about buying this device. Well, i'm going to try to build a kernel for this device as soon as i got this device. One thing you should know is, android is an open-source, so before you uploading your compiled kernel, make sure you have already uploaded the sources
Click to expand...
Click to collapse
The source is already available, so no worries there, since this is source that Asus released.
For all of the brave folks out there, I was finally able to create a bootable image of the latest 2.19.20 kernel. Anyone brave enough can find it in the OP.
I flashed it and my phone booted up, so that's a bonus.
ycavan said:
For all of the brave folks out there, I was finally able to create a bootable image of the latest 2.19.20 kernel. Anyone brave enough can find it in the OP.
I flashed it and my phone booted up, so that's a bonus.
Click to expand...
Click to collapse
is there extra features such as other governor or i/o scheduler?
cangcan said:
is there extra features such as other governor or i/o scheduler?
Click to expand...
Click to collapse
To be honest? I can't remember since my main focus was getting kvm compiled in.
I've attached my .config for the 20150707 build ( in the boot image ).
I've also attached a screenshot of Windoze 7 being installed.
Commandline for Arch Linux x86_64 to start qemu-kvm to install windoze:
qemu-system-x86_64 -display none -vnc :1,password -monitor stdio -m 1G -smp 4 -enable-kvm -drive file=/mnt/0/machine1.img,format=raw -cpu host -cdrom /mnt/MicroSD/Vcd/en_windows_7.iso -boot menu=on --usbdevice tablet
breakdown of the command line:
-display none = no display, I did this to test the virtual machine. normally, you would probably use -display sdl w/ XServer-XSDL running
-vnc :1,password, This says to set up a vnc server with normal port + 1 ( 5901 ) and you expect a password to be set later
-m 1G, 1 gig of ram
-smp 4, our VM will use 4 cores
-enable-kvm, enable Kernel support Virtual Machines
-drive file=/mnt/0/machine1.img,format=raw, my "disk" file
-cpu host, use the same cpu information
-cdrom /mnt/MicroSD/Vcd/en_windows_7.iso, my Windows 7 install cd turned into an iso
-boot menu=on, enable the boot menu ( hit F12, etc.. )
--usbdevice tablet, Qemu's Vnc server sucks at tracking mouse positions so using tablet mode keeps the mouse pointer .. well on-point
Tks for share
Kernel great work
But how to install window 7 ? ?
Gửi từ ASUS_Z00AD của tôi bằng cách sử dụng Tapatalk

A humble request to build a modded kernel with rt2501 support

So first of all, here's the disclaimer: I know NOTHING about building stuff, and I have a VERY slow network to even sync the sources required to make it on my own (I live off of 90KB/s)
For the past 2 days I've been banging my head into the wall trying to figure out a way to get my TP-LINK TL-WN321G to work on OOS or CM or a chrooted Kali Linux. Apparently some modules need to be configured into the OnePlus 3 kernel in order for the rt2501/rt2573 to be recognized by the device via USB OTG.
So the humble request is as follows: Is there ANYONE nice enough to actually sync a kernel source (OOS or CM13) and modify the kernel to support the modules necessary for all of this to work? If I can make a chrooted kali linux along with a working wifi adapter that supports monitor mode, I can practically ace my Senior Project.
Thank you!

[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