Here is a short JS snippet to leave a room on TryHackMe.
Context: I joined the room https://tryhackme.com/room/linuxctf a long time ago when it was free but has become VIP-only, so I have it appearing in "My rooms" but cannot do it and since I'm redirected to the VIP subscription page I can't leave it.
- Go to the page of any room (must be a room).
- Replace
code
value with the room code (look at the URL). Eg.linuxctf
for https://tryhackme.com/room/linuxctf. - Run the JS snippet un your browser console (press F12).
Note: a solution inspired by szymex73 better snippet.
Replace _csrf
value with an anti-CSRF token from any other room (CTRL + U and look for (CTRL+F) csrfToken
), eg:
const csrfToken = "token-here"
$.ajaxSetup({ headers: { 'CSRF-Token': csrfToken } }) // all $.post headers include token (needs csrfProtection middleware)
const roomCode = "ccradare2"
const simpleRoom = false
const ctfRoom = false
const events = {"tickets":false}
Replace code
value with the room code (look at the URL). Eg. linuxctf
for https://tryhackme.com/room/linuxctf.
Run the JS snippet un your browser console (press F12).