401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
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.
$ npx -y skills add yaklang/hack-skills --skill macos-security-bypass --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/macos-security-bypassContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: macos-security-bypass description: >- 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.
> **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.
Before going deep, consider loading:
Also load [TCC_BYPASS_MATRIX.md](./TCC_BYPASS_MATRIX.md) when you need:
---
TCC is macOS's permission framework controlling access to sensitive resources (camera, microphone, contacts, full disk access, etc.).
| Database | Path | Controls | Protection | |---|---|---|---| | User-level | `~/Library/Application Support/com.apple.TCC/TCC.db` | Per-user consent decisions | SIP-protected since Catalina | | System-level | `/Library/Application Support/com.apple.TCC/TCC.db` | System-wide consent decisions | SIP-protected | | MDM-managed | Via configuration profiles | Push 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;"
| Category | Mechanism | Typical Prerequisite | |---|---|---| | FDA app exploitation | Piggyback on apps already granted Full Disk Access | Write access to FDA app's bundle or plugin dir | | Direct DB modification | Edit TCC.db to grant consent | SIP disabled or FDA | | Inherited permissions | Child process inherits parent's TCC grants | Code execution in context of FDA-granted app | | Automation abuse | Apple Events / osascript to control TCC-granted app | Automation permission (lower bar than direct TCC) | | Mounting tricks | Mount a crafted disk image containing modified TCC.db | Local access, pre-Ventura | | SQL injection in TCC | Malformed bundle IDs triggering SQL injection in TCC subsystem | CVE-2023-32364 and similar |
**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.
---
Gatekeeper blocks unsigned or unnotarized apps from executing. Core enforcement depends on the `com.apple.quarantine` extended attribute.
# 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
| Technique | How It Works | macOS Version | |---|---|---| | `xattr -d` removal | Remove quarantine before execution | All (requires local access) | | App translocation bypass | Apps in certain locations skip translocation | Pre-Catalina | | Archive tools that strip quarantine | Some unarchiver apps don't propagate quarantine | Varies by tool | | Unsigned code in signed bundle | Notarized app bundles with unsigned nested helpers | Pre-Ventura (CVE-2022-42821) | | Safari auto-extract + open | Downloaded ZIP auto-extracted, app opened before quarantine fully applied | Safari-specific, patched | | ACL abuse | `com.apple.quarantine` can be blocked by ACLs set before download | Requires pre-positioning | | Disk image (DMG) tricks | DMG mounted from network share may not carry quarantine | Network share context | | BOM (Bill of Materials) bypass | Crafted BOM in pkg skips quarantine for extracted files | CVE-2022-22616 |
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---
SIP restricts root from modifying protected system locations, loading unsigned kernel extensions, and debugging system processes.
/System/ /usr/ (except /usr/local/) /bin/ /sbin/ /var/ (selected subdirs) /Applications/ (pre-installed Apple apps)
csrutil
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent…