DirtyFrag README

项目的 README,来自 github.com/mitschud/DirtyFrag。合并为一个 markdown 文件:README.md。

DirtyFrag grenade logo

DirtyFrag

Root without unlocking. Gone after reboot.

An ephemeral Android root utility powered by CVE-2026-43284.
Built for Samsung devices, with a One UI-inspired interface, KernelSU integration,
and no custom kernel or unlocked bootloader required on vulnerable devices.

Release Android 12+ One UI 9 KernelSU GPL-2.0-only

Download APK  ·  Report an issue  ·  Upstream DFRoot

[!IMPORTANT] Compatibility depends on the device's kernel and security patches. Root is ephemeral. The kernel module, su and any loaded modules are gone the moment the device reboots. A reboot always returns the phone to a clean, unrooted state - which is also the recovery path if a run goes wrong.

Install

  1. Install the DirtyFrag APK from Releases.
  2. Install an SU manager that ships libksud.so:
  3. Open DirtyFrag, pick your manager in the SU Manager card, then press Run exploit.

[!WARNING] Since 1.10 (upstream 3.2) DirtyFrag no longer bundles ksud - it is staged from the selected manager's own libksud.so. A manager that does not ship that library cannot give you root. The older advice to install a CI / Actions build of the manager no longer applies.

[!NOTE] Pre-release builds of master are not published to Releases. Take the DFRoot artifact of the latest green Build run: it is a signed release build - the workflow restores the KEYSTORE secret into app/keystore.jks and runs assembleRelease - and inside the artifact the APK is at app/build/outputs/apk/release/dirtyfrag.apk. Tagged and untagged builds go through that same keystore step, so a master build carries the released app's signing key and installs over it as an update rather than a fresh install.

A fresh install of DirtyFrag gets a new Android UID, so the grant in the manager has to be given again after every reinstall.

Screenshot_20261101_001753

Features

FAQ

Q: Log says patching failed and that my device isn't vulnerable

A: Sorry, there is no fix. Either:

Q: Log says "SUCCESS" or "ksud exited with error", but I don't have root

A: Turn off Auto reboot on the Autorun card if it is enabled - a soft reboot that the manager cannot complete leaves the loaded module unloaded again. Otherwise see upstream discussion 69.

Q: I installed a module and now I can't launch root without crashing

A: Set the KernelSU Modules card to Disabled and reroot. The switch works without root, which is the point - it is the escape hatch when a module is the thing that is crashing the run.

Q: Module + Autorun and now I am bootlooping

A: Android usually detects the bootloop and offers Safe Mode; otherwise hold Volume Down during boot. From Safe Mode turn Autorun off and set KernelSU Modules to Disabled, or just uninstall DirtyFrag until you stabilise. If you cannot get far enough into the system, adb uninstall df.root from any PC works on user builds without root.

Q: The progress bar sits at 0 percent

A: That is the app's log-marker mapping, not the exploit. The run window is 70 seconds - do not re-run a "slow" run, the daemon may still be working.

Q: How do I remove root cleanly?

A: Before unrooting, use file manager with root and delete /data/adb/ksu, ksud, module residue.

Building

JAVA_HOME="<Android Studio jbr>" ./gradlew assembleRelease

The APK is written to app/build/outputs/apk/release/dirtyfrag.apk.

Release builds are signed with app/keystore.jks, which is gitignored (the signing config expects alias dirtyfrag and dirtyfrag for both passwords). Generate your own before building:

keytool -genkeypair -v -keystore app/keystore.jks -alias dirtyfrag \
  -keyalg RSA -keysize 2048 -validity 10000 \
  -storepass dirtyfrag -keypass dirtyfrag

The eight prebuilt kernel modules are committed under app/src/main/jni/ko/. Upstream gitignores them and builds them per-KMI in CI; this fork commits them so a plain clone builds without a DDK toolchain. They are built by this repo's Build workflow (the LKMs / <kmi> jobs) from the current lkm/dfroot.c, so they must be rebuilt whenever that file changes: run the workflow, download the df-lkm-<kmi> artifacts and drop them in this directory. To build them yourself instead, use upstream's make / podman DDK flow.

How it works

The Android kernel decrypts AES-CBC ESP packets directly into the page cache of files open for splice(). By crafting IV = AES_ECB_DEC(key, current_content) XOR desired_content, any 16-byte-aligned block in a mapped shared library can be overwritten without write permission and without copy-on-write.

The exploit uses this primitive to patch shellcode into libc++.so in the kernel's page cache. The next privileged call to the hooked function runs the shellcode, which loads the kernel module via insmod.

Exploit chain

  1. IpSec transform - the app allocates a UdpEncapsulationSocket plus an SPI and builds an AES-CBC/HMAC-SHA256 ESP transform through IpSecManager.
  2. splicehelper -> crash_dump64 - splicehelper is spliced into crash_dump64 using the CBC primitive. crash_dump64 runs in the crash_dump SELinux domain, which can open vendor_file labelled files that untrusted_app cannot read - the bridge we need.
  3. dfroot.ko -> vendor_file - the kernel module is written through that bridge into a vendor_file-labelled file.
  4. libc++ hook (fires in init, uid=0, tid=1) - shellcode patched at std::ostream::sentry::sentry(). It checks uid and tid, creates /dev/df as a one-shot mutex so it cannot re-enter, then execs insmod in the vendor_modprobe domain.
  5. dfroot.ko init - sets SELinux permissive, bypasses DEFEX via kprobes where present, then uses call_usermodehelper to run the bootstrap.
  6. bootstrap - reads the app's device-protected settings, adopts the zygote environment, sets partitions read-only, optionally disables all modules, and finally launches the SU daemon from your installed SU manager.

Credits

License

GPL-2.0-only - the full text is in LICENSE, the file upstream added in 4ec133c because the upstream maintainer asked for one. Upstream keeps its own copyright on its code; everything this fork adds on top of it is licensed under the same GPL-2.0-only, from the 1.17 merge onward.

That single licence has one consequence worth stating before anyone ports code in: GPL-2.0-only cannot absorb GPL-3.0-only code. A GPL-3 reference - the Samsung download-mode (Odin) work, for example - may be read for behaviour, record formats and API naming, and none of its code may be copied, translated or linked into this tree. The same rule is written down in docs/d2-download-mode-writer.md.

DirtyFrag (mitschud/DirtyFrag)

正在搜索数据库…

这是什么?DirtyFrag 是 diabl0w 的 DFRoot 的加固版分支,它利用 CVE-2026-43284(一种内核页缓存写入原语)在 Samsung 等 Android 手机上临时获取 root 权限,无需解锁 bootloader,也无需自定义内核。
我该如何让 root 运行起来?从 Releases 页面安装 DirtyFrag APK,再安装一个自带 libksud.so 的 SU 管理器,然后打开应用,在 SU Manager 卡片中选择该管理器,并点击 Run exploit。
有没有 SU 管理器能和它一起用?只有自带 libksud.so 库的管理器才能用。Samsung 设备必须使用 diabl0w 的 KernelSU 分支;其他手机可以使用 KernelSU、KernelSU-Next、KowSU 或 BakaSU。
重启后 root 权限还在吗?不在。root 是临时的:设备一重启,内核模块、su 以及所有已加载的模块都会消失。如果运行出了问题,重启也是恢复的办法。
这个工具适用于哪些手机?它专为带有 OneUI、RKP 和 KDP 内核加固的 Samsung 手机设计,而且只对内核尚未修补或缓解该底层漏洞的设备有效。
如果设备不存在漏洞怎么办?应用会记录补丁失败的日志,这种情况下没有修复办法。原因可能是内核太新、厂商回移植了缓解措施,或者意外触发了某种缓解机制,常见于 6.1 内核。
我看到了 SUCCESS 日志,但仍然没有 root,这是怎么回事?请在 Autorun 卡片上关闭 Auto reboot(自动重启)。如果 SU 管理器无法完成一次软重启,已加载的内核模块会再次被卸载。
工具栏里的 Odin 标签显示的是什么?它是一个状态指示器,用来显示当前固件是否仍允许设备进入 Download 模式。点击它可以看到决定这一结果的三项依据。
之后如何干净地移除 root?取消 root 之前,请使用 root 文件管理器删除 /data/adb/KernelSU 以及 KSUD 的残留文件。
这个底层漏洞利用究竟是如何工作的?它利用了内核将 AES-CBC ESP 数据包直接解密到页缓存的机制,使应用在没有写入权限的情况下,也能覆盖已映射共享库中一个 16 字节对齐的数据块,并把 shellcode 写入 libc++.so,随后通过 insmod 加载内核模块。
作者
mitschud
大小
12.2 MB
星标
1.4K
时长
1个月
提交 · 90 天