You are helping a penetration tester exploit misconfigured Active Directory
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Detect code injection vulnerabilities in packages that dynamically generate or evaluate code via new Function(), eval(), vm.run*, or template literal interpolation.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Audit any package that dynamically generates or evaluates code — schema validators, template engines, expression evaluators, serializers with code generation, JIT compilers, query builders that emit JavaScript.
This is the highest-yield vulnerability class for CVE hunting. ~90% acceptance rate when confirmed.
Code generation packages often interpolate user-controlled values directly into generated code strings. Unlike template injection (where user input goes INTO a template), here user input becomes PART of the generated code itself.
Search for all dynamic code execution:
# JavaScript/TypeScript
grep -rn "new Function\(" .
grep -rn "eval(" .
grep -rn "vm\.run" .
grep -rn "vm\.compileFunction" .
grep -rn "setTimeout(" . | grep -v "setTimeout(function"
grep -rn "setInterval(" . | grep -v "setInterval(function"
grep -rn "new AsyncFunction" .
grep -rn "script\.runIn" .
# Python
grep -rn "eval(" .
grep -rn "exec(" .
grep -rn "compile(" . | grep -v "re.compile"
# Ruby
grep -rn "\.eval\b" .
grep -rn "instance_eval" .
grep -rn "class_eval" .
# PHP
grep -rn "eval(" .
grep -rn "assert(" .
grep -rn "create_function" .
grep -rn "preg_replace.*\/e" .
For each sink found:
new Function(`return ${userInput}`)new Function("return " + userInput)JSON.stringify does NOT escape */. If generated code wraps values in block comments:
// VULNERABLE PATTERN:
let code = `/* ${JSON.stringify(userValue)} */ actual_code_here`;
// Attacker input: */ malicious_code /*
// Result: /* */ malicious_code /* */ actual_code_here
Search for this pattern:
grep -rn "\/\*.*JSON\.stringify" .
grep -rn "\/\*.*\$\{" .
Common mistakes:
</script> in HTML context// Schema validator generating validation function
function createValidator(schema) {
const code = `return function(value) {
if (typeof value !== "${schema.type}") throw new Error("invalid");
}`;
return new Function(code)();
}
// Exploit: schema.type = '"; }); process.mainModule.require("child_process").execSync("id"); //'
// Expression evaluator
function evaluate(expr) {
return eval("(" + expr + ")");
}
// Serializer generating accessor code
function createGetter(path) {
return new Function("obj", `return obj.${path}`);
}
// Exploit: path = "x; process.mainModule.require('child_process').execSync('id'); //"
// Code generator with "safe" comments
function generateModule(config) {
return `
/* Config: ${JSON.stringify(config.name)} */
module.exports = { value: ${JSON.stringify(config.value)} };
`;
}
// Exploit: config.name = "*/ require('child_process').execSync('id'); /*"
// Debug source mapping
const code = `${generatedCode}\n//# sourceURL=${filename}`;
new Function(code)();
// Exploit: filename contains newline + malicious code
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
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
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.