Exploit databaseDownload repository ZIP
GH-51b9dee0a9fc2b7176517ada2bbd6d8e
2dukes/cyber-range-framework
Sources for CVE-2021-44228
465 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
2dukes/cyber-range-frameworkRevision 7888f66930ff
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
project/scenarios/impossible-xss/download/adminbot-handout.js
JavaScript · 1,532 bytes// nodejs 16+
// npm i puppeteer
// usage: node adminbot.js [url]
const fs = require('fs');
const puppeteer = require('puppeteer');
const flag = fs.readFileSync('./flag.txt', 'utf8').trim();
const challenge = {
name: 'impossible-xss admin bot',
urlRegex: /^https:\/\/impossible-xss.mc.ax\//,
timeout: 10000,
handler: async (url, ctx) => {
const page = await ctx.newPage();
await page.goto('https://impossible-xss.mc.ax', { timeout: 3000, waitUntil: 'domcontentloaded' });
// you wish it was that easy
await page.setCookie({
"name": "FLAG",
"value": flag,
"domain": "impossible-xss.mc.ax",
"path": "/",
"httpOnly": true,
"secure": true,
"sameSite": "Strict"
});
await page.setJavaScriptEnabled(false);
await page.goto(url, { timeout: 3000, waitUntil: 'domcontentloaded' });
await sleep(3000);
}
}
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
const url = process.argv[2]
const regex = challenge.urlRegex ?? /^https?:\/\/.*/
if (!regex.test(url)) {
throw new Error('invalid url')
}
(async () => {
const browser = await puppeteer.launch({
pipe: true,
dumpio: true,
args: ['--js-flags=--jitless', '--no-sandbox'],
})
const ctx = await browser.createIncognitoBrowserContext()
console.log(`Starting...`);
await Promise.race([
challenge.handler(url, ctx),
sleep(challenge.timeout),
]);
await browser.close();
})();