
Exploit for CVE-2019-2215 (bad binder) for Huawei P20 Lite
This project is an exploit for CVE-2019-2215 on Huawei P20lite in version Android 8.0.0. Kernel is in version 4.4.23.
This vulnerability is probably the most documented one (tutorials, real port on physical phone) on this topic and I have a vulnerable phone so this is a good starting point for learning Android kernel exploitation.
Warning: The exploit makes all SELinux types permissive so it might allow other apps to bypass SELinux.
Clone the repo first :
git clone https://github.com/willboka/CVE-2019-2215-HuaweiP20Lite.git
cd CVE-2019-2215-HuaweiP20Lite
Clone setools-android in the folder CVE-2019-2215-HuaweiP20Lite and compile libsepol (libsepol.a). Use the following command to do that :
make libsepol
It is required to bypass SELinux.
Build the project using the command :
make # or do: NDK_PROJECT_PATH=. ndk-build NDK_APPLICATION_MK=./Application.mk
Binary is in folder libs/arm64-v8a.
Build and push in /data/local/tmp using :
make push
Launch the binary cve-2019-2215 from CLI (tested with Termux and ADB) :
/data/local/tmp/cve-2019-2215 # from adb
Reboot to reset SELinux policies.
Links I used to learn about exploiting this vulnerability.