本文へ移動
cccskills
無料GitHub で公開

hunt-macos

macOS attack hunting - foothold to root/persistence on a macOS host. TCC/Gatekeeper/SIP bypass, keychain + credential loot, code-signing/entitlements abuse, XPC/dylib/library injection, launch-constraint evasion, MDM/installer abuse. Wiki-first, FIND schema output.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Hunt: macOS

Assumes hunt-core for the scope gate, two-account rule, confirmation gate, enumeration limits, stop conditions, wiki protocol, FIND output, and Deadends. Do not re-derive any of that here.

Wiki

qmd_query "macOS TCC SIP Gatekeeper AMFI keychain XPC dylib injection sandbox escape code signing entitlements" via wiki-search MCP

Hub: [[macos-moc]] (live index). Primary page: [[macos-tcc]]. Payload arsenal: wiki/payloads/macos-app-injection.md. Anchors: [[macos-privesc]] (general privesc checklist), [[macos-keychain]] (credential/DB harvest).

Environment note

macOS boxes on THM/HTB are usually a VM (not real Apple hardware) - SIP/Gatekeeper/TCC still apply as shipped, but device-specific protections (Secure Enclave, T2) generally do not. Confirm root/admin vs a sandboxed app context before picking an escalation path - the sandbox-escape and TCC-bypass techniques below assume different starting points.

Attack surface signals

Detected via: SSH/service banner (Darwin, Mac OS X 10., macOS 1[1-5]), a .app bundle / .plist delivered as a foothold vector, Bonjour/mDNS (5353), ARD/screen-sharing (5900/3283), SMB served by smbd with a macOS-flavoured share layout, or a CTF prompt naming macOS/Darwin explicitly. Footholds: a delivered .pkg/.dmg/.app (installer/Gatekeeper abuse), a web app or service running as a low-priv user, physical/VNC/screen-sharing access to a logged-in session.

Rank the surface once you have a foothold:

  • TCC / SIP / Gatekeeper / AMFI - the macOS-specific security stack; a bypass here is the signature finding of this class and the primary path to protected data or unsigned code exec.
  • Keychain / credential loot - highest reward-per-effort; a login-keychain dump or a reused hash often beats grinding a hardened control (see chaining note).
  • XPC / dylib / library injection - inherit a privileged or entitled process's rights; the main local-privesc lever once enumeration finds a vulnerable service or a hijackable load path.
  • Sandbox escape - only relevant from a sandboxed app context; escapes to the full user context.
  • MDM / installer abuse - a .pkg postinstall runs as root at install time; MDM enrollment reaches the whole fleet. Highest blast radius when either is present.

Methodology

  1. Enumerate the foothold first - Skill(arsenal) then [[macos-enumeration]]: users, running processes/services (launchd agents/daemons), installed .app bundles, network map, SIP status (csrutil status), Gatekeeper status (spctl --status), TCC database location + entries.
csrutil status                          # SIP enabled/disabled - gates which privesc paths are live
spctl --status                          # Gatekeeper assessment on/off
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "select * from access"   # per-app TCC grants
  1. Credential / secret loot - [[macos-keychain]] (login keychain dump, security CLI, keychain ACL bypass) then the wider sweep in [[macos-loot-locations]] (local password hashes under /var/db/dslocal/, browser/app credential stores, sensitive DBs) - crack recovered hashes with hashcat -m 7100 (salted SHA512-PBKDF2).
  2. Evasion / bypass the OS security stack (pick per what's actually gating you):
    • [[macos-gatekeeper]] - quarantine-attribute stripping, unsigned/ad-hoc-signed app execution.
    • [[macos-code-signing]] - signature/entitlement inspection and abuse (codesign, ad-hoc re-signing).
    • [[macos-amfi]] - AppleMobileFileIntegrity internals underlying code-signing enforcement, and its bypasses.
    • [[macos-launch-constraints]] - trust-cache / launch-constraint evasion on newer macOS.
    • [[macos-dirty-nib]] - NIB-file injection into a signed app to gain its entitlements.
  3. Privilege escalation / sandbox escape - [[macos-privesc]] (the general checklist: SUID, sudo, cron/launchd, writable app bundles) alongside:
    • [[macos-sandbox-escape]] - escape an app sandbox profile to the full user context.
    • [[macos-xpc-abuse]] - abuse a privileged XPC service's exposed Mach interface.
    • [[macos-function-hooking]] / [[macos-library-injection]] / [[macos-thread-injection]] / [[macos-app-injection]] (payload) - DYLD_INSERT_LIBRARIES/dylib hijack/thread-injection into a privileged or entitled process to inherit its rights.
    • [[macos-authorization-db]] - Authorization Services rights-database manipulation for a privesc.
    • [[macos-tcc]] - TCC bypass to reach protected data (contacts/photos/full-disk-access/camera) or ride a TCC-granted app's entitlement.
    • [[macos-installers-abuse]] - .pkg postinstall-script / .dmg abuse for root-run code at install time.
    • [[macos-chromium-injection]] - inject into a Chromium-based app (Electron/Chrome) via its debug/CEF surface for code exec in that app's context.
  4. Persistence + lateral - [[macos-persistence]] (launch agents/daemons, login items, cron) and [[macos-mdm]] (enrolled-MDM abuse for fleet-wide reach, if the host is MDM-managed).

Chaining. Foothold -> keychain/credential loot -> privesc is the reliable macOS chain: a low-priv shell first dumps the login keychain and /var/db/dslocal/ hashes ([[macos-keychain]] / [[macos-loot-locations]]), a cracked or reused admin password then unlocks sudo/security and the privileged XPC/dylib paths in step 4. Loot before you grind a hardened control.

Evasion. Prefer the least-noisy path that clears the gate: strip the com.apple.quarantine xattr rather than fully re-sign, ride an already-TCC-granted app's entitlement rather than defeating TCC head-on, and load via a hijackable dylib search path before touching AMFI/launch-constraint internals. Escalate to heavier bypasses ([[macos-amfi]], [[macos-launch-constraints]]) only when the lighter path is actually blocked.

Distill a confirmed reusable macOS technique per hunt-core: python3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/macos/macos-privesc.md.

Confirmation gate

NOT confirmation: a permissive entitlement (com.apple.security.*, a get-task-allow or a private-framework entitlement) present in a plist; an unsigned or ad-hoc-signed binary sitting on disk; a world-writable app bundle or launchd plist; csrutil/spctl reporting a control as present; a DYLD_INSERT_LIBRARIES that the loader ignored on a hardened process. A capability that exists is not a control that was bypassed.

IS confirmation: the control was actually defeated and demonstrated - TCC bypassed and the protected resource (contacts/photos/full-disk/camera) actually read; SIP-protected path written or csrutil-guarded action performed; Gatekeeper/AMFI/launch-constraint bypassed and your unsigned code ran past it; an injected dylib/thread executing inside the privileged/entitled process and exercising its rights; a .pkg postinstall or XPC call yielding a root-context action you performed - each re-verified in a clean session and reproduced from your own written steps.

Severity

SeverityClass
CRITICALroot / SIP-disabled code exec, MDM fleet compromise
HIGHsandbox escape, XPC privesc, keychain-wide credential dump
MEDIUMTCC bypass to a single data class, Gatekeeper bypass with no privilege gain

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

arsenal

無料

Wiki-first "what do I use" lookup - pick the automated TOOL (wiki/tools/), then the PAYLOAD/technique (wiki/payloads/ + wiki/cheatsheets/), for a surface/service/vuln-class BEFORE hand-rolling or working from memory. Use for "tool for <service>", "automated tools for web/<service>", "what should I run on <surface>", "which tool for <X>", "payloads for <X>", "payload arsenal", "cheatsheet for <X>", "how do I exploit <tech/class>", "exploit/attack chain for <X>", "arsenal", any SSRF/XSS/SQLi/SSTI/LFI/JWT/XXE/IDOR/NoSQL/deserialization/CSRF/CORS/CRLF/GraphQL/smuggling/web-cache/OAuth/SAML/MFA/crypto/LDAP/XPath/WebAuthn/file-upload/IMDS/prompt-injection/Modbus ask, plus "privesc arsenal", "CVE arsenal", "default creds", "nuclei templates", "sqlmap/hydra/nmap/bloodhound", "password attacks".

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

Autonomous bug-bounty campaign driver. Runs a full programme end to end with no operator approvals - the deterministic driver (scripts/campaign.py) owns pass state, generates the killchain board from recon, and prints the exact next action (including which Skill and tool to run) every turn. Use when starting or resuming a bug-bounty engagement, "run the bb workflow", "hunt this program", "9-pass campaign", or when handed a *.scope wildcard to test for TIER1 findings. Single agent, refuter-verified, wiki-first, tool-first.

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

Health check for the bb/pt/ctf workflow driver subsystem - verifies everything is in place so every machine runs the same. Checks vault-content consistency (scripts present, JSON valid, routing wired, all 69 tool pages carry phase:, the tool index resolves, the hook edits are in place) AND per-machine wiring (the three workflow skills symlinked, hooks registered, imports work), then runs a live init->board->next smoke test. Use when setting up the workflow on a new machine, after a vault sync, when the driver misbehaves, or on "bb-health", "campaign health", "is the workflow set up", "check hooks and scripts", "why is the board not working".

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

Bring up a REAL, visible, interactive chromium on the Kali VM that the operator logs into (Smart-ID / Mobile-ID / any manual auth or MFA/CAPTCHA), while the agent drives and observes it live through the chrome-devtools MCP (navigate, DOM snapshot, network capture, screenshots, console, evaluate). Use whenever a target needs a MANUAL login the agent cannot complete headlessly, when you need to capture an authenticated session / the real API calls a page makes, or to confirm/screenshot a DOM-XSS. Triggers - "open a browser", "log in manually", "smart-id / mobile-id / national id login", "mfa / 2fa login", "solve the captcha", "drive the browser", "capture the authenticated session / network".

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

OFFLINE FALLBACK for the claude-md-management plugin - prefer that plugin when it is installed. Audit and improve CLAUDE.md files - scan for CLAUDE.md files, evaluate quality against templates, output a report, then make targeted updates. Invoke explicitly (/claude-md-improver) when the plugin is unavailable.

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

coverage

無料

Show per-asset vuln-class coverage gaps for the active engagement so nothing in scope is skipped. Use when asked "coverage", "what haven't we tested", "test gaps", "are we thorough", or before calling an engagement done.

日本語の概要は準備中です。原文の説明を表示しています。

Encod3d-Sec/TORCH3302026年9月1日 更新

Encod3d-Sec のスキルをすべて見る

このスキルの問題を報告する