acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Exploit PHP code evaluation injection via eval(), assert(), preg_replace /e, create_function(), call_user_func(), usort() callbacks, and runtime function creation (runkit, uopz). Distinct from OS command injection (shell operators) and SSTI (template engines) — this targets
$ npx -y skills add blacklanternsecurity/red-run --skill php-code-injection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/php-code-injectionContext preview
The summary Claude sees to decide when to auto-load this skill.
Exploit PHP code evaluation injection via eval(), assert(), preg_replace /e, create_function(), call_user_func(), usort() callbacks, and runtime function creation (runkit, uopz). Distinct from OS command injection (shell operators) and SSTI (template engines) — this targets
name: php-code-injection description: > Exploit PHP code evaluation injection via eval(), assert(), preg_replace /e, create_function(), call_user_func(), usort() callbacks, and runtime function creation (runkit, uopz). Distinct from OS command injection (shell operators) and SSTI (template engines) — this targets direct PHP code evaluation of user input. keywords: - php eval injection - eval() exploit - assert() injection - php code injection - create_function exploit - preg_replace /e modifier - call_user_func injection - usort callback injection - runkit_function_add - uopz_set_return - php sandbox escape - php RCE - php expression injection tools: - burpsuite - curl opsec: medium
You are helping a penetration tester exploit PHP code injection where user input is passed to a PHP code evaluation function. The goal is to execute arbitrary PHP code and escalate to OS command execution. All testing is under explicit written authorization.
**This is NOT OS command injection.** Shell operators (`;`, `|`, `&&`) do not work because the injection context is a PHP interpreter, not a shell. You must write valid PHP expressions or statements.
**This is NOT SSTI.** If `{{7*7}}` or `${7*7}` returns `49`, route to the appropriate SSTI skill. If bare PHP code like `phpinfo()` or `1+1` evaluates, you're in the right place.
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
descriptive filenames.
This skill covers PHP code injection — from confirming the injection through achieving OS command execution. When you reach the boundary of this scope — **STOP**.
Do not load or execute another skill. Do not continue past your scope boundary. Instead, return to the orchestrator with:
The orchestrator decides what runs next. Your job is to execute this skill thoroughly and return clean findings.
**Stay in methodology.** Only use techniques documented in this skill. If you encounter a scenario not covered here, note it and return — do not improvise attacks, write custom exploit code, or apply techniques from other domains. The orchestrator will provide specific guidance or route to a different skill.
**Bail out on unmet preconditions.** If the Prerequisites for this skill are not met (e.g., user input never reaches a code evaluation function), report a negative finding and return immediately. Do not pivot to unrelated attack vectors.
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
Your return summary must include:
sort comparators, regex with /e modifier, configuration evaluators
If not already provided, determine:
1. **Evaluation function** — which PHP function evaluates user input? 2. **Injection context** — is input the entire expression, a callback name, a function body, or embedded in a string? 3. **Visible or blind** — is output reflected, or side-channel only? 4. **Sanitization** — are dangerous functions disabled (`disable_functions`)?
| Function | Input Type | Context | |----------|-----------|---------| | `eval($code)` | PHP statements | Full code execution | | `assert($expr)` (PHP < 8.0) | PHP expression string | Single expression | | `preg_replace('/.*/e', $code, ...)` | PHP expression | Deprecated, removed in 7.0 | | `create_function('$args', $body)` | PHP statements | Function body (deprecated 7.2, removed 8.0) | | `call_user_func($callback, ...)` | Callable name | Controls which function is called | | `usort($arr, $callback)` | Callable name | Comparison callback | | `array_map($callback, $arr)` | Callable name | Applied to each element | | `array_filter($arr, $callback)` | Callable name | Filter predicate | | `runkit_function_add($name, $args, $body)` | PHP statements | Creates new function at runtime | | `uopz_set_return($func, $value)` | Mixed | Overrides function return values |
Skip assessment if context was already provided.
// Arithmetic (most universal)
1+1
7*7
// PHP functions
phpversion()
php_uname()
str_repeat('A',3)
// Time-based (blind)
sleep(5)
usleep(5000000)**Expected responses for confirmation:**
If `phpinfo()` works but `{{7*7}}` also returns `49`, you may be in a Twig/ Blade template context — route to the SSTI skill instead.
Inject invalid PHP to trigger errors:
<?php ) function
PHP errors (`Parse error`, `Fatal error`, `Warning`) in the response confirm PHP code evaluation. The error may reveal file paths and the evaluation function.
Security assessment toolkit for Claude Code. red-run combines skills, MCP servers, and Claude Code agent teams with routing logic that guides Claude and the operator through the phases of a security assessment — recon, initial access, lateral movement,
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Enumerates Active Directory domains and maps attack surface for penetration testing.
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS…
Exploits ADCS through ACL abuse on templates/CA objects and NTLM relay to enrollment endpoints. Covers ESC4 (template ACL → modify to ESC1), ESC5 (PKI object…
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15…
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee…