Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计异常

macos-security-bypassmacOS 安全 bypass

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

5,936

周安装

255

GitHub Stars

349

下载量

2,081
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:macos-security-bypass(macOS 安全 bypass)
来源仓库:https://github.com/yaklang/hack-skills
仓库路径:skills/macos-security-bypass
安装命令:
npx skills add https://github.com/yaklang/hack-skills --skill macos-security-bypass
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yaklang/hack-skills --skill macos-security-bypass

简介

macOS 安全 bypass 用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。

  • 适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。
  • 使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时应先确认最小权限。
  • 需确认脱敏方式和操作边界,避免越权访问或误操作影响系统稳定性。
  • 该工具当前无额外说明,具体能力以来源仓库实现为准。

SKILL.md

SKILL: macOS Security Bypass — Expert Attack Playbook

AI LOAD INSTRUCTION: Expert macOS security bypass techniques. Covers TCC bypass, Gatekeeper evasion, SIP restrictions, sandbox escape, and entitlement abuse. Base models miss version-specific bypass nuances and protection interaction effects.

0. RELATED ROUTING

Before going deep, consider loading:

Advanced Reference

Also load TCC_BYPASS_MATRIX.md when you need:

  • Per-macOS-version TCC bypass mapping
  • Protection-type-specific techniques (Camera, Microphone, FDA, Automation)
  • MDM/configuration profile abuse patterns

1. TCC (TRANSPARENCY, CONSENT, CONTROL) OVERVIEW

TCC is macOS's permission framework controlling access to sensitive resources (camera, microphone, contacts, full disk access, etc.).

1.1 TCC Database Locations

DatabasePathControlsProtection
User-level~/Library/Application Support/com.apple.TCC/TCC.dbPer-user consent decisionsSIP-protected since Catalina
System-level/Library/Application Support/com.apple.TCC/TCC.dbSystem-wide consent decisionsSIP-protected
MDM-managedVia configuration profilesPush PPPC (Privacy Preferences Policy Control)Device management
-- Query TCC database (requires FDA or SIP off)
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
  "SELECT service, client, allowed FROM access;"

1.2 TCC Bypass Categories

CategoryMechanismTypical Prerequisite
FDA app exploitationPiggyback on apps already granted Full Disk AccessWrite access to FDA app's bundle or plugin dir
Direct DB modificationEdit TCC.db to grant consentSIP disabled or FDA
Inherited permissionsChild process inherits parent's TCC grantsCode execution in context of FDA-granted app
Automation abuseApple Events / osascript to control TCC-granted appAutomation permission (lower bar than direct TCC)
Mounting tricksMount a crafted disk image containing modified TCC.dbLocal access, pre-Ventura
SQL injection in TCCMalformed bundle IDs triggering SQL injection in TCC subsystemCVE-2023-32364 and similar

1.3 Known TCC Bypass Patterns

Terminal / iTerm FDA inheritance: Terminal.app granted FDA → any command run inherits FDA → read any file.

# If Terminal has FDA, this reads protected files directly
cat ~/Library/Mail/V*/MailData/Envelope\ Index
cat ~/Library/Messages/chat.db

Finder automation: Automate Finder (lower permission bar) to access files in protected locations.

tell application "Finder"
  set f to POSIX file "/Users/target/Library/Mail/V9/MailData/Envelope Index"
  duplicate f to desktop
end tell

System Preferences / System Settings injection: Inject into a process that already has TCC permissions by writing to its Application Scripts folder.

MDM profile abuse: PPPC profiles can pre-approve TCC permissions. Rogue MDM enrollment or compromised MDM server → push PPPC payload.


2. GATEKEEPER BYPASS

Gatekeeper blocks unsigned or unnotarized apps from executing. Core enforcement depends on the com.apple.quarantine extended attribute.

2.1 Quarantine Attribute Removal

# Check quarantine attribute
xattr -l /path/to/app
# Output: com.apple.quarantine: 0083;...

# Remove quarantine (requires write access)
xattr -d com.apple.quarantine /path/to/app
# Recursive for app bundles
xattr -rd com.apple.quarantine /path/to/MyApp.app

2.2 Bypass Techniques

TechniqueHow It WorksmacOS Version
xattr -d removalRemove quarantine before executionAll (requires local access)
App translocation bypassApps in certain locations skip translocationPre-Catalina
Archive tools that strip quarantineSome unarchiver apps don't propagate quarantineVaries by tool
Unsigned code in signed bundleNotarized app bundles with unsigned nested helpersPre-Ventura (CVE-2022-42821)
Safari auto-extract + openDownloaded ZIP auto-extracted, app opened before quarantine fully appliedSafari-specific, patched
ACL abusecom.apple.quarantine can be blocked by ACLs set before downloadRequires pre-positioning
Disk image (DMG) tricksDMG mounted from network share may not carry quarantineNetwork share context
BOM (Bill of Materials) bypassCrafted BOM in pkg skips quarantine for extracted filesCVE-2022-22616

2.3 Gatekeeper Check Flow

App launched
│
├── com.apple.quarantine attribute present?
│   ├── No → execute (no Gatekeeper check)
│   └── Yes ↓
│
├── Code signature valid?
│   ├── No → block
│   └── Yes ↓
│
├── Notarized (stapled ticket or online check)?
│   ├── No → block (Catalina+)
│   └── Yes → execute
│
└── User override? (right-click → Open → confirm)
    └── Bypasses Gatekeeper once for this app

3. SIP (SYSTEM INTEGRITY PROTECTION)

SIP restricts root from modifying protected system locations, loading unsigned kernel extensions, and debugging system processes.

3.1 SIP-Protected Locations

/System/
/usr/ (except /usr/local/)
/bin/
/sbin/
/var/ (selected subdirs)
/Applications/ (pre-installed Apple apps)

3.2 SIP Status & Configuration

csrutil status              # Check SIP status
csrutil disable             # Recovery Mode only
csrutil enable --without fs # Partial disable (risky)

3.3 Entitlements That Bypass SIP

EntitlementEffect
com.apple.rootless.installWrite to SIP-protected paths
com.apple.rootless.install.heritableChild processes inherit SIP bypass
com.apple.security.cs.allow-unsigned-executable-memoryJIT/unsigned code in memory
com.apple.private.security.clear-library-validationLoad unsigned libraries

3.4 Historical SIP Bypasses

CVEmacOSTechnique
CVE-2021-30892 (Shrootless)Monterey pre-12.0.1system_installd + post-install script in signed pkg
CVE-2022-22583Monterey pre-12.2packagekit + mount point manipulation
CVE-2022-46689 (MacDirtyCow)Ventura pre-13.1Race condition on copy-on-write, overwrite SIP files
CVE-2023-32369 (Migraine)Ventura pre-13.4Migration Assistant TCC/SIP bypass via systemmigrationd
CVE-2024-44243Sequoia pre-15.2StorageKit daemon exploitation

4. SANDBOX ESCAPE

macOS sandboxing (App Sandbox, via sandbox-exec or entitlements) restricts app access to filesystem, network, and IPC.

4.1 Office Sandbox Escape Patterns

VectorDescription
Open/Save dialog abuseUser grants file access via dialog → macro reads/writes beyond sandbox
~/Library/LaunchAgents/ persistenceSome sandbox profiles allow writing LaunchAgent plists
Login Items manipulationAdd login item pointing to payload outside sandbox
Shared container exploitationMultiple apps sharing the same App Group container

4.2 IPC-Based Escape

IPC MechanismEscape Vector
XPC ServicesConnect to privileged XPC service with insufficient client validation
Mach PortsObtain send right to privileged task port
Apple EventsAutomate unsandboxed app to perform actions
Distributed NotificationsSignal unsandboxed helper to execute payload
PasteboardWrite payload to pasteboard, have unsandboxed app consume it

4.3 Browser Sandbox

  • Chromium: Multi-process model, renderer is sandboxed, browser process is not
  • Safari: WebContent process sandboxed, parent Safari process has more privileges
  • Exploit chain: renderer RCE → sandbox escape (via IPC bug to browser process) → system access

5. CODE SIGNING & ENTITLEMENTS

5.1 Inspecting Signatures and Entitlements

codesign -dv --verbose=4 /path/to/app       # Signature details
codesign -d --entitlements :- /path/to/app   # Dump entitlements
security cms -D -i /path/to/mobileprovision  # Provisioning profile

# Verify signature validity
codesign --verify --deep --strict /path/to/app
spctl --assess --type execute /path/to/app   # Gatekeeper assessment

5.2 Entitlement Abuse for Privilege Escalation

EntitlementAbuse Scenario
com.apple.security.cs.disable-library-validationLoad attacker dylib into entitled process
com.apple.security.cs.allow-dyld-environment-variablesDYLD_INSERT_LIBRARIES injection
com.apple.security.get-task-allowAttach debugger, inject code
com.apple.security.cs.debuggerDebug any process
com.apple.private.apfs.revert-to-snapshotRevert APFS snapshots, bypass modifications

5.3 Hardened Runtime Bypass

Hardened Runtime prevents: DYLD env vars, debugging, unsigned memory execution. Bypasses:

  • Find entitled apps that weaken Hardened Runtime (disable-library-validation)
  • Exploit JIT-entitled apps (browsers, VMs) for unsigned code execution
  • Use get-task-allow entitled debug builds left in production

5.4 Library Validation Bypass

Library validation ensures only Apple-signed or same-team-signed dylibs load.

# Find apps with library validation disabled
codesign -d --entitlements :- /Applications/*.app/Contents/MacOS/* 2>/dev/null | \
  grep -l "disable-library-validation"

6. PERSISTENCE AFTER BYPASS

MethodLocationSurvives RebootNotes
LaunchAgent~/Library/LaunchAgents/YesUser-level, runs at login
LaunchDaemon/Library/LaunchDaemons/YesRoot-level, runs at boot
Login Items~/Library/Application Support/com.apple.backgroundtaskmanagementagent/YesVisible in System Settings
Croncrontab -eYesOften overlooked by defenders
Dylib hijackWritable dylib search pathYesTriggered when target app launches
Folder Action~/Library/Scripts/Folder Action Scripts/YesTriggers on folder events

7. macOS SECURITY BYPASS DECISION TREE

Target is macOS endpoint
│
├── Need to execute untrusted binary?
│   ├── Quarantine attribute present?
│   │   ├── Yes → xattr -d com.apple.quarantine (§2.1)
│   │   └── No → execute directly
│   └── Gatekeeper still blocks?
│       ├── Signed but not notarized → right-click → Open override
│       └── Unsigned → embed in signed bundle or use archive tricks (§2.2)
│
├── Need access to TCC-protected resources?
│   ├── FDA-granted app available?
│   │   ├── Yes → exploit FDA app context (§1.3)
│   │   └── No ↓
│   ├── Automation permission obtainable?
│   │   ├── Yes → Apple Events to TCC-granted app (§1.3)
│   │   └── No ↓
│   ├── SIP disabled?
│   │   ├── Yes → direct TCC.db modification (§1.2)
│   │   └── No → check version-specific TCC bypass (→ TCC_BYPASS_MATRIX.md)
│   └── MDM present?
│       └── Compromised MDM → push PPPC profile (§1.3)
│
├── Need to bypass SIP?
│   ├── Check macOS version → historical SIP CVE? (§3.4)
│   ├── Find entitled Apple binary → piggyback SIP-bypass entitlement (§3.3)
│   └── Recovery Mode access? → csrutil disable (§3.2)
│
├── Need sandbox escape?
│   ├── Office macro context → dialog/LaunchAgent tricks (§4.1)
│   ├── XPC service with weak validation → IPC escape (§4.2)
│   └── Browser context → renderer → sandbox escape chain (§4.3)
│
├── Need to inject into signed process?
│   ├── disable-library-validation entitlement? → dylib injection
│   ├── allow-dyld-environment-variables? → DYLD_INSERT_LIBRARIES
│   ├── get-task-allow? → debugger attach
│   └── None → check macos-process-injection SKILL.md
│
└── Need persistence?
    └── Choose method by access level (§6)

8. QUICK REFERENCE: TOOL COMMANDS

# Enumerate TCC permissions
tccutil reset All                              # Reset all TCC (admin)
sqlite3 TCC.db "SELECT * FROM access;"         # Read TCC DB

# Gatekeeper status
spctl --status                                 # Gatekeeper enabled?
spctl --assess -v /path/to/app                 # Check app assessment

# SIP status
csrutil status

# Find interesting entitlements across system
find /System/Applications /Applications -name "*.app" -exec sh -c \
  'codesign -d --entitlements :- "$1" 2>/dev/null | grep -q "disable-library-validation" && echo "$1"' _ {} \;

# List loaded kexts (kernel extensions)
kextstat | grep -v com.apple

# Sandbox profile inspection
sandbox-exec -p "(version 1)(allow default)" /bin/ls  # Test sandbox rules

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.93%
按下载量换算748

Claude

31.36%
按下载量换算653

Cursor

16.83%
按下载量换算350

Gemini CLI

8.58%
按下载量换算179

安全审计

Gen Agent Trust Hub

未通过

Socket

未通过

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills