yaklang avatar

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-code

Installs 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:

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

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs