BB

technology and craziness.

BB

technology and craziness.

TryHackMe - Tasks and Questions to Markdown Converter

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:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# Advent of Cyber

Get started with Cyber Security in 25 Days - Learn the basics by doing a new, beginner friendly security challenge every day leading up to Christmas.

## Task 1  Introduction

### #1 - Read the above.

``

## Task 2  Connect To Our Network

### #1 - Practise connecting to our network.

``

## Task 3  Points don't matter

### #1 - Read the above

``

## Task 4  Our Socials

### #1 - Join the Discord server and say hi!

``

### #2 - Follow us on Twitter.

``

## Task 5  [Optional] Your own Kali Linux Machine

### #1 - Read the above

``

## Task 6  [Day 1] Inventory Management

### #1 - What is the name of the cookie used for authentication?

``

### #2 - If you decode the cookie, what is the value of the fixed part of the cookie?

``

### #3 - After accessing his account, what did the user mcinventory request?

``

## Task 7  [Day 2] Arctic Forum

### #1 - What is the path of the hidden page?

``

### #2 - What is the password you found?

``

### #3 - What do you have to take to the 'partay'

``

## Task 8  [Day 3] Evil Elf

### #1 - Whats the destination IP on packet number 998?

``

### #2 - What item is on the Christmas list?

``

### #3 - Crack buddy's password!

``

## Task 9  [Day 4] Training

### #1 - How many visible files are there in the home directory(excluding ./ and ../)?

``

### #2 - What is the content of file5?

``

### #3 - Which file contains the string ‘password’?

``

### #4 - What is the IP address in a file in the home folder?

``

### #5 - How many users can log into the machine?

``

### #6 - What is the sha1 hash of file8?

``

### #7 - What is mcsysadmin’s password hash?

``

## Task 10  [Day 5] Ho-Ho-Hosint

### #1 - What is Lola's date of birth? Format: Month Date, Year(e.g November 12, 2019)

``

### #2 - What is Lola's current occupation?

``

### #3 - What phone does Lola make?

``

### #4 - What date did Lola first start her photography? Format: dd/mm/yyyy

``

### #5 - What famous woman does Lola have on her web page?

``

## Task 11  [Day 6] Data Elf-iltration

### #1 - What data was exfiltrated via DNS?

``

### #2 - What did Little Timmy want to be for Christmas?

``

### #3 - What was hidden within the file?

``

## Task 12  [Day 7] Skilling Up

### #1 - how many TCP ports under 1000 are open?

``

### #2 - What is the name of the OS of the host?

``

### #3 - What version of SSH is running?

``

### #4 - What is the name of the file that is accessible on the server you found running?

``

## Task 13  [Day 8] SUID Shenanigans

### #1 - What port is SSH running on?

``

### #2 - Find and run a file as igor. Read the file /home/igor/flag1.txt

``

### #3 - Find another binary file that has the SUID bit set. Using this file, can you become the root user and read the /root/flag2.txt file?

``

### #4 - If you've finished the challenge and want more practise, checkout the Privilege Escalation Playground room created by SherlockSec: https://tryhackme.com/room/privescplayground

``

## Task 14  [Day 9] Requests

### #1 - What is the value of the flag?

``

## Task 15  [Day 10] Metasploit-a-ho-ho-ho

### #1 - Compromise the web server using Metasploit. What is flag1?

``

### #2 - Now you've compromised the web server, get onto the main system. What is Santa's SSH password?

``

### #3 - Who is on line 148 of the naughty list?

``

### #4 - Who is on line 52 of the nice list?

``

## Task 16  [Day 11] Elf Applications

### #1 - What is the password inside the creds.txt file?

``

### #2 - What is the name of the file running on port 21?

``

### #3 - What is the password after enumerating the database?

``

## Task 17  [Day 12] Elfcryption

### #1 - What is the md5 hashsum of the encrypted note1 file?

``

### #2 - Where was elf Bob told to meet Alice?

``

### #3 - Decrypt note2 and obtain the flag!

``

## Task 18  [Day 13] Accumulate

### #1 - A web server is running on the target. What is the hidden directory which the website lives on?

``

### #2 - Gain initial access and read the contents of user.txt

``

### #3 - [Optional] Elevate privileges and read the content of root.txt

``

## Task 19  [Day 14] Unknown Storage

### #1 - What is the name of the file you found?

``

### #2 - What is in the file?

``

## Task 20  [Day 15] LFI

### #1 - What is Charlie going to book a holiday to?

``

### #2 - Read /etc/shadow and crack Charlies password.

``

### #3 - What is flag1.txt?

``

## Task 21  [Day 16] File Confusion

### #1 - How many files did you extract(excluding all the .zip files)

``

### #2 - How many files contain Version: 1.1 in their metadata?

``

### #3 - Which file contains the password?

``

## Task 22  [Day 17] Hydra-ha-ha-haa

### #1 - Use Hydra to bruteforce molly's web password. What is flag 1? (The flag is mistyped, its THM, not TMH)

``

### #2 - Use Hydra to bruteforce molly's SSH password. What is flag 2?

``

## Task 23  [Day 18] ELF JS

### #1 - What is the admin's authid cookie value?

``

## Task 24  [Day 19] Commands

### #1 - What are the contents of the user.txt file?

``

## Task 25  [Day 20] Cronjob Privilege Escalation

### #1 - What port is SSH running on?

``

### #2 - Crack sam's password and read flag1.txt

``

### #3 - Escalate your privileges by taking advantage of a cronjob running every minute. What is flag2?

``

## Task 26  [Day 21] Reverse Elf-ineering

### #1 - What is the value of local_ch when its corresponding movl instruction is called(first if multiple)?

``

### #2 - What is the value of eax when the imull instruction is called?

``

### #3 - What is the value of local_4h before eax is set to 0?

``

## Task 27  [Day 22] If Santa, Then Christmas

### #1 - what is the value of local_8h before the end of the main function?

``

### #2 - what is the value of local_4h before the end of the main function?

``

## Task 28  [Day 23] LapLANd (SQL Injection)

### #1 - Which field is SQL injectable? Use the input name used in the HTML code.

``

### #2 - What is Santa Claus' email address?

``

### #3 - What is Santa Claus' plaintext password?

``

### #4 - Santa has a secret! Which station is he meeting Mrs Mistletoe in?

``

### #5 - Once you're logged in to LapLANd, there's a way you can gain a shell on the machine! Find a way to do so and read the file in /home/user/

``

## Task 29  [Day 24] Elf Stalk

### #1 - Find the password in the database

``

### #2 - Read the contents of the /root.txt file

``

## Task 30  [Day 25] Challenge-less

### #1 - Complete another room on TryHackMe.

``