If you are managing your training/ctf/… stuff in markdown files like I do, this short function will save you a couple of minutes. 😊
Paste this into your Google Chrome DevTools console and execute getInfo();
. The tasks and questions of the current room will be in your clipboard now. Just paste it into your markdown file.
October 17, 2020: Updated the script to work with the new TryHackMe layout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| function getInfo() {
let title = document.getElementById('title').innerText;
let description = document.getElementById('description').innerText;
let cards = document.getElementsByClassName('card-link');
let count = document.getElementsByClassName('card-link').length;
let taskContent = document.getElementById('taskContent').getElementsByClassName('card');
let list = [];
list.push('# ' + title + '\n');
list.push(description + '\n');
for (i = 0; i < count; i++) {
list.push('## ' + cards[i].innerText.split('\n')[0] + '\n');
for (j = 0; j < taskContent[i].getElementsByClassName('room-task-questions').length; j++) {
questionNr = taskContent[i].getElementsByClassName('room-task-questions')[j].getElementsByClassName('room-task-question-no')[0].innerText.trim();
questionText = taskContent[i].getElementsByClassName('room-task-questions')[j].getElementsByClassName('room-task-question-details')[0].innerText.trim();
list.push('### ' + questionNr + ' - ' + questionText + '\n\n``\n');
}
}
copy(list.join("\n"));
}
getInfo();
|
As an example, executing this on Advent of Cyber
will copy this to your clipboard: