PDA

View Full Version : 2020.2 nexmon



rootboy01
2020-04-20, 00:12
hi @re4son
what time the Nethunter's new version will be done ?
i am waiting especially for angler arm64 nexmon libs, because this device like my device (sony xperia z5 compact ( arm64 and sd810 same)
i patched my firmware from: https://github.com/seemoo-lab/nexmon/blob/master/README.md#build-patches-for-bcm4330-bcm4339-and-bcm4358-using-a-x86-computer-running-linux-eg-ubuntu-1604

my device supporting patch:
https://github.com/seemoo-lab/nexmon/blob/master/README.md#supported-devices

bcm43455 7_45_59_16 Sony Xperia Z5 Compact LineageOS 14.1

so just remaining, the libs..

if i use arm64 angler libs, ( future 2020.2 version)
it can be work in my device? i wonder very much..
thanks.

re4son
2020-04-20, 00:28
Soon :D

How about you create a NetHunter kernel and I promise to finish the new libs by the time you create a merge request?

rootboy01
2020-04-20, 00:36
i created already Nethunter kernel and built for my device and it working succesfull, you know :)
but you said my LineageOS kernel not custom. So you wont accept my merge :D

https://cdn-04.anonfile.com/l1zbt9rfo5/570b8548-1587343593/Screenshot_20200420-033440.png

https://cdn-21.anonfile.com/bczbt7r1o7/d87f842d-1587343602/sketch-1587342934380.png

rootboy01
2020-04-20, 00:40
Kex Vnc:

https://cdn-09.anonfile.com/bc52tdreod/c0facb26-1587343897/Screenshot_20200420-034044.png

re4son
2020-04-20, 00:42
Yep, I said NetHunter kernel, not LineageOS kernel - We are not that cheap :D
We look after our own first, that's keeping us busy enough ;-)

Why don't you following this guide to create a NetHunter kernel? That's should get you going pretty quickly.

re4son
2020-04-20, 00:47
What you've done looks like a very time consuming and convoluted way of installing "Kali NetHunter Lite" :.-)

If you don't want additional wifi device support, injection, HID attacks, etc., then just install "Kali NetHunter Lite" and copy your nexmon files across. That would take less than half an hour.

rootboy01
2020-04-20, 00:48
i dont have pc, and i go net cafes for pc sir. nowadays there is corona virus ...
maybe you can create nexmon libs right ? because you have pc :)
also after add 64 bit libs, injections can work right ? ( aireplay-ng -9 wlan0 ) it must say "injections works!"

re4son
2020-04-20, 00:51
How about I create that kernel and you help me testing?

rootboy01
2020-04-20, 00:57
oww sure sirr :) you give honor.
here time is 03:55 so i must sleep.
maybe after 10 hours later.
i give you basic preferences:


arch= arm64

los 14.1 = https://github.com/LineageOS/android_kernel_sony_msm8994

boot = /dev/block/mmcblk0p29

kernel version = 3.10.84

need wlan0 injections work and maybe hid :) not need for external wifi

rootboy01
2020-04-20, 01:00
i used gcc linaro aarch64-linux-gnu latest , this is stable for sony. others giving error.

rootboy01
2020-04-20, 01:06
kernel config = arch/arm64/configs/kitakami_suzuran_defconfig

rootboy01
2020-04-20, 01:09
sir you will create local.config.example.suzuran right ?

re4son
2020-04-20, 01:19
Yep.

This is my standard workflow:


- open "https://github.com/LineageOS/android_kernel_sony_msm8994" in web browser
- Click "Fork"
- Open terminal, cd to build directory, e.g. ~/android
- git clone <remote repo> (e.g. https://github.com/Re4son/android_kernel_sony_msm8994)
- cd android_kernel_oppo_msm8974
- git checkout -b nethunter-7.1
- git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel
- cd kali-nethunter-kernel
- cp local.config.examples/local.config.example.bacon ./local.config
- vi local.config #If you'de like to customize paths
- ./build.sh
- "S"
- "1"
- Choose the device specific defconfig as default config
- Edit kernel config - Only remove "local version", untick "... append version ...", & change hostname to kali
- "2"; build and rebuild with option #3 adding more and more nethunter config items.
- Add one patch after another, build every time with "3" and git commit after every successful build.
- If all configurations and patches applied successfully, do a clean via "0" and a full NetHunter build via "N"
- Git commit of the nethunter_config and kali-nethunter-kernel/local.config, & push everything to the remote repository

rootboy01
2020-04-20, 01:26
thanks sir respect.

do you need another info about my device ? (suzuran)
if not i will sleep.
see you after 10 hours sir.

rootboy01
2020-04-20, 10:33
@re4son you forked my device's kernel source, thanks https://github.com/Re4son/android_kernel_sony_msm8994

so what about building process ?

re4son
2020-04-20, 10:51
@re4son you forked my device's kernel source, thanks https://github.com/Re4son/android_kernel_sony_msm8994

so what about building process ?

Haven't started yet. I'm in the middle of rebuilding my development environment and that'll take another day or two.

rootboy01
2020-04-20, 10:53
just boot kali iso sirr :)
thanks, congrats. i am waiting.
wanna ask any questions about suzuran ?

rootboy01
2020-04-21, 11:42
@re4son sir what about the last situation https://github.com/Re4son/android_kernel_sony_msm8994

re4son
2020-04-21, 23:13
I'm gonna be out of action for a while while I refresh my environment. It's taking longer than expected - maybe a week or two.

rootboy01
2020-04-21, 23:28
ok sir. good luck, keep it up..

rootboy01
2020-04-25, 12:48
@re4son thanks for quick edit sir, you rock :) https://github.com/Re4son/android_kernel_sony_msm8994/tree/nethunter-14.1?files=1
so what you will change in kernel ? can i learn ? regards..

rootboy01
2020-04-25, 12:49
@re4son i can see nethunter defconfig. is there another changes ?

rootboy01
2020-04-25, 12:50
Also i see you add oreo toolchain but los 14.1 is nougat.
https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel/-/blob/master/local.config.examples/local.config.example.suzuran

re4son
2020-04-25, 12:55
A few patches.
I followed the kernel build section in the NetHunter documentation, starting with this page

https://www.kali.org/docs/nethunter/nethunter-kernel-1-patching/

and working my way through the next six pages.

re4son
2020-04-25, 12:57
Also i see you add oreo toolchain but los 14.1 is nougat.
https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel/-/blob/master/local.config.examples/local.config.example.suzuran

It's not really an oreo toolchain. It's an Android toolchain that was released with Oreo to build Oreo and below.

rootboy01
2020-04-25, 13:00
oww ok sir i understand you are geniuss :)
can i ask which patches are you added and how you patching ?
i prefer specially nexmon and hid patches you know :)
I am grateful for adding my device..

re4son
2020-04-25, 13:13
I used the kernel-builder for patching, following the exact steps as listed in the documentation.
The name of the patches I applied are in the commit messages.

I did not apply any Nexmon patches. Nexmon is not part of the kernel and there are no patches to apply. I will, however, add some helper files to the kernel installation zip later.

rootboy01
2020-04-25, 13:16
you mean helper files are 'kalililibnexmon' libs right ?

re4son
2020-04-25, 13:23
libs, nexutil, and scripts

rootboy01
2020-04-25, 13:32
thanks sir :)
i will ask good question now :D
how can i reduce kernel wakelocks by editing: https://github.com/Re4son/android_kernel_sony_msm8994/blob/nethunter-14.1/arch/arm64/configs/nethunter_defconfig
kernel wakelocks like: timerfd, PowerManagerService.WakeLock, WifiConnnectivityManagerSchedulePeriodicScan etc..
for powersave..

rootboy01
2020-04-25, 23:31
@re4son sir also fix false things: https://github.com/Re4son/android_kernel_sony_msm8994/commit/4bf6700debe5c1db9df654cf1337bb819f714ad3

edit: ok sir i see cleanup . thanks..

re4son
2020-04-26, 00:38
thanks sir :)
i will ask good question now :D
how can i reduce kernel wakelocks by editing: https://github.com/Re4son/android_kernel_sony_msm8994/blob/nethunter-14.1/arch/arm64/configs/nethunter_defconfig
kernel wakelocks like: timerfd, PowerManagerService.WakeLock, WifiConnnectivityManagerSchedulePeriodicScan etc..
for powersave..

You really don't want to reduce wakelocks by editing the kernel config. Wakelocks are requested by apps and disabling wifi in the kernel to avoid wifi managers requesting a wakelock is not really a suitable approach.

I'd recommend reading these guides to get you started with optimize your battery life:
https://forum.xda-developers.com/showthread.php?t=1827676
https://forum.xda-developers.com/showthread.php?t=1759541

Having said that, the kernel config you've sent me is optimized for performance and not for battery life. If you are after battery life than I better don't use that.

rootboy01
2020-04-26, 01:10
@re4son no problem sir, keep it up :)
i use LKT and Amplify thanks sir.
what time can you submit suzuran with libs into kali-nethunter-devices ?
regards..

re4son
2020-04-26, 01:52
@re4son no problem sir, keep it up :)
i use LKT and Amplify thanks sir.
what time can you submit suzuran with libs into kali-nethunter-devices ?
regards..

hopefully tomorrow

re4son
2020-05-03, 07:46
Done:

https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-devices/-/tree/master/nougat/suzuran

Would you mind testing it, please?

And could you also send me a copy of the original fw_bcmdhd.bin and copy of the nexmon patched fw_bcmdhd.bin, please?

Many thanks

rootboy01
2020-05-03, 14:19
i thank you sir, i am testing now: https://cdn-16.anonfile.com/V1TbBdvcod/4175d6f3-1588516125/Screenshot_20200503-171705.png

oww sorry, i removed original fw_bcmdhd :D you can get it in kernel source? i can upload patched firmware:
https://anonfile.com/J9X9B6veo5/fw_bcmdhd_bin

rootboy01
2020-05-03, 14:21
if all is finish, i will notice you sir

rootboy01
2020-05-03, 14:28
sir 2020.2 nethunter-project build py file giving error: https://cdn-06.anonfile.com/zfh0Cavfo4/6714d073-1588516746/Screenshot_20200503-172732.png
i trying master now.

rootboy01
2020-05-03, 14:30
sorry its my fault :D

rootboy01
2020-05-03, 14:56
sir you need to edit devices.cfg suzuran add arch = arm64 because build downloads is downloading armhf

rootboy01
2020-05-03, 17:14
and sir you need to edit boot = /dev/block/mmcblk0p29

rootboy01
2020-05-03, 18:13
@re4son sir it giving bootloop.
your compiled Image.gz-dtb has issues. i removed from suzuran directory and pushed my precompiled image: https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-devices/-/merge_requests/229 and it worked.

rootboy01
2020-05-03, 18:29
:cry: it giving /usr/bin/sudo not found error :(
i think there is an issue in arm64 minimal tar.xz

rootboy01
2020-05-03, 19:10
i used gcc linaro aarch64-linux-gnu latest , this is stable for sony. others giving error.

sirrr you need to use linaro gcc..

re4son
2020-05-04, 00:59
What do you mean by latest? latest 4.9 release?

rootboy01
2020-05-04, 01:04
https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/

this sir.

rootboy01
2020-05-04, 01:07
cat /proc/version:
Linux version 3.10.84nethunter-suzuran-1.1-g0c7176b039b (root@kali) (gcc version 5.5.0 (Linaro GCC 5.5-2017.10) ) #1 SMP PREEMPT Mon Mar 30 21:52:56 UTC 2020

re4son
2020-05-04, 02:07
cat /proc/version:
Linux version 3.10.84nethunter-suzuran-1.1-g0c7176b039b (root@kali) (gcc version 5.5.0 (Linaro GCC 5.5-2017.10) ) #1 SMP PREEMPT Mon Mar 30 21:52:56 UTC 2020

This ^^^^^^^^^^^^^^^^^^ is not a product of that toolchain:
https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/

Please provide me with a link to the toolchain you would like me to use

re4son
2020-05-04, 03:58
I've built kernel ver 1.2 with the linaro toolchain version 5.5 from October 2017.
Please give that a try and let me know how you go.
Thanks

rootboy01
2020-05-04, 12:48
oww sir, again bootloop.
i used example_scripts for kernel build.
can you try with these scripts ?
https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-devices/-/tree/master/example_scripts

re4son
2020-05-04, 13:25
Would be better for you to take over now. Use the kernel-builder and apply kernel features and patches one at a time, build and test until you found the change that caused the bootloop.

re4son
2020-05-04, 13:26
Please raise a merge request once you've built one that boots.
Many thanks

rootboy01
2020-05-04, 13:41
but sir i dont have pc enviroment you know :(
please just one time try :)

rootboy01
2020-05-04, 13:42
the problem is Image.gz-dtb . can you try build with example scripts :) because i tried with these scripts and it worked.

re4son
2020-05-04, 13:44
Please compare those scripts to the kernel-builder and point out the difference that could cause a bootloop. Thanks :)

rootboy01
2020-05-04, 13:47
okey sir i using nethunter kex for build procces :) thanks for all.

rootboy01
2020-05-04, 13:51
sir remove suzuran from devices.

rootboy01
2020-05-04, 14:22
or just remove kernel image sir.
if i can build image succesfully, i will send merge request .

rootboy01
2020-05-04, 16:15
@re4son sir can we apply this patch to sony xperia z5 compact ? https://github.com/kimocoder/qualcomm_android_monitor_mode/blob/master/files/enable_monitor_mode.patch
its cooler than nexmon :D
also thanks sir, libs are worked enjections works :)
but when i . monstart-nh
then
nexutil, it says libdl.so not found

rootboy01
2020-05-04, 17:48
sir also Nethunter pre4 version has Kex issues.
When i enable Kex, device freezes.
pre3 version is good.

rootboy01
2020-05-04, 21:06
sir i think the problem is, using angler device's hid patch.
you patched hid using angler's patch please write patch and apply for z5 compact.
i tried but in chroot, it fails.. out of ram :((

rootboy01
2020-05-04, 21:12
sir i think the problem is, using angler device's hid patch.
you patched hid using angler's patch please write patch and apply for z5 compact.
i tried but in chroot, it fails.. out of ram :((

@re4son https://github.com/Re4son/android_kernel_sony_msm8994/commit/ebd218ab8a1d2ae60a11dff418d9f8daded1404f

this cause bootloop .

re4son
2020-05-04, 23:53
sir also Nethunter pre4 version has Kex issues.
When i enable Kex, device freezes.
pre3 version is good.

Placebo effect. Pre4 is identical to pre3. The reason we have pre4 is so that Android 10 users can upgrade after flashing, which is a requirement to get around the scoped storage issue

rootboy01
2020-05-05, 00:03
please sir, try with correct hid patch :)
also what about https://github.com/kimocoder/qualcomm_android_monitor_mode/blob/master/files/enable_monitor_mode.patch :D

re4son
2020-05-05, 00:25
please sir, try with correct hid patch :)
also what about https://github.com/kimocoder/qualcomm_android_monitor_mode/blob/master/files/enable_monitor_mode.patch :D

Working on it:

https://forum.xda-developers.com/z5-compact/development/volunteers-to-debug-nethunter-kernel-t4094295

rootboy01
2020-05-05, 00:40
Working on it:

https://forum.xda-developers.com/z5-compact/development/volunteers-to-debug-nethunter-kernel-t4094295

thanks sir good idea :)
why you patched z5c's hid using angler's patch?
its %99 bootloop causing i think :)
can you just undo hid patch and try again ?
after your compile procces, i will change my Image.gz-dtb to your new (without hid patch) Image.gz-dtb. (in installer zip)

rootboy01
2020-05-05, 00:43
Working on it:

https://forum.xda-developers.com/z5-compact/development/volunteers-to-debug-nethunter-kernel-t4094295

also can you add help for how to patch:https://github.com/kimocoder/qualcomm_android_monitor_mode/blob/master/files/enable_monitor_mode.patch :D

re4son
2020-05-05, 00:58
thanks sir good idea :)
why you patched z5c's hid using angler's patch?
Why not? Angler is the name I gave it after I made it apply succesfully on Angler. It's just a name.


its %99 bootloop causing i think :)
can you just undo hid patch and try again ?
I thought you had done that already. Didn't you say that was the cause of the bootloop? Didn't you test it?

rootboy01
2020-05-05, 01:00
when i . monstart-nh
then
nexutil, it says libdl.so.2 not found
what cause this errors sir ?

rootboy01
2020-05-05, 01:02
when i first try to build image, i used only mac80211 patch and after install there isnt any bootloops sir.

rootboy01
2020-05-05, 01:04
why not? because angler and suzuran different devices you know. Sony and Huawei..

re4son
2020-05-05, 01:12
why not? because angler and suzuran different devices you know. Sony and Huawei..

Device drivers and kernel patches do not discriminate. Neither should we when we write low level software.

Just open the actual files I patched and learn what those changes do.

rootboy01
2020-05-05, 01:17
Device drivers and kernel patches do not discriminate. Neither should we when we write low level software.

Just open the actual files I patched and learn what those changes do.

ok sir regards sorry for noob :)
can i ask a question.
when you build for suzuran, are you.get any errors ?

re4son
2020-05-05, 01:20
Nope. That's why I am 99% certain that the bootloop is not caused by the HID patch but another change I did.
Fits the pattern

rootboy01
2020-05-05, 01:22
why i get after . monstart-nh and nexutil: libdl.so.2 not found :(

re4son
2020-05-05, 01:24
Not sure. What have you done so far to troubleshoot it?

rootboy01
2020-05-05, 01:27
Not sure. What have you done so far to troubleshoot it?

i take an ss:
https://cdn-08.anonfile.com/B8J3h3w0of/c32ac387-1588642687/sketch-1588642012487.png

re4son
2020-05-05, 01:29
By troubleshooting i meant what have you done to find the cause of the error?

rootboy01
2020-05-05, 01:32
i cant do nothing cause idk about C language :(
i think issue is nexutil library.

rootboy01
2020-05-05, 01:34
some nh users have same issue:https://github.com/offensive-security/kali-nethunter/issues/878

re4son
2020-05-05, 01:36
Great opportunity to learn about C and to "Try Harder (https://www.offensive-security.com/offsec/what-it-means-to-try-harder/)" :)

rootboy01
2020-05-05, 01:40
Great opportunity to learn about C and to "Try Harder (https://www.offensive-security.com/offsec/what-it-means-to-try-harder/)" :)

good advertisement sirr :D
i know the basics of the C
but idk where to start "android kernel hacking"
if you succesfully buid new nexutil library, i promise to you i will be C master :D

re4son
2020-05-05, 01:46
I don't have to build a new library. You will understand that when you continue with your troubleshooting.

rootboy01
2020-05-05, 01:48
okey sir i will try thanks :)
i understand what you mean.
you did your best, now it's mine

rootboy01
2020-05-06, 01:26
@re4son sir i fixed missing lib file errors, thanks :)
so just copied not found libs in /usr/lib/aarch64-linux-gnu to /system/lib64 and done.

but after ' . monstart-nh ' and ' nexutil ',
i got;

nexutil: Segmentation fault

:D help mehh

re4son
2020-05-06, 01:29
:D help mehh

What have you done so far to troubleshoot this message?

rootboy01
2020-05-06, 08:49
What have you done so far to troubleshoot this message?

searched in google, but no luck..
If i ask you, then there is luck :)

rootboy01
2020-05-06, 09:01
also i press:

cd /system/xbin
gdb ./nexutil
run
(no any errors)
bt
(no stack)

and tried for kalilibnexmon.so but there isnt any errors.

re4son
2020-05-06, 09:14
why did you copy files from "/usr/lib/aarch64-linux-gnu" to "/system/lib64"?

rootboy01
2020-05-06, 09:19
cause missing lib files (e.g libdl.so.2 not found) in usr lib aarc64- folder.
i copied to kalilibnexmon's directory and it worked but now there is segfault :(

re4son
2020-05-06, 09:20
I see. What is the purpose of "/usr/lib/aarch64-linux-gnu"? And what is the purpose of "/system/lib64"?

rootboy01
2020-05-06, 09:25
sir really is it neccesary for fixing this error ?

re4son
2020-05-06, 09:28
Yes. If you want to fix the error then I suppose it is.

rootboy01
2020-05-06, 09:31
what am i must do sir, say it regularly please :)

re4son
2020-05-06, 09:38
I think you just have to try harder (https://www.offensive-security.com/offsec/what-it-means-to-try-harder/)

rootboy01
2020-05-06, 09:40
ooww here we go again..
please sir :(

rootboy01
2020-05-06, 09:44
I think you just have to try harder (https://www.offensive-security.com/offsec/what-it-means-to-try-harder/)

oww i think i found.
i must move libnexmon files to /usr/lib right ?

rootboy01
2020-05-06, 09:55
sir i am not developer . you are project owner of nethunter, so why you dont want help ? its crazy

rootboy01
2020-05-06, 12:37
dear @re4son please remove suzuran image in devices list.
if some suzuran users build nh installer zip for suzuran, users will shock for bricked device. in this world, i am not alone of using suzuran device.
remove kernel image sir..

sonyvaio
2020-05-07, 14:29
master @rootboy01 how is the nexmon z5 compact project going? I really hope to use it

rootboy01
2020-05-08, 12:06
dear @re4son are you read this: https://github.com/Re4son/android_kernel_sony_msm8994/blob/nethunter-14.1/README_Xperia

sony devices have diffconfig files and you need to export for specific device.
e.g export KBUILD_DIFFCONFIG=suzuran_diffconfig