ineedcodes 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +47 -11
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: macos-security-bypass
|
|
3
|
+
description: >-
|
|
4
|
+
macOS security bypass playbook. Use when targeting macOS endpoints and need to bypass TCC, Gatekeeper, SIP, sandbox, code signing, or entitlement-based protections during authorized red team or pentest engagements.gated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL: macOS Security Bypass — Expert Attack Playbook
|
|
8
|
+
|
|
9
|
+
> **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.
|
|
10
|
+
|
|
11
|
+
## 0. RELATED ROUTING
|
|
12
|
+
|
|
13
|
+
Before going deep, consider loading:
|
|
14
|
+
|
|
15
|
+
- [macos-process-injection](../macos-process-injection/SKILL.md) when you need dylib injection, XPC exploitation, or Electron abuse after achieving initial access
|
|
16
|
+
- [linux-privilege-escalation](../linux-privilege-escalation/SKILL.md) for Unix-layer privesc techniques that also apply to macOS (SUID, cron, writable paths)
|
|
17
|
+
- [linux-security-bypass](../linux-security-bypass/SKILL.md) for shared Unix security bypass concepts
|
|
18
|
+
|
|
19
|
+
### Advanced Reference
|
|
20
|
+
|
|
21
|
+
Also load [TCC_BYPASS_MATRIX.md](./TCC_BYPASS_MATRIX.md) when you need:
|
|
22
|
+
- Per-macOS-version TCC bypass mapping
|
|
23
|
+
- Protection-type-specific techniques (Camera, Microphone, FDA, Automation)
|
|
24
|
+
- MDM/configuration profile abuse patterns
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. TCC (TRANSPARENCY, CONSENT, CONTROL) OVERVIEW
|
|
29
|
+
|
|
30
|
+
TCC is macOS's permission framework controlling access to sensitive resources (camera, microphone, contacts, full disk access, etc.).
|
|
31
|
+
|
|
32
|
+
### 1.1 TCC Database Locations
|
|
33
|
+
|
|
34
|
+
| Database | Path | Controls | Protection |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| User-level | `~/Library/Application Support/com.apple.TCC/TCC.db` | Per-user consent decisions | SIP-protected since Catalina |
|
|
37
|
+
| System-level | `/Library/Application Support/com.apple.TCC/TCC.db` | System-wide consent decisions | SIP-protected |
|
|
38
|
+
| MDM-managed | Via configuration profiles | Push PPPC (Privacy Preferences Policy Control) | Device management |
|
|
39
|
+
|
|
40
|
+
```sql
|
|
41
|
+
-- Query TCC database (requires FDA or SIP off)
|
|
42
|
+
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
|
|
43
|
+
"SELECT service, client, allowed FROM access;"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 1.2 TCC Bypass Categories
|
|
47
|
+
|
|
48
|
+
| Category | Mechanism | Typical Prerequisite |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| FDA app exploitation | Piggyback on apps already granted Full Disk Access | Write access to FDA app's bundle or plugin dir |
|
|
51
|
+
| Direct DB modification | Edit TCC.db to grant consent | SIP disabled or FDA |
|
|
52
|
+
| Inherited permissions | Child process inherits parent's TCC grants | Code execution in context of FDA-granted app |
|
|
53
|
+
| Automation abuse | Apple Events / osascript to control TCC-granted app | Automation permission (lower bar than direct TCC) |
|
|
54
|
+
| Mounting tricks | Mount a crafted disk image containing modified TCC.db | Local access, pre-Ventura |
|
|
55
|
+
| SQL injection in TCC | Malformed bundle IDs triggering SQL injection in TCC subsystem | CVE-2023-32364 and similar |
|
|
56
|
+
|
|
57
|
+
### 1.3 Known TCC Bypass Patterns
|
|
58
|
+
|
|
59
|
+
**Terminal / iTerm FDA inheritance**: Terminal.app granted FDA → any command run inherits FDA → read any file.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# If Terminal has FDA, this reads protected files directly
|
|
63
|
+
cat ~/Library/Mail/V*/MailData/Envelope\ Index
|
|
64
|
+
cat ~/Library/Messages/chat.db
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Finder automation**: Automate Finder (lower permission bar) to access files in protected locations.
|
|
68
|
+
|
|
69
|
+
```applescript
|
|
70
|
+
tell application "Finder"
|
|
71
|
+
set f to POSIX file "/Users/target/Library/Mail/V9/MailData/Envelope Index"
|
|
72
|
+
duplicate f to desktop
|
|
73
|
+
end tell
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**System Preferences / System Settings injection**: Inject into a process that already has TCC permissions by writing to its Application Scripts folder.
|
|
77
|
+
|
|
78
|
+
**MDM profile abuse**: PPPC profiles can pre-approve TCC permissions. Rogue MDM enrollment or compromised MDM server → push PPPC payload.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 2. GATEKEEPER BYPASS
|
|
83
|
+
|
|
84
|
+
Gatekeeper blocks unsigned or unnotarized apps from executing. Core enforcement depends on the `com.apple.quarantine` extended attribute.
|
|
85
|
+
|
|
86
|
+
### 2.1 Quarantine Attribute Removal
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Check quarantine attribute
|
|
90
|
+
xattr -l /path/to/app
|
|
91
|
+
# Output: com.apple.quarantine: 0083;...
|
|
92
|
+
|
|
93
|
+
# Remove quarantine (requires write access)
|
|
94
|
+
xattr -d com.apple.quarantine /path/to/app
|
|
95
|
+
# Recursive for app bundles
|
|
96
|
+
xattr -rd com.apple.quarantine /path/to/MyApp.app
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 2.2 Bypass Techniques
|
|
100
|
+
|
|
101
|
+
| Technique | How It Works | macOS Version |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `xattr -d` removal | Remove quarantine before execution | All (requires local access) |
|
|
104
|
+
| App translocation bypass | Apps in certain locations skip translocation | Pre-Catalina |
|
|
105
|
+
| Archive tools that strip quarantine | Some unarchiver apps don't propagate quarantine | Varies by tool |
|
|
106
|
+
| Unsigned code in signed bundle | Notarized app bundles with unsigned nested helpers | Pre-Ventura (CVE-2022-42821) |
|
|
107
|
+
| Safari auto-extract + open | Downloaded ZIP auto-extracted, app opened before quarantine fully applied | Safari-specific, patched |
|
|
108
|
+
| ACL abuse | `com.apple.quarantine` can be blocked by ACLs set before download | Requires pre-positioning |
|
|
109
|
+
| Disk image (DMG) tricks | DMG mounted from network share may not carry quarantine | Network share context |
|
|
110
|
+
| BOM (Bill of Materials) bypass | Crafted BOM in pkg skips quarantine for extracted files | CVE-2022-22616 |
|
|
111
|
+
|
|
112
|
+
### 2.3 Gatekeeper Check Flow
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
App launched
|
|
116
|
+
│
|
|
117
|
+
├── com.apple.quarantine attribute present?
|
|
118
|
+
│ ├── No → execute (no Gatekeeper check)
|
|
119
|
+
│ └── Yes ↓
|
|
120
|
+
│
|
|
121
|
+
├── Code signature valid?
|
|
122
|
+
│ ├── No → block
|
|
123
|
+
│ └── Yes ↓
|
|
124
|
+
│
|
|
125
|
+
├── Notarized (stapled ticket or online check)?
|
|
126
|
+
│ ├── No → block (Catalina+)
|
|
127
|
+
│ └── Yes → execute
|
|
128
|
+
│
|
|
129
|
+
└── User override? (right-click → Open → confirm)
|
|
130
|
+
└── Bypasses Gatekeeper once for this app
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 3. SIP (SYSTEM INTEGRITY PROTECTION)
|
|
136
|
+
|
|
137
|
+
SIP restricts root from modifying protected system locations, loading unsigned kernel extensions, and debugging system processes.
|
|
138
|
+
|
|
139
|
+
### 3.1 SIP-Protected Locations
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
/System/
|
|
143
|
+
/usr/ (except /usr/local/)
|
|
144
|
+
/bin/
|
|
145
|
+
/sbin/
|
|
146
|
+
/var/ (selected subdirs)
|
|
147
|
+
/Applications/ (pre-installed Apple apps)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 3.2 SIP Status & Configuration
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
csrutil status # Check SIP status
|
|
154
|
+
csrutil disable # Recovery Mode only
|
|
155
|
+
csrutil enable --without fs # Partial disable (risky)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 3.3 Entitlements That Bypass SIP
|
|
159
|
+
|
|
160
|
+
| Entitlement | Effect |
|
|
161
|
+
|---|---|
|
|
162
|
+
| `com.apple.rootless.install` | Write to SIP-protected paths |
|
|
163
|
+
| `com.apple.rootless.install.heritable` | Child processes inherit SIP bypass |
|
|
164
|
+
| `com.apple.security.cs.allow-unsigned-executable-memory` | JIT/unsigned code in memory |
|
|
165
|
+
| `com.apple.private.security.clear-library-validation` | Load unsigned libraries |
|
|
166
|
+
|
|
167
|
+
### 3.4 Historical SIP Bypasses
|
|
168
|
+
|
|
169
|
+
| CVE | macOS | Technique |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| CVE-2021-30892 (Shrootless) | Monterey pre-12.0.1 | `system_installd` + post-install script in signed pkg |
|
|
172
|
+
| CVE-2022-22583 | Monterey pre-12.2 | `packagekit` + mount point manipulation |
|
|
173
|
+
| CVE-2022-46689 (MacDirtyCow) | Ventura pre-13.1 | Race condition on copy-on-write, overwrite SIP files |
|
|
174
|
+
| CVE-2023-32369 (Migraine) | Ventura pre-13.4 | Migration Assistant TCC/SIP bypass via systemmigrationd |
|
|
175
|
+
| CVE-2024-44243 | Sequoia pre-15.2 | StorageKit daemon exploitation |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 4. SANDBOX ESCAPE
|
|
180
|
+
|
|
181
|
+
macOS sandboxing (App Sandbox, via `sandbox-exec` or entitlements) restricts app access to filesystem, network, and IPC.
|
|
182
|
+
|
|
183
|
+
### 4.1 Office Sandbox Escape Patterns
|
|
184
|
+
|
|
185
|
+
| Vector | Description |
|
|
186
|
+
|---|---|
|
|
187
|
+
| Open/Save dialog abuse | User grants file access via dialog → macro reads/writes beyond sandbox |
|
|
188
|
+
| `~/Library/LaunchAgents/` persistence | Some sandbox profiles allow writing LaunchAgent plists |
|
|
189
|
+
| Login Items manipulation | Add login item pointing to payload outside sandbox |
|
|
190
|
+
| Shared container exploitation | Multiple apps sharing the same App Group container |
|
|
191
|
+
|
|
192
|
+
### 4.2 IPC-Based Escape
|
|
193
|
+
|
|
194
|
+
| IPC Mechanism | Escape Vector |
|
|
195
|
+
|---|---|
|
|
196
|
+
| XPC Services | Connect to privileged XPC service with insufficient client validation |
|
|
197
|
+
| Mach Ports | Obtain send right to privileged task port |
|
|
198
|
+
| Apple Events | Automate unsandboxed app to perform actions |
|
|
199
|
+
| Distributed Notifications | Signal unsandboxed helper to execute payload |
|
|
200
|
+
| Pasteboard | Write payload to pasteboard, have unsandboxed app consume it |
|
|
201
|
+
|
|
202
|
+
### 4.3 Browser Sandbox
|
|
203
|
+
|
|
204
|
+
- Chromium: Multi-process model, renderer is sandboxed, browser process is not
|
|
205
|
+
- Safari: WebContent process sandboxed, parent Safari process has more privileges
|
|
206
|
+
- Exploit chain: renderer RCE → sandbox escape (via IPC bug to browser process) → system access
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 5. CODE SIGNING & ENTITLEMENTS
|
|
211
|
+
|
|
212
|
+
### 5.1 Inspecting Signatures and Entitlements
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
codesign -dv --verbose=4 /path/to/app # Signature details
|
|
216
|
+
codesign -d --entitlements :- /path/to/app # Dump entitlements
|
|
217
|
+
security cms -D -i /path/to/mobileprovision # Provisioning profile
|
|
218
|
+
|
|
219
|
+
# Verify signature validity
|
|
220
|
+
codesign --verify --deep --strict /path/to/app
|
|
221
|
+
spctl --assess --type execute /path/to/app # Gatekeeper assessment
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 5.2 Entitlement Abuse for Privilege Escalation
|
|
225
|
+
|
|
226
|
+
| Entitlement | Abuse Scenario |
|
|
227
|
+
|---|---|
|
|
228
|
+
| `com.apple.security.cs.disable-library-validation` | Load attacker dylib into entitled process |
|
|
229
|
+
| `com.apple.security.cs.allow-dyld-environment-variables` | DYLD_INSERT_LIBRARIES injection |
|
|
230
|
+
| `com.apple.security.get-task-allow` | Attach debugger, inject code |
|
|
231
|
+
| `com.apple.security.cs.debugger` | Debug any process |
|
|
232
|
+
| `com.apple.private.apfs.revert-to-snapshot` | Revert APFS snapshots, bypass modifications |
|
|
233
|
+
|
|
234
|
+
### 5.3 Hardened Runtime Bypass
|
|
235
|
+
|
|
236
|
+
Hardened Runtime prevents: DYLD env vars, debugging, unsigned memory execution. Bypasses:
|
|
237
|
+
- Find entitled apps that weaken Hardened Runtime (`disable-library-validation`)
|
|
238
|
+
- Exploit JIT-entitled apps (browsers, VMs) for unsigned code execution
|
|
239
|
+
- Use `get-task-allow` entitled debug builds left in production
|
|
240
|
+
|
|
241
|
+
### 5.4 Library Validation Bypass
|
|
242
|
+
|
|
243
|
+
Library validation ensures only Apple-signed or same-team-signed dylibs load.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
# Find apps with library validation disabled
|
|
247
|
+
codesign -d --entitlements :- /Applications/*.app/Contents/MacOS/* 2>/dev/null | \
|
|
248
|
+
grep -l "disable-library-validation"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 6. PERSISTENCE AFTER BYPASS
|
|
254
|
+
|
|
255
|
+
| Method | Location | Survives Reboot | Notes |
|
|
256
|
+
|---|---|---|---|
|
|
257
|
+
| LaunchAgent | `~/Library/LaunchAgents/` | Yes | User-level, runs at login |
|
|
258
|
+
| LaunchDaemon | `/Library/LaunchDaemons/` | Yes | Root-level, runs at boot |
|
|
259
|
+
| Login Items | `~/Library/Application Support/com.apple.backgroundtaskmanagementagent/` | Yes | Visible in System Settings |
|
|
260
|
+
| Cron | `crontab -e` | Yes | Often overlooked by defenders |
|
|
261
|
+
| Dylib hijack | Writable dylib search path | Yes | Triggered when target app launches |
|
|
262
|
+
| Folder Action | `~/Library/Scripts/Folder Action Scripts/` | Yes | Triggers on folder events |
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 7. macOS SECURITY BYPASS DECISION TREE
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
Target is macOS endpoint
|
|
270
|
+
│
|
|
271
|
+
├── Need to execute untrusted binary?
|
|
272
|
+
│ ├── Quarantine attribute present?
|
|
273
|
+
│ │ ├── Yes → xattr -d com.apple.quarantine (§2.1)
|
|
274
|
+
│ │ └── No → execute directly
|
|
275
|
+
│ └── Gatekeeper still blocks?
|
|
276
|
+
│ ├── Signed but not notarized → right-click → Open override
|
|
277
|
+
│ └── Unsigned → embed in signed bundle or use archive tricks (§2.2)
|
|
278
|
+
│
|
|
279
|
+
├── Need access to TCC-protected resources?
|
|
280
|
+
│ ├── FDA-granted app available?
|
|
281
|
+
│ │ ├── Yes → exploit FDA app context (§1.3)
|
|
282
|
+
│ │ └── No ↓
|
|
283
|
+
│ ├── Automation permission obtainable?
|
|
284
|
+
│ │ ├── Yes → Apple Events to TCC-granted app (§1.3)
|
|
285
|
+
│ │ └── No ↓
|
|
286
|
+
│ ├── SIP disabled?
|
|
287
|
+
│ │ ├── Yes → direct TCC.db modification (§1.2)
|
|
288
|
+
│ │ └── No → check version-specific TCC bypass (→ TCC_BYPASS_MATRIX.md)
|
|
289
|
+
│ └── MDM present?
|
|
290
|
+
│ └── Compromised MDM → push PPPC profile (§1.3)
|
|
291
|
+
│
|
|
292
|
+
├── Need to bypass SIP?
|
|
293
|
+
│ ├── Check macOS version → historical SIP CVE? (§3.4)
|
|
294
|
+
│ ├── Find entitled Apple binary → piggyback SIP-bypass entitlement (§3.3)
|
|
295
|
+
│ └── Recovery Mode access? → csrutil disable (§3.2)
|
|
296
|
+
│
|
|
297
|
+
├── Need sandbox escape?
|
|
298
|
+
│ ├── Office macro context → dialog/LaunchAgent tricks (§4.1)
|
|
299
|
+
│ ├── XPC service with weak validation → IPC escape (§4.2)
|
|
300
|
+
│ └── Browser context → renderer → sandbox escape chain (§4.3)
|
|
301
|
+
│
|
|
302
|
+
├── Need to inject into signed process?
|
|
303
|
+
│ ├── disable-library-validation entitlement? → dylib injection
|
|
304
|
+
│ ├── allow-dyld-environment-variables? → DYLD_INSERT_LIBRARIES
|
|
305
|
+
│ ├── get-task-allow? → debugger attach
|
|
306
|
+
│ └── None → check macos-process-injection SKILL.md
|
|
307
|
+
│
|
|
308
|
+
└── Need persistence?
|
|
309
|
+
└── Choose method by access level (§6)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 8. QUICK REFERENCE: TOOL COMMANDS
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
# Enumerate TCC permissions
|
|
318
|
+
tccutil reset All # Reset all TCC (admin)
|
|
319
|
+
sqlite3 TCC.db "SELECT * FROM access;" # Read TCC DB
|
|
320
|
+
|
|
321
|
+
# Gatekeeper status
|
|
322
|
+
spctl --status # Gatekeeper enabled?
|
|
323
|
+
spctl --assess -v /path/to/app # Check app assessment
|
|
324
|
+
|
|
325
|
+
# SIP status
|
|
326
|
+
csrutil status
|
|
327
|
+
|
|
328
|
+
# Find interesting entitlements across system
|
|
329
|
+
find /System/Applications /Applications -name "*.app" -exec sh -c \
|
|
330
|
+
'codesign -d --entitlements :- "$1" 2>/dev/null | grep -q "disable-library-validation" && echo "$1"' _ {} \;
|
|
331
|
+
|
|
332
|
+
# List loaded kexts (kernel extensions)
|
|
333
|
+
kextstat | grep -v com.apple
|
|
334
|
+
|
|
335
|
+
# Sandbox profile inspection
|
|
336
|
+
sandbox-exec -p "(version 1)(allow default)" /bin/ls # Test sandbox rules
|
|
337
|
+
```
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# TCC Bypass Matrix — Per-Version & Per-Protection Techniques
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this when you need version-specific TCC bypass details, protection-type-specific techniques, or MDM/PPPC abuse patterns. Assumes the main [SKILL.md](./SKILL.md) is already loaded for TCC fundamentals.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. TCC BYPASS BY macOS VERSION
|
|
8
|
+
|
|
9
|
+
### 1.1 Mojave (10.14)
|
|
10
|
+
|
|
11
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| SSH TCC bypass | FDA | SSH into localhost inherits FDA of Terminal |
|
|
14
|
+
| Finder scripting | File access | AppleScript controls Finder without TCC prompt |
|
|
15
|
+
| Direct TCC.db edit | All | User TCC.db modifiable without SIP restriction |
|
|
16
|
+
| `tccutil` manipulation | All | Programmatic TCC reset and grant |
|
|
17
|
+
|
|
18
|
+
### 1.2 Catalina (10.15)
|
|
19
|
+
|
|
20
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| TCC.db moved under SIP | — | Direct edit now blocked (defense improvement) |
|
|
23
|
+
| Mount trick | FDA | Mount disk image with crafted TCC.db over user's |
|
|
24
|
+
| Environment variable injection | Varies | Inject into entitled processes via env vars |
|
|
25
|
+
| CVE-2020-9934 | All | TCC.db race condition during profile migration |
|
|
26
|
+
| Inetloc file handler | Automation | `.inetloc` file triggers app without quarantine check |
|
|
27
|
+
|
|
28
|
+
### 1.3 Big Sur (11.x)
|
|
29
|
+
|
|
30
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| CVE-2021-30713 | All | XCSSET malware: forge synthetic clicks via `screencapture` |
|
|
33
|
+
| CVE-2021-30970 | FDA | `com.apple.systempreferences` injection via scripts dir |
|
|
34
|
+
| Accessibility API abuse | Accessibility | Entitled process → inject into Accessibility-granted app |
|
|
35
|
+
| Signed System Volume (SSV) | — | Volume seal limits modification (defense improvement) |
|
|
36
|
+
|
|
37
|
+
### 1.4 Monterey (12.x)
|
|
38
|
+
|
|
39
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| CVE-2022-22583 | FDA | `PackageKit` framework exploitation |
|
|
42
|
+
| CVE-2021-30892 (Shrootless) | SIP + TCC | `system_installd` post-install script in signed pkg |
|
|
43
|
+
| CVE-2022-32900 | Automation | Shortcut app can be abused for automation without consent |
|
|
44
|
+
| Python/Perl TCC inheritance | FDA | Script interpreters inherit calling app's TCC |
|
|
45
|
+
| Background Task Management Agent | Persistence | New `BTM` visibility (defense improvement) |
|
|
46
|
+
|
|
47
|
+
### 1.5 Ventura (13.x)
|
|
48
|
+
|
|
49
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| CVE-2023-32369 (Migraine) | SIP + TCC | `systemmigrationd` abuse during Migration Assistant |
|
|
52
|
+
| CVE-2023-32364 | FDA | SQL injection in TCC subsystem via crafted bundle ID |
|
|
53
|
+
| CVE-2023-38571 | FDA | Archive Utility bypass — files extracted without quarantine |
|
|
54
|
+
| CVE-2022-46689 (MacDirtyCow) | All | COW race condition to overwrite SIP-protected TCC.db |
|
|
55
|
+
| Login Items notification | — | Users notified of new Login Items (defense improvement) |
|
|
56
|
+
|
|
57
|
+
### 1.6 Sonoma (14.x)
|
|
58
|
+
|
|
59
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| CVE-2024-44133 (HM Surf) | Camera, Mic, Location | Safari TCC bypass via `dscl` user home dir manipulation |
|
|
62
|
+
| CVE-2024-44131 | FDA | `FileProvider` symlink race condition |
|
|
63
|
+
| Third-party app FDA exploitation | FDA | Piggyback on third-party app's pre-existing FDA grant |
|
|
64
|
+
| App Management protection | — | New protection for app modification (defense improvement) |
|
|
65
|
+
|
|
66
|
+
### 1.7 Sequoia (15.x)
|
|
67
|
+
|
|
68
|
+
| CVE / Technique | Bypassed Protection | Method |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| CVE-2024-44243 | SIP + TCC | StorageKit daemon exploitation for SIP bypass |
|
|
71
|
+
| CVE-2025-24086 | FDA | CoreMedia framework exploitation |
|
|
72
|
+
| Consent prompt for screen recording | — | Weekly re-consent for screen recording (defense improvement) |
|
|
73
|
+
| Network extension prompt changes | — | Tighter notification for network extensions |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 2. TCC BYPASS BY PROTECTION TYPE
|
|
78
|
+
|
|
79
|
+
### 2.1 Camera & Microphone
|
|
80
|
+
|
|
81
|
+
| Technique | Requirements | Notes |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| Exploit Camera-granted app | Code execution in granted app | Zoom, Teams, FaceTime all have Camera TCC |
|
|
84
|
+
| Safari HM Surf (CVE-2024-44133) | Safari-specific bypass | Manipulate user home directory config |
|
|
85
|
+
| XPC to VDCAssistant/coreaudiod | Privileged IPC | Camera/audio daemons |
|
|
86
|
+
| Virtual camera/mic injection | Kernel extension or DriverKit | Inject virtual device at driver level |
|
|
87
|
+
|
|
88
|
+
### 2.2 Full Disk Access (FDA)
|
|
89
|
+
|
|
90
|
+
| Technique | Requirements | Notes |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| Terminal/iTerm inheritance | Terminal app has FDA | All child processes inherit FDA |
|
|
93
|
+
| Backup software exploitation | Backup apps (CCC, Time Machine) granted FDA | Common in enterprise |
|
|
94
|
+
| MDM agent exploitation | MDM agent with FDA | Jamf, Mosyle, Kandji, etc. |
|
|
95
|
+
| SSH localhost | FDA-granted Terminal + SSH enabled | SSH session inherits FDA |
|
|
96
|
+
| Script interpreter inheritance | Python/Ruby/Perl run from FDA context | Interpreter inherits grants |
|
|
97
|
+
|
|
98
|
+
### 2.3 Automation (Apple Events)
|
|
99
|
+
|
|
100
|
+
| Technique | Requirements | Notes |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| osascript to Finder | Automation→Finder permission (lower bar) | Move, copy, read files via Finder |
|
|
103
|
+
| System Events scripting | Automation→System Events | UI scripting, keystroke injection |
|
|
104
|
+
| Terminal `do script` | Automation→Terminal | Run commands in Terminal context |
|
|
105
|
+
| Calendar alert exploit | Calendar event with alert action | Execute script on trigger |
|
|
106
|
+
|
|
107
|
+
### 2.4 Location Services
|
|
108
|
+
|
|
109
|
+
| Technique | Requirements | Notes |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| CoreLocation via entitled app | Exploit app with Location permission | Weather, Maps |
|
|
112
|
+
| Wi-Fi SSID for location inference | Network access (no TCC required) | Correlate SSID with location databases |
|
|
113
|
+
|
|
114
|
+
### 2.5 Screen Recording / Screen Capture
|
|
115
|
+
|
|
116
|
+
| Technique | Requirements | Notes |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| `screencapture` via entitled process | Exploit process with Screen Recording TCC | Zoom, Teams desktop agents |
|
|
119
|
+
| CGWindowListCreateImage without TCC | Pre-Catalina only | API deprecated for privacy |
|
|
120
|
+
| Window server exploitation | Privileged access | `WindowServer` process has inherent screen access |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 3. MDM / PPPC PROFILE ABUSE
|
|
125
|
+
|
|
126
|
+
### 3.1 PPPC (Privacy Preferences Policy Control) Profiles
|
|
127
|
+
|
|
128
|
+
MDM-managed devices can push PPPC profiles that pre-approve TCC permissions without user consent.
|
|
129
|
+
|
|
130
|
+
```xml
|
|
131
|
+
<!-- Example PPPC payload granting FDA to a bundle -->
|
|
132
|
+
<dict>
|
|
133
|
+
<key>Authorization</key>
|
|
134
|
+
<string>AllowStandardUserToSetSystemService</string>
|
|
135
|
+
<key>CodeRequirement</key>
|
|
136
|
+
<string>identifier "com.attacker.tool" and anchor apple generic</string>
|
|
137
|
+
<key>IdentifierType</key>
|
|
138
|
+
<string>bundleID</string>
|
|
139
|
+
<key>Identifier</key>
|
|
140
|
+
<string>com.attacker.tool</string>
|
|
141
|
+
<key>Services</key>
|
|
142
|
+
<dict>
|
|
143
|
+
<key>SystemPolicyAllFiles</key>
|
|
144
|
+
<dict>
|
|
145
|
+
<key>Authorization</key>
|
|
146
|
+
<string>Allow</string>
|
|
147
|
+
</dict>
|
|
148
|
+
</dict>
|
|
149
|
+
</dict>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3.2 Attack Vectors
|
|
153
|
+
|
|
154
|
+
| Vector | Description |
|
|
155
|
+
|---|---|
|
|
156
|
+
| Rogue MDM enrollment | Social engineering user to enroll in attacker-controlled MDM |
|
|
157
|
+
| Compromised MDM server | Exploit Jamf Pro, Mosyle, Kandji, etc. to push malicious profiles |
|
|
158
|
+
| Profile injection via local admin | `profiles install -path /path/to/profile.mobileconfig` (requires admin or MDM) |
|
|
159
|
+
| Inherited enrollment | Device sold/transferred with MDM enrollment still active |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 4. TCC INSPECTION & RECONNAISSANCE
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# List all TCC databases accessible
|
|
167
|
+
find / -name "TCC.db" 2>/dev/null
|
|
168
|
+
|
|
169
|
+
# Dump user TCC (requires FDA or SIP off)
|
|
170
|
+
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
|
|
171
|
+
"SELECT service, client, client_type, auth_value, auth_reason FROM access;"
|
|
172
|
+
|
|
173
|
+
# auth_value meanings
|
|
174
|
+
# 0 = denied, 1 = unknown, 2 = allowed, 3 = limited
|
|
175
|
+
|
|
176
|
+
# List apps with specific TCC grants
|
|
177
|
+
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
|
|
178
|
+
"SELECT client FROM access WHERE service='kTCCServiceSystemPolicyAllFiles' AND auth_value=2;"
|
|
179
|
+
|
|
180
|
+
# Check effective TCC for a running process
|
|
181
|
+
# (no direct API — must infer from TCC.db + entitlements + code signature)
|
|
182
|
+
|
|
183
|
+
# Enumerate entitlements of all running processes
|
|
184
|
+
ps -eo pid,comm | while read pid comm; do
|
|
185
|
+
codesign -d --entitlements :- "$comm" 2>/dev/null
|
|
186
|
+
done
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 5. DEFENSE & DETECTION
|
|
192
|
+
|
|
193
|
+
| Indicator | Detection Method |
|
|
194
|
+
|---|---|
|
|
195
|
+
| TCC.db access from unexpected process | Endpoint telemetry (ES_EVENT_TYPE_NOTIFY_OPEN on TCC.db) |
|
|
196
|
+
| `xattr -d` on quarantine | File integrity monitoring |
|
|
197
|
+
| AppleScript to sensitive apps | Audit Apple Events via Endpoint Security |
|
|
198
|
+
| New LaunchAgents/LaunchDaemons | Monitor `~/Library/LaunchAgents/` and `/Library/LaunchDaemons/` |
|
|
199
|
+
| MDM profile installation | Alert on unexpected profile additions |
|
|
200
|
+
| `csrutil disable` | Monitor SIP status changes at boot |
|