Files
iOSGuard/defender/anti_jailbreak/IGAntiJailbreak.h
T
shenleiandClaude Opus 4.8 599e1da5ce feat(defender): 可集成静态库 + readoor 接入方案(检测→分级→数据毒化闭环)
在 iOSGuard 侧产出可集成产物与接入文档,不修改 readoor 代码。

- defender/: anti_hook/anti_frida/anti_debug/anti_jailbreak 探针 + syscall 直发、
  policy 分级层、poison 数据依赖毒化、dispatch/resolve/call_bridge 等子模块
- poison: 三副本冗余、无分支掩码;健康恒等、毒化破坏 key(替代 if-exit 处置)
- policy: STRONG/MEDIUM/WEAK 分级,守误报底线,仅 DETECTED 参与、组合命中才毒化
- anti_jailbreak: IGSyscall 直发 svc 检测越狱文件(400)/沙盒逃逸(401),绕 libc hook
- tools/build_defender_lib.sh: 一键交叉编译打包 libIGDefender.a(arm64) + umbrella 头
- docs/18_READOOR_DEFENDER_INTEGRATION.md: 精确到文件/bridging/替换点/代码片段
- docs/05-17 + evidence + tests + macho_guard/static_sdk_redirect 工具链

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-12 22:16:47 +09:00

45 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* IGAntiJailbreak.h — 越狱检测探针(走 IGSyscall 直发 svc,绕过 libc 层 hook)。
*
* 定位:Shadow / Liberty / A-Bypass 这类反越狱检测插件主要 hook 在 libc/ObjC 层
* (stat/access/fopen/NSFileManager)。本探针用 IGSyscall 的 svc #0x80 直发
* access(2)/open(2),那条可被 hook 的 libSystem 入口在此路径上不存在——检测点下沉到
* bypass 够不到的层。这是纯客户端对抗里"抬高绕过成本"的关键一环(非根治)。
*
* 只采集证据、不处置:命中经 sink 上报,是否毒化/降级由策略层([[iosguard-disposition-strategy]]
* 的 ig_poison_mark)按强信号组合决定。本探针绝不自行 exit。
*
* 边界:
* - 路径特征可被 rootless 越狱改位;未命中不等于干净(组合判定原则不变)。
* - 当前骨架路径字符串为明文,静态可见、bypass 可针对——TODO 用 IGResolve 的 XOR 混淆
* (IG_ENC),与 svc 号混淆同理。svc 直发本身已是主要价值,字符串混淆是第二层。
* - 仅 arm64 直发;非 arm64(宿主 x86_64)syscall 退化 unavailable。
*/
#ifndef IG_ANTI_JAILBREAK_H
#define IG_ANTI_JAILBREAK_H
#include "IGDefender.h"
#ifdef __cplusplus
extern "C" {
#endif
/* 默认检测:内置 iOS 越狱特征表 + 沙盒逃逸探测。返回 DETECTED 条数。 */
int ig_anti_jb_check(IGFindingSink sink, void *ctx);
/*
* 可注入版本(供自测/定制)。
* paths/count:要探测可访问性的路径表(access F_OK);命中记 reason=400。
* sandbox_probe_path:非 NULL 时尝试在该(应在沙盒外的)路径创建文件,成功=沙盒逃逸,记 401
* 并立即清理;NULL 跳过逃逸探测。
*/
int ig_anti_jb_check_paths(const char *const *paths, size_t count,
const char *sandbox_probe_path,
IGFindingSink sink, void *ctx);
#ifdef __cplusplus
}
#endif
#endif /* IG_ANTI_JAILBREAK_H */