Created
March 31, 2022 08:42
-
-
Save MiranDaniel/a1a6b1b7736316f6af376cc0135436e5 to your computer and use it in GitHub Desktop.
Kill all TryHackMe machines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('/api/vm/running') | |
.then(r => r.json()) | |
.then(vms => | |
vms.forEach(vm => | |
fetch('/api/vm/terminate', { | |
method: 'POST', | |
body: JSON.stringify({ code: vm.roomId }), | |
headers: { | |
'csrf-token': csrfToken, | |
'Content-Type': 'application/json' | |
} | |
}) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment