TryHackMe - Race Conditions
TryHackMe - Race Conditions
Task 2
You downloaded an instruction booklet on how to make an origami crane. What would this instruction booklet resemble in computer terms?
Program
What is the name of the state where a process is waiting for an I/O event?
Waiting
Task 3
Does the presented Python script guarantee which thread will reach 100% first? (Yea/Nay)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import threading
x = 0 # Shared variable
def increase_by_10():
global x
for i in range(1, 11):
x += 1
print(f"Thread {threading.current_thread().name}: {i}0% complete, x = {x}")
# Create two threads
thread1 = threading.Thread(target=increase_by_10, name="Thread-1")
thread2 = threading.Thread(target=increase_by_10, name="Thread-2")
# Start the threads
thread1.start()
thread2.start()
# Wait for both threads to finish
thread1.join()
thread2.join()
print("Both threads have finished completely.")
Nay
In the second execution of the Python script, what is the name of the thread that reached 100% first?
Below is a second execution output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
python t3_race_to_100.py
...
Thread Thread-1: 70% complete, x = 10
Thread Thread-2: 40% complete, x = 11
Thread Thread-1: 80% complete, x = 12
Thread Thread-2: 50% complete, x = 13
Thread Thread-1: 90% complete, x = 14
Thread Thread-2: 60% complete, x = 15
Thread Thread-1: 100% complete, x = 16
Thread Thread-2: 70% complete, x = 17
Thread Thread-2: 80% complete, x = 18
Thread Thread-2: 90% complete, x = 19
Thread Thread-2: 100% complete, x = 20
Both threads have finished completely.
Thread-1
Task 4
How many states did the original state diagram of “validating and conducting money transfer” have?
2
How many states did the updated state diagram of “validating and conducting money transfer” have?
3
How many states did the final state diagram of “validating coupon codes and applying discounts” have?
5
Task 5
sending parallel request to transfer post request gives us the flag 
You need to get either of the accounts to get more than $100 of credit to get the flag. What is the flag that you obtained?
THM{PHONE-RACE}
Task 7
after multiple attempts in Burpsuite
we get our final flag THM{BANK-RED-FLAG}
This post is licensed under CC BY 4.0 by the author.