harden(defender): docs/18 §7 抗静态分析硬化(符号隐藏/串混淆/副本分散/基线派生)
针对「纯客户端抗静态分析」的最高性价比项落地,守在 tests/test_static_hardening.py(6 条,gate 于 iphoneos SDK): - 符号隐藏 + strip(§7.0 新增):IGVisibility.h 定 IG_INTERNAL=hidden,全库 -fvisibility=hidden;仅四入口 ig_defender_scan/ig_poison_init/ig_poison_apply/ ig_policy_scan_and_mark 标 IG_PUBLIC 保持导出,其余 ig_* 变 private external, 链接后 strip -x 彻底消失——攻击者 nm 不再能按名定位 ig_poison_mark/mask 去 NOP。 - §7.1 串混淆:gen_jb_paths.py(唯一真源)生成 IGJailbreakPaths.inc / IGInjectSignatures.inc(XOR keystream,两表不共享 key),运行期解码进栈、用完擦除; decode 内 volatile key 屏障阻止 -O2 把常量折叠回 __const 明文。strings 已捞不到 /var/jb、Cydia、substrate、gum-js-loop 等。--check 守 .inc 与清单同步。 - §7.2 副本分散:g_h0/h1/h2 置于不相邻命名段 __DATA,__ig_p0/p1/p2,加 __ig_pd 诱饵 (mask 不读);刻意不用 TLS(会破坏跨线程毒化一致性)。 - §7.4 基线派生:删硬编码 0xA5C3F10E7B2D4968,改 ig_poison_baseline() 由拆分种子经 volatile 屏障派生;otool -tV 已无旧魔数立即数。 - §7.3 OLLVM/VMP:仅留 build 的 IG_OBFUSCATOR hook,stock clang 无能力,需另备工具链(未完成)。 - §7.5 越狱设备正向验证仍阻塞(无设备)。 构建/快照同步:build_defender_lib.sh 加 -fvisibility=hidden + gen --check + IG_OBFUSCATOR hook;build_poison_device.py 快照纳入 *.inc。全量 69 测试通过;poison_device.m 全模块 iphoneos 交叉编译通过(arm64)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
60d868a351
commit
b76d7cdc21
@@ -23,12 +23,14 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "IGVisibility.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 把多副本健康值置为基线。应在尽早的构造期调用一次(也有构造函数兜底)。 */
|
||||
void ig_poison_init(void);
|
||||
IG_PUBLIC void ig_poison_init(void);
|
||||
|
||||
/*
|
||||
* 命中强信号组合时调用:把 entropy(必须非 0)混进所有健康值副本,使其偏离基线。
|
||||
@@ -47,7 +49,7 @@ uint64_t ig_poison_mask(void);
|
||||
* 健康时 out 与 in 逐字节相等(掩码 0,异或 0);毒化时每字节被掩码扰动。
|
||||
* 业务用法:对解密 key 的字节调用本函数后再传给解密器——健康照常、毒化解出乱码。
|
||||
*/
|
||||
void ig_poison_apply(const uint8_t *in, uint8_t *out, size_t n);
|
||||
IG_PUBLIC void ig_poison_apply(const uint8_t *in, uint8_t *out, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user