Re macos

From dslsdzc/rev-skills · View interactive version

Re macos is an AI agent skill from the GitHub repository dslsdzc/rev-skills. macOS 原生应用逆向:App Bundle/签名公证、entitlements、沙箱与 TCC、钥匙串与 Secure Enclave。 触发词:macOS逆向、mac app、entitlements、Secure Enclave、钥匙串、TCC、codesign、公证。

How to use this skill

Skill file

macOS 应用逆向

何时使用 / 何时不用

工具准备

codesign / spctl / otool / lipo(签名与 Mach-O 工具,macOS 内置)

plutil / xattr(Info.plist 与 quarantine 检查,macOS 内置)

Hopper / IDA / Ghidra(反编译底座)

lldb(动态调试)

操作步骤

按顺序执行,每步产物存档(路径 + sha256,见 [[re-triage]])。签名/entitlements 信息按 [[re-analyze/analysis-contract]] 契约记录。

  1. 包结构与签名检查:

```sh

file Sample.app/Contents/MacOS/Sample

codesign -dv Sample.app 2>&1 | head # 签名者/Team ID(要求需 -d -r- 查看)

spctl -a -vv Sample.app 2>&1 # 公证状态(Gatekeeper)

defaults read Sample.app/Contents/Info.plist # Info.plist 关键键

```

  1. entitlements 与沙箱:

```sh

codesign -d --entitlements :- Sample.app 2>&1 | head -30

```

  1. TCC 权限库:

```sh

# 用户级 TCC 库(授权记录)

ls ~/Library/Application\ Support/com.apple.TCC/

# 系统级 TCC 库

ls /Library/Application\ Support/com.apple.TCC/

```

  1. 钥匙串与 Secure Enclave:
  1. dyld 加载链:

```sh

otool -L Sample.app/Contents/MacOS/Sample | head # LC_LOAD_DYLIB 依赖

otool -l Sample.app/Contents/MacOS/Sample | grep -A4 LC_RPATH

```

  1. 反调试与保护:
  1. 证据核对(收尾):签名者/Team ID/entitlements 原文、TCC 依赖点、钥匙串条目用途、dyld 依赖清单——按 [[re-analyze/analysis-contract]] 入档;动态结论与静态清单对照(能力边界以动态行为为准,见 [[decision-tree]])

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.