Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
CVE-2025-21479 — Temporary root exploit for vivo X Fold+ (CVE-2025-21479): GPU physical memory read/write, __do_sys_capset shellcode patch, seccomp/SELinux bypass and KernelSU activation. | Kitploit
أدوات/GitHubGitHub/catxiaoshi/cve-2025-21479
Android SecurityPrivilege EscalationMemory ForensicsExploitationReverse EngineeringShellcodeMobile SecurityPayload DevelopmentBinary Exploitation
GitHubcatxiaoshi/cve-2025-21479

CVE-2025-21479

Temporary root exploit for vivo X Fold+ (CVE-2025-21479): GPU physical memory read/write, __do_sys_capset shellcode patch, seccomp/SELinux bypass and KernelSU activation.

15 نوفمبر 2026لم تتم المراجعة بعد
مشاركة
عرض المستودع
المحتوى غير متوفر باللغة المطلوبة. عرض النسخة الإنجليزية.

Temporary root on vivo X Fold+ based on CVE-2025-21479

In the previous article, I achieved a temporary root shell using the cred method (see my previous post https://www.coolapk.com/feed/73490425?s=NjQ3OWQwNDMxOWJmMzk4ZzZhZjk1ZGNhega1670). However, due to seccomp restrictions, ksu could not be activated. Since I had no suitable approach, activating ksu was put on hold for the time being. Later, @曉曉恒 published a method for the same CPU and same kernel scheme, and that method can clear seccomp.

(Link: https://www.coolapk.com/feed/73486895?s=YjRmZWY2ZmExOWJmMzk4ZzZhYTU1MmJlega1651)

It also references @TNTHe's method.

(Link: https://blog.kinser.top/archives/1787279031701)

However, both of these schemes require patching the global __do_sys_capset

(Community version patch method concept diagram)


patch __do_sys_capset(全局生效)

    ↓

zygote 孵化应用时 specialize → 调用 capset() 降权

    ↓

★ 中招:执行 shellcode → commit_creds(prepare_kernel_cred(0))

    ↓

zygote 被提权成 root + seccomp 被清 + cred 被换成 init_cred 拷贝

(Flowchart of patch causing zygote exceptions)

In other words, this method, as long as it patches the global syscall, has an unavoidable timing race + hardcoded offset risk. zygote will inevitably be caught in the crossfire. And over time it may cause a kernel panic, but compared with the cred method, it can clear seccomp; for this reason, I added a safer recovery mechanism based on the patch method.


1. The Cred Method

1.1 What the Cred Method Can Do

GPU physical write task_struct->cred, modifying fields such as uid/gid/suid to escalate privileges. This path has always been successful.

1.2 The Fatal Flaw: Cache Consistency When Clearing seccomp

To clear seccomp, you must write the mode/filter fields of task_struct (0x848/0x850).

| Data | Access Frequency | Description |

| --- | --- | --- |

| cred | cold data | read only during permission checks |

| task_struct | extremely hot | accessed on every system call/scheduling/signal |

current->flags is being read and written by the CPU on every system call, and this page has a dirty line resident in L1/L2. The GPU is a non-coherent bus master; after it writes into DRAM, the CPU's next normal write-back swallows the entire line (64 bytes).

mode@0x848 and filter@0x850 happen to be in the same cache line, so they are overwritten together — all 8 retries result in 0x100000002.

1.3 A Worse Side Effect: SIGSYS

GPU writes occasionally take partial effect (the filter lands, but the mode does not), creating a self-contradictory state:


mode   = 2 (FILTER)   // 内核仍要走过滤器

filter = 坏值/NULL    // 指针已被破坏

The next system call enters __seccomp_filter() and executes the broken BPF → returns KILL → "Bad system call"


II. Principles of the Improved Patch Method

Friendly reminder: some new content, such as save, exists in my iterative version and may differ from the community version

2.1 Execution Flow

| Step | Action | Description |

| --- | --- | --- |

| 1 | GPU initialization | Gain physical address read/write capability |

| 2 | Disable SELinux | Physical write to selinux_state |

| 3 | kallsyms resolution | Read the 43MB kernel image and resolve symbols |

| 4 | Locate __do_sys_capset | VA → PA |

| 5 | Save the original code | Authoritative GPU read |

| 6 | Write gated shellcode | CPU window write + cache flush |

| 7 | Current process capset(NULL,NULL) | Trigger |

| 8 | Shellcode executes in kernel mode | prepare_kernel_cred(0) → commit_creds() |

| 9 | Restore the original code | CPU write + authoritative GPU verification |

| 10 | Tear down the fast_rw window | GPU write + verification |

| 11 | exec shell | — |

2.2 Why choose __do_sys_capset?

  1. Because this is the system call entry point, it can be precisely triggered from user space, and it is necessarily executed on every call

  2. The physical address is predictable: 0xa8000000 + 0x16c7bc = 0xa816c7bc (the kernel physical base address is fixed; KASLR only changes the virtual base address, and most in the community use this, with plenty of examples)

2.3 Address-fetching shortcut


uint64_t v = kernel_pread_u64(cheese, 0xa816c7bc);

if ((uint32_t)v == 0xd503233f)   /* paciasp = __do_sys_capset 首指令 */

    /* 不需要 kallsyms 就能定位! */

Only when prepare_kernel_cred / commit_creds are called from within the shellcode is the KASLR virtual base address required.


III. Gating Mechanism (Resolving zygote Corruption)

3.1 The Fatal Flaw of the Community Edition


zygote 在 specializeAppProcess 里

【每孵化一个 APP 都调 capset(&hdr,&data) 降权】

     ↓ 社区 shellcode 无条件执行

prepare_kernel_cred(0) → commit_creds()

     ↓ 每次命中

zygote 的 cred 被换掉 + cred_jar 泄漏一个 → 越用越崩 → 无法新开应用

"Anomalies increasing over time" is precisely the cumulative effect of the continuous cred_jar leak and the corrupted reference counting.

3.2 Improvements in This Version

To address this, this version adds a gating mechanism (solving the zygote breakage): only capset(NULL,NULL) triggers privilege escalation; when zygote passes a non-NULL pointer, it takes the skip path. The community edition escalates unconditionally, causing zygote to be mistakenly escalated every time it spawns an APP plus leak one cred → the more it is used, the more it crashes.

| Comparison Item | Community Edition | This Version |

| --- | --- | --- |

| zygote calls capset(&hdr,&data) | Unconditional escalation | Takes skip, returns 0 |

| cred allocation | Leaks one per spawn | No allocation, zero leak |

| App uid/gid | Affected | Unaffected (set by setuid/setgid) |

When overwriting contiguously in place, non-target paths must replay all N overwritten instructions before jumping back, while the shellcode itself has only N slots, which cannot hold "replay N instructions + gating + payload" — mathematically impossible, so an in-kernel trampoline is required.

Therefore the skip path returns 0. This is consistent with the community edition's behavior toward zygote (both are "capset returns 0"), but removes the privilege escalation and cred allocation; the APP's uid/gid is set via setuid / setgid (not capset), so app permissions are unaffected.


IV. Recovery Module (Core Innovation)

This is the most tortuous part of the entire process, only closed after many failures. Because validation was added and the process fixed, the privilege escalation time was also extended to 3~4 minutes.

4.0 Failure Overview

| No. | Failure | Symptom | Root Cause | Fix |

| --- | --- | --- | --- | --- |

| 1 | False success | Validation all green, DRAM untouched | CPU reads its own dirty cache line | Switched to authoritative GPU read |

| 2 | Wrong cache level | GPU cannot read new value | dc cvau only reaches PoU | Changed to dc cvac (reaches PoC) |

| 3 | No external validation | Cannot prove it has been written to disk | Missing GPU perspective | Added patch_verify_bytes_gpu() |

| 4 | fork breaks everything | restore inevitably fails | COW + GPU channel death | Privilege escalation no longer forks |

4.1 Failure One: False Success (CPU Reading Deceives Itself)


patch_verify_bytes() → fast_pread_u64()   // CPU 通过窗口读

As soon as the write finishes, it is read back with the CPU, and what is read is the cache line that was just dirtied by the write itself, which always equals the expected value. The logs stay green the whole way, and DRAM is never touched.

Hard evidence: on the second run, save reads back the shellcode rather than the original code.

4.2 Failure two: cache flushed at the wrong level


"dc cvau, %0"    // clean by VA to PoU(本核 L2/统一点)

GPU is an external bus master and accesses the PoC (DRAM). cvau cannot clean to DRAM.

Fix: dc cvau → dc cvac (clean to PoC).

4.3 Failure three: missing GPU authoritative verification

تنزيل الأداة

أدوات ذات صلة

  • Mobile-Security-Framework-MobSF

    إطار عمل آلي لاختبار أمان تطبيقات الهواتف المحمولة لأنظمة Android وiOS وWindows. يقوم بإجراء التحليل الثابت والديناميكي، كشف البرامج الضارة، واختبار أمان API مع التكامل مع CI/CD.

  • jadx

    أداة تعمل عبر سطر الأوامر وواجهة رسومية لفك تجميع ملفات Android Dex وAPK إلى كود مصدر Java قابل للقراءة، مع إمكانيات فك ترميز الموارد، وإزالة التعتيم، وتصحيح أخطاء Smali.

  • Apktool

    أداة للهندسة العكسية لملفات APK لأندرويد

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    # تطبيق GhostLock للتنفيذ بنقرة واحدة (CVE-2026-43499)

    750
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    منصة IMSI Catcher تنشر خلية GSM مارقة لاعتراض الرسائل النصية القصيرة وحقن الرسائل وتتبع الأجهزة المحمولة

    739
  • 3

    Callisto

    jetp1ane/callisto

    أداة تحليل ثغرات ثنائية آلية تقوم بفك ترجمة الملفات التنفيذية عبر Ghidra، ومسح كود شبه-C باستخدام Semgrep، والتحقق من النتائج باستخدام GPT-3.5-Turbo لتقليل الإيجابيات الكاذبة.

    585
  • 4

    opencti

    opencti-platform/opencti

    منصة مفتوحة لاستخبارات التهديدات السيبرانية

    550
  • 5

    DFRoot

    a2333c/dfroot

    أداة root لنظام Android لهاتف Samsung Galaxy S25 Ultra (SM-S938B) تقوم بتسلسل DirtyFrag CVE-2026-43284 وCVE-2026-43499 للحصول على صلاحيات root تلقائيًا عند الإقلاع عبر KernelSU.

    414
  • 6

    ARTEX

    baarai/artex

    منصة اختبار اختراق مستقلة متعددة الوكلاء تعتمد على LLM، مع وكلاء تخطيط وتنفيذ، ومخططات للأصول والاستكشاف، وتسجيل حركة مرور MITM، وإعادة اختبار الثغرات.

    409

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →