Analyzing Macos Binaries 标志

Analyzing Macos Binaries

社区
trilwu
analyzing-macos-binaries

对 macOS 应用和 Mach-O 二进制文件进行逆向工程和安全审查,包括拆分通用二进制文件、还原 Objective-C/Swift 结构、读取代码签名权限和强化运行时信息,以及审计 XPC 服务、动态库加载路径和 TCC 隐私风险。分析 macOS 上的 .app 软件包或 Mach-O、检查权限和公证状态、查找动态库劫持或 XPC 权限漏洞,或分析 Gatekeeper 和隔离属性时使用。

Add to TypingMind

概览

发布者trilwu
代码仓库secskills
技能名称analyzing-macos-binaries
星标数
144
复刻数
15
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 trilwu 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Analyzing Macos Binaries AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/trilwu/secskills/tree/main/secskills-core/skills/analyzing-macos-binaries
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/trilwu/secskills.git /tmp/secskills
mkdir -p .claude/skills
cp -r /tmp/secskills/secskills-core/skills/analyzing-macos-binaries .claude/skills/analyzing-macos-binaries
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Analyzing Macos Binaries,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Analyzing Macos Binaries。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Analyzing Macos Binaries 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Analyzing macOS Binaries

macOS reverse engineering is Mach-O plus a specific security model: code signing, entitlements, the sandbox, TCC privacy, and XPC between processes. The binary tells you what the code does; the entitlements and load paths tell you what it is allowed to do and where an attacker could get in. Read both — most macOS findings live in the gap between the two.

When to Use

  • Analyzing a .app bundle or a Mach-O executable/dylib/framework on macOS
  • Reading entitlements, hardened-runtime flags, notarization, and Gatekeeper quarantine state
  • Auditing an XPC service or privileged helper for an authorization bug
  • Hunting dylib hijacking / proxying via @rpath and weak dylibs
  • Reasoning about TCC privacy exposure and sandbox escape surface

When NOT to Use

  • iOS apps — IPA decryption, FairPlay (cryptid=1), App Store binaries — are analyzing-ios-binaries. Same Mach-O format, different toolchain and DRM.
  • Non-Mach-O or cross-platform triage with no macOS specifics — analyzing-binaries.
  • Turning a memory-corruption crash into an exploit — exploiting-memory-corruption.
  • A Mach-O that is packed/encrypted before you can read it — unpacking-protected-binaries.

Triage the Binary and Bundle

  • Thin the universal binary. macOS ships fat binaries (x86_64 + arm64); use lipo -thin (or lipo -archs to list) so your tools work on one slice.
  • Read the Mach-O. otool -l for load commands, otool -L for linked dylibs and their paths, nm for symbols. Note the load commands that matter later: LC_RPATH, LC_LOAD_DYLIB / LC_LOAD_WEAK_DYLIB, and the code signature.
  • Walk the bundle. Contents/MacOS (the binary), Info.plist (identifiers, URL schemes), _CodeSignature, embedded Frameworks/, and any bundled XPCServices/. The bundle layout is the map of what to analyze.

Recover Objective-C and Swift

  • Objective-C keeps rich runtime metadata: class-dump (or dsdump) reconstructs class, method, and property declarations straight from the binary. This is the fastest way to see the app's structure.
  • Swift is harder — names are mangled and metadata is less forthcoming. Run swift-demangle over symbols to get readable names, and expect to lean on the decompiler (Hopper, Ghidra, IDA) more than with Objective-C.
  • Note which language dominates before choosing the approach; a Swift binary where class-dump returns little is normal, not a failure.

Code Signing, Entitlements, and Gatekeeper

This is where macOS-specific authority lives:

  • codesign -dvvv --entitlements :- <binary> dumps the signature and the entitlements — the capabilities the OS grants. Entitlements like com.apple.security.get-task-allow (debuggable), disabled library validation, or private TCC entitlements are the high-value reads.
  • Hardened runtime flags restrict code injection and debugging; note whether they are on, and whether library validation is disabled (which allows loading unsigned dylibs — directly relevant to hijacking).
  • Notarization and Gatekeeper. Downloaded files carry the com.apple.quarantine extended attribute; Gatekeeper checks notarization on first run. Understand the quarantine/notarization state when reasoning about what will execute and what a user was warned about.

The macOS-Specific Bug Surface

  • Dylib hijacking / proxying. A binary that loads a dylib from an @rpath that resolves to a writable location, or a LC_LOAD_WEAK_DYLIB that is absent, lets an attacker drop a malicious dylib and get code execution in the app's context — inheriting its entitlements. Enumerate the load paths and check which are attacker-writable and unprotected by library validation.
  • XPC services and privileged helpers. XPC is the mach-based IPC between an app and its helpers (often a SMJobBless root helper). The classic bug is a helper that authorizes a client by PID — which races and is spoofable — instead of by audit_token. Trace how the service validates its caller and what privileged action it will perform; weak validation is local privilege escalation.
  • TCC privacy. TCC gates access to camera, mic, files, and automation. Look at what the app is entitled to and whether it can be coerced into acting as a confused deputy for a less-privileged process, or whether an injectable dylib inherits its TCC grants.
  • URL schemes and Info.plist handlers register the app to handle input from other apps and the web — an untrusted-input entry point.

Dynamic Analysis

Frida attaches to macOS processes for runtime hooking; lldb debugs (subject to get-task-allow/SIP); dtrace traces syscalls and library calls where SIP permits. Use these to watch XPC messages and dylib loads live rather than inferring them from the binary alone.

Rationalizations to Reject

  • "It's signed and notarized, so it's safe." Signing proves origin, not safety, and says nothing about a dylib-hijack path or an XPC helper that trusts its caller's PID. Read the entitlements and load paths.
  • "class-dump returned almost nothing, the binary is stripped." That is the normal signature of a Swift binary. Switch to swift-demangle and the decompiler rather than concluding there is nothing to see.
  • "The helper checks the client PID, that's authentication." PID checks race and are spoofable. Only audit_token-based validation is sound; a PID check is the finding.
  • "Library validation will stop a malicious dylib." Only if it is enabled. Check for the disable-library-validation entitlement and hardened-runtime state before assuming the load is protected.
  • "This is just the iOS process on a Mac." The DRM, toolchain, and security model differ. Use analyzing-ios-binaries for FairPlay IPAs; this skill for the macOS app and its XPC/TCC/dylib surface.

References

  • analyzing-ios-binaries — iOS IPAs, FairPlay, and mobile toolchain
  • analyzing-binaries — general Mach-O triage and decompilation technique
  • exploiting-memory-corruption — exploiting a native bug found here
  • unpacking-protected-binaries — when the Mach-O is packed/encrypted first

常见问题

Analyzing Macos Binaries AI 技能有什么作用?

对 macOS 应用和 Mach-O 二进制文件进行逆向工程和安全审查,包括拆分通用二进制文件、还原 Objective-C/Swift 结构、读取代码签名权限和强化运行时信息,以及审计 XPC 服务、动态库加载路径和 TCC 隐私风险。分析 macOS 上的 .app 软件包或 Mach-O、检查权限和公证状态、查找动态库劫持或 XPC 权限漏洞,或分析 Gatekeeper 和隔离属性时使用。

为什么在 TypingMind 中使用 Analyzing Macos Binaries?

因为您只需安装一次,就能搭配任何模型使用。Analyzing Macos Binaries 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Analyzing Macos Binaries?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/trilwu/secskills/tree/main/secskills-core/skills/analyzing-macos-binaries。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Analyzing Macos Binaries?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Analyzing Macos Binaries 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Analyzing Macos Binaries 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Analyzing Macos Binaries AI 技能免费吗?

是的。trilwu 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇