
Macos Process Injection
This is a comprehensive playbook for injecting code into macOS processes using DYLD_INSERT_LIBRARIES, dylib hijacking (weak/rpath/proxy variants), XPC service exploitation, and Mach port manipulation. You'd use this when pentesting macOS apps or researching privilege escalation vectors. The skill covers the critical details base models miss, like which binaries accept DYLD environment variables (hardened runtime blocks them unless explicitly entitled), how PID reuse attacks work against poorly validated XPC services, and why audit tokens matter more than PIDs for validation. It's thorough on both technique and constraints, with tables showing exactly what works against SIP-protected binaries versus sandboxed apps. The practical code snippets and one-liners for finding injectable targets make it immediately actionable.
- skills.sh installs
- 3.7K
- GitHub stars
- 2.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add yaklang/hack-skills --skill macos-process-injection --agent claude-codeInstalls into .claude/skills of the current project.
Files
SKILL: macOS Process Injection — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert macOS process injection techniques. Covers DYLD_INSERT_LIBRARIES, dylib hijacking (weak/rpath/proxy), XPC PID reuse attacks, Mach port manipulation, MIG abuse, and Electron injection. Base models miss entitlement prerequisites and SIP constraints on injection vectors.
0. RELATED ROUTING
Before going deep, consider loading:
- macos-security-bypass when you need to bypass TCC, Gatekeeper, or SIP protections blocking your injection
- linux-privilege-escalation for Unix-layer escalation (shared object hijacking concepts apply)
Advanced Reference
Also load DYLIB_XPC_TECHNIQUES.md when you need:
- Step-by-step dylib hijacking methodology with tooling commands
- XPC exploitation walkthrough with code examples
- Mach port technique details and task_for_pid patterns
1. DYLD_INSERT_LIBRARIES INJECTION
The most straightforward injection: set an environment variable that forces the dynamic linker to preload your dylib.
1.1 Requirements and Restrictions
Sponsors
Details
- Repository
- github.com/yaklang/hack-skills
- First seen
- Jun 3, 2026
More from yaklang/hack-skills
All 102- Upload Insecure Files3.7K
- Unauthorized Access Common Services3.6K
- Reverse Shell Techniques3.6K
- Ghost Bits Cast Attack3.5K
- Hack4.6K
- Android Pentesting Tricks4.3K
- Recon And Methodology4.3K
- Sqli Sql Injection4.2K
- Code Obfuscation Deobfuscation4.2K
- Xss Cross Site Scripting4.2K
- Api Sec4.1K
- Business Logic Vulnerabilities4.1K
- Ssrf Server Side Request Forgery4.1K
- Idor Broken Object Authorization4K
- Authbypass Authentication Flaws4K
- Jwt Oauth Token Attacks4K
- Api Recon And Docs4K
- 401 403 Bypass Techniques4K
- Api Auth And Jwt Abuse4K
- Waf Bypass Techniques4K
- Vm And Bytecode Reverse4K
- Websocket Security4K
- Api Authorization And Bola3.9K
- Auth Sec3.9K