Repository navigation
Dev branch 开发分支
Pre-release这不是 Ghostlock-App 的稳定版本,如需下载稳定版请前往另一个 pre-release
This is not the stable release of Ghostlock-App, please go to another pre-release tag for downloading the stable version.
Dev Blog / 开发博客
English version on the bottom
References are in the readme.md
GhostLock 的未来:图灵完备
GhostLock 正在引入基于 Lua 的图灵完备运行时配置,让开发者能够编排不同漏洞提供的能力,为目标设备进行专门优化。与此同时,我们也在推进 C++ 架构重构,为未来的插件开发和新漏洞适配提供更清晰的基础。
这一轮开发围绕 CVE-2026-43499 与 CVE-2026-43284 两条漏洞后端展开,同时为更多漏洞预留接入点。自定义 handoff、统一配置与配套验证体系,也是当前工作的重点。
本文介绍的重构与新增能力均在开发中,尚不可用;插件系统则处于规划阶段。 下文介绍的是开发方向与设计目标,实际可用范围将以完成验证后的发布说明为准。
统一后端架构,为更多漏洞接入做准备
CVE-2026-43284 采用了一条不同于 PI-futex 的执行路径:通过 page cache 写入与厂商模块加载机制完成中继内核模块驻留,再接续用户态执行。
这条路径无需为特定内核提取偏移,也无需依赖堆风水。在目前的测试中,其提权速度约为 CVE-2026-43499 的 20 倍,平均耗时约两秒。
我们正在将 CVE-2026-43284 与 CVE-2026-43499 整合到同一套配置模型和可高度自定义的执行管线(Pipeline)中。完成后,使用者可以根据目标设备的支持情况选择后端,无需分别维护两套使用流程。具体支持范围仍以精确内核匹配和真机验证结果为准。
这套架构也为更多漏洞后端预留了接入位置。预留接口并不代表对应漏洞已经得到支持,但它为后续实现提供了明确的归属:新后端可以保留自己的执行机制,同时复用配置、校验和执行管理能力。
自定义 handoff:扩展提权后的执行能力
原版 GhostLock 的执行终点限于通过命令行执行 ksud,启动 KernelSU。正在开发的自定义 handoff 将扩展这一流程,让使用者能够利用内核提权获得的权限,完成更多自定义操作:
- 运行自定义脚本,以 root 权限执行所需的用户态任务。
- 启动自定义程序,以 root 权限运行自己的工具或服务。
- 加载自定义内核扩展(.ko),将所需能力引入内核。
这些能力将支持更具体的使用场景:
- 接入未提供越狱模式的 root 管理器,为其定制内核组件加载与用户态服务启动流程。
- 建立临时诊断与调试环境,自动启动需要 root 权限的调试服务和日志采集工具,将环境准备、问题排查与资源清理组织为可重复执行的流程。
- 验证自定义内核功能,加载用于性能分析、故障诊断或功能实验的内核扩展,配合用户态测试程序完成验证,并执行相应的卸载与清理。
此前,这些操作也可以通过修改 root script 实现,但流程的复用、维护和验证都需要额外工作。自定义 handoff 将把这些需求纳入统一的配置与执行模型,减少使用者反复修改底层脚本的负担。
脚本和程序仍在用户态执行,内核扩展则运行于内核态;handoff 负责衔接这些不同的执行需求。
在新的设计中,命令、脚本和扩展加载将统一表达为队列中的步骤,支持按需组合,并在启动前识别不支持的搭配。用户脚本片段将在执行前与内置模板合成,不同接管方式使用同一份生成结果,方便核对和维护。
收尾流程也在同步设计:模板后段负责常规清理,标记为 always 的步骤承担必要的后续操作,内核侧提供 SELinux 恢复、模块自卸等收尾机制。各层机制的触发条件与异常路径都需要完成验证。
重构 C++ 运行时:明确操作、路径与执行顺序
随着后端和执行方式增加,原先紧密结合的内部逻辑需要更清晰的职责划分。我们正在围绕三个层次重构 C++ 运行时:
- 原语:定义操作本身及其参数。
- 路径:决定操作通过哪种具体机制完成。
- 装配:描述操作的执行顺序与依赖关系。
这一划分将配合更完整的启动前校验。每个操作都需要声明所需能力和允许使用的路径;不满足条件的组合会在执行前被拒绝,并提供明确的失败原因。
配置读取也将随之收敛:一次执行只加载当前计划需要的后端与路径,字段通过统一入口读取,减少同一份数据在不同位置产生不同解释的可能。
对于时序敏感的 PI-futex 竞争窗口,重构将保留严格限制:动态分派发生在窗口之外,窗口内使用具体类型、静态调用和简单数据结构。这些约束将由可执行检查持续验证。
Lua:可编程的运行时配置
Lua 的接入工作旨在让配置直接表达条件分支、循环以及阶段之间的资源引用。使用者和贡献者将能够在编排层描述更复杂的执行计划,减少为了调整流程而修改底层实现的需求。
图灵完备描述的是配置的表达能力,脚本能够访问的系统能力仍由宿主限定。
按照当前设计,Lua 将运行在受限环境中,不开放标准库中的文件访问、系统执行和动态库加载接口,并设置指令预算与内存上限。脚本只在操作之间执行,避免进入时序敏感的竞争窗口。
脚本将通过类型化句柄引用底层资源,无需直接传递裸地址。可调用的操作由宿主显式提供,能力白名单不包含直接写入块设备或分区的原语。
导入方式将保持开放,方便社区分享经过调优的配置与执行计划。来源和哈希用于展示与核对,不作为导入拦截条件;实际执行仍须通过能力和参数校验。
移除 vr.ko 对策,降低持续维护成本
我们的研究表明,厂商通过 vr.ko 以最短五分钟的间隔收集设备上的“异常行为”,其中包括使用 GhostLock-App 进行提权,并以平均约三十分钟的间隔,对 vr.ko 进行针对性的远程更新。
这种频繁的攻防变化意味着,针对其具体实现编写的对策需要持续跟进,也容易让 GhostLock-App 的执行逻辑与厂商内部机制形成较高耦合。
长期在项目内部维持这类适配,会显著增加验证与维护成本。因此,我们正在推进现有 vr.ko 对策的移除工作,逐步清理相关配置与实现。涉及攻击路径的调整仍需通过真机验证。
未来,我们计划通过插件系统开放相应接口,让社区能够独立维护和更新 vr.ko 对策,减少这类快速变化的适配工作与核心运行时之间的耦合。
规划中的插件系统
插件系统目前处于规划阶段。我们计划以 Lua 为统一的插件控制与编排方式,让插件通过 manifest 表声明能力、执行阶段和参数结构,并通过明确的阶段接口接入同样由 Lua 编排的执行过程。
插件与 payload 编排拟复用同一个 Lua VM、沙箱和预算机制,同时为各插件设置独立环境与配额。这样既能复用公共基础设施,也便于在统一规则下管理插件能力和资源消耗。
这部分工作将在 C++ 运行时重构和 Lua 接入完成后推进,具体接口将随设计与验证结果逐步明确。
分阶段交付,以验证结果推进
当前开发将分批推进:首先明确层级职责,随后完成能力接入、路径选择和原语校验,再完成 Lua 集成。插件系统作为后续规划单独推进。目前,本文描述的新增能力仍处于早期开发阶段。
每一批都需要通过既定验收,才会进入下一阶段。涉及架构、配置契约或执行路径的重要改动,将先完成设计文档和独立审查,再开始实现。目前我们不承诺固定发布时间,进度以各阶段的验证结果为准。
验证会同时检查外部行为与内部结构,结合日志、生成结果、单元测试、静态断言和一致性检查,重点覆盖边界条件与异常路径。攻击路径的改动始终以真机验证为准,反汇编对比作为辅助诊断。
未完成项、已知限制和技术债会持续记录,并说明后续处理安排;调整过的设计也会保留决策依据,方便贡献者理解项目的演进过程。
参与 GhostLock 的下一阶段
我们欢迎机型与 profile 信息、真机测试日志,以及对 Lua 配置、自定义 handoff 和未来插件接口的建议。
尤其欢迎附带复现条件、日志或代码位置的反馈。它们能够帮助我们确认支持范围、检验设计假设,并把问题转化为可验证的改进。
我们期待与贡献者一起,让 GhostLock 在支持更多后端的同时,保持清晰的配置方式、执行边界和扩展接口。
The Future of GhostLock: Turing-Complete Configuration
GhostLock is introducing a Turing-complete, Lua-based runtime configuration system, allowing developers to orchestrate capabilities provided by different vulnerabilities and tailor execution to specific devices. Alongside this work, we are restructuring the C++ architecture to provide a clearer foundation for future plugin development and support for additional vulnerabilities.
This development effort centers on two vulnerability backends, CVE-2026-43499 and CVE-2026-43284, while providing integration points for more backends. Custom handoff, unified configuration, and the accompanying validation infrastructure are also central to this work.
The refactoring and new capabilities described here are still in development and are not yet available. The plugin system remains in the planning stage. This article outlines our development direction and design goals. Actual availability will be documented in release notes once validation is complete.
A Unified Backend Architecture, Ready for Further Expansion
CVE-2026-43284 takes a different execution path from PI-futex: it uses page-cache writes and the vendor’s module-loading mechanism to establish a resident intermediary kernel module, which then continues execution in user space.
This approach requires neither extracting offsets for specific kernels nor relying on heap feng shui. In our current tests, privilege escalation is approximately 20 times as fast as with CVE-2026-43499, taking around two seconds on average.
We are integrating CVE-2026-43284 and CVE-2026-43499 into a shared configuration model and a highly customizable execution pipeline. Once this work is complete, users will be able to select a backend based on their target device’s support status, without maintaining two separate workflows. Support will continue to depend on exact kernel-release matching and validation on physical devices.
The architecture also provides integration points for additional vulnerability backends. These interfaces do not imply that the corresponding vulnerabilities are already supported. They do, however, give future implementations a clear place in the system: each backend can retain its own execution mechanism while reusing configuration, validation, and execution management.
Custom Handoff: Extending What Happens After Privilege Escalation
The original GhostLock workflow ends by invoking ksud from the command line to start KernelSU. The custom handoff system now in development will extend this workflow, allowing users to use the privileges obtained through kernel exploitation for a broader range of operations:
- Run custom scripts with root privileges to perform user-space tasks.
- Launch custom programs, running their own tools or services as root.
- Load custom kernel extensions (.ko) to introduce additional capabilities into the kernel.
These capabilities will support more specific use cases:
- Integrate root managers that do not provide a jailbreak mode, with customized workflows for loading their kernel components and starting their user-space services.
- Set up temporary diagnostic and debugging environments, automatically starting tools and log collectors that require root privileges, and organizing environment preparation, troubleshooting, and cleanup into repeatable workflows.
- Validate custom kernel functionality, loading extensions for performance analysis, fault diagnosis, or experimental features, coordinating with user-space test programs, and performing the corresponding unloading and cleanup.
Previously, these operations could also be implemented by modifying the root script, but reusing, maintaining, and validating those workflows required additional work. Custom handoff will bring these requirements into a unified configuration and execution model, reducing the need to repeatedly modify the underlying scripts.
Scripts and programs will still execute in user space, while kernel extensions execute in kernel space. Handoff connects these different execution requirements.
In the new design, commands, scripts, and extension loading will be represented as steps in a queue. Users will be able to compose them as needed, with unsupported combinations identified before execution begins. User-provided script fragments will be combined with built-in templates before execution. Different handoff mechanisms will use the same generated script, making behavior easier to review and maintain.
Cleanup is being designed alongside execution: the final section of the template handles routine cleanup, steps marked always perform required follow-up operations, and kernel-side mechanisms provide SELinux restoration and module self-unloading. The triggering conditions and failure paths for each layer still need to be validated.
Refactoring the C++ Runtime: Separating Operations, Routes, and Execution Order
As the number of backends and execution methods grows, previously tightly coupled logic needs clearer responsibilities. We are restructuring the C++ runtime around three layers:
- Primitives define operations and their parameters.
- Routes determine the concrete mechanism used to perform each operation.
- Composition describes execution order and dependencies.
This separation will be accompanied by more comprehensive pre-execution validation. Each operation must declare its required capabilities and permitted routes. Combinations that do not meet these requirements will be rejected before execution, with a clear explanation.
Configuration access will also become more focused: each execution will load only the backends and routes required by its plan, and fields will be read through a single access path. This reduces the possibility of the same data being interpreted differently in different parts of the system.
For the timing-sensitive PI-futex race window, the refactoring will preserve strict constraints: dynamic dispatch stays outside the window, while code inside it uses concrete types, static calls, and simple data structures. Automated checks will continuously verify these constraints.
Lua: Programmable Runtime Configuration
The Lua integration is intended to let configuration directly express conditional branches, loops, and resource references across stages. Users and contributors will be able to describe more complex execution plans at the orchestration layer, reducing the need to modify low-level implementations when adjusting a workflow.
Turing completeness describes the configuration system’s expressive power. The system capabilities available to scripts remain controlled by the host.
Under the current design, Lua will run in a restricted environment without access to standard-library interfaces for file access, system command execution, or dynamic library loading. Instruction budgets and memory limits will also apply. Scripts will execute only between operations, keeping them outside timing-sensitive race windows.
Scripts will reference underlying resources through typed handles rather than passing raw addresses. Callable operations will be explicitly exposed by the host, and the capability allowlist will not include primitives for directly writing to block devices or partitions.
Imports will remain open, allowing the community to share tuned configurations and execution plans. Source information and hashes will be displayed for inspection rather than used to block imports. Execution will still require capability and parameter validation.
Removing vr.ko Countermeasures to Reduce Maintenance Costs
Our research shows that the vendor uses vr.ko to collect “abnormal activity” on devices at intervals as short as five minutes, including privilege escalation using GhostLock-App. The vendor also delivers targeted remote updates to vr.ko approximately every thirty minutes on average.
This rapid cycle of countermeasures means that workarounds tied to specific implementations require continuous updates. It also creates tight coupling between GhostLock-App’s execution logic and the vendor’s internal mechanisms.
Maintaining these adaptations within the project over the long term significantly increases validation and maintenance costs. We are therefore working to remove the existing vr.ko countermeasures and clean up the associated configuration and implementation. Changes affecting exploit execution must still pass validation on physical devices.
In the future, we plan to expose the relevant interfaces through the plugin system so that the community can maintain and update vr.ko countermeasures independently. This should reduce the coupling between rapidly changing adaptations and the core runtime.
The Planned Plugin System
The plugin system is currently in the planning stage. We intend to use Lua as the common language for plugin control and orchestration. Plugins will declare their capabilities, execution stages, and parameter structures through a manifest table, and join the Lua-orchestrated execution flow through explicit stage interfaces.
Plugins and payload orchestration are intended to share the same Lua VM, sandbox, and budgeting mechanisms, with separate environments and quotas for individual plugins. This will allow common infrastructure to be reused while keeping plugin capabilities and resource consumption under consistent rules.
This work will follow the C++ runtime refactoring and Lua integration. The specific interfaces will be defined as design and validation progress.
Incremental Delivery, Guided by Validation
Development will proceed in stages: first clarifying layer responsibilities, then connecting capabilities, implementing route selection and primitive validation, and completing Lua integration. The plugin system will follow as a separate effort. The new capabilities described in this article are still in early development.
Each stage must meet its acceptance criteria before the next begins. Significant changes to architecture, configuration contracts, or execution paths will require a design document and independent review before implementation. We are not committing to a fixed release date; progress will be determined by validation results.
Validation will cover both externally observable behavior and internal structure, using logs, generated output, unit tests, static assertions, and consistency checks, with particular attention to boundary conditions and failure paths. Changes to exploit execution must pass validation on physical devices. Disassembly comparisons will serve as a supplementary diagnostic tool.
Incomplete work, known limitations, and technical debt will remain documented, together with plans for addressing them. Revised designs will retain their decision history so contributors can understand how the project has evolved.
Contribute to GhostLock’s Next Stage
We welcome device and profile information, logs from physical-device testing, and feedback on Lua configuration, custom handoff, and the future plugin interfaces.
Feedback with reproduction conditions, logs, or code references is especially useful. It helps us establish support boundaries, test design assumptions, and turn reported issues into verifiable improvements.
We look forward to working with contributors to expand GhostLock’s backend support while keeping its configuration, execution boundaries, and extension interfaces clear.