Description

RecruitCTF - BP88

Step into the realm of the internet’s most trustworthy open-source betting experience, exclusively at BP88. Join us for thrilling games and fair play guaranteed. Don’t miss out – come and play now!

  1. Please test in the local before creating an instance.

  2. One container can be used to solve all 3 challenges. You should go as far as possible before submitting flag or creating new container.

https://ctf.blackpinker.rocks/assets/f12dd31c2678c4181d9fc1acf1aa313aa58bee373b34947613b65f71cac421aa/BP88.zip

Approach

Level 1

Các xúc xắc được tạo ngẫu nhiên như sau:

random.seed(self.id_level1)
dice1 = random.randint(1, 6)
dice2 = random.randint(1, 6)
dice3 = random.randint(1, 6)
return {
	'dice1': dice1,
	'dice2': dice2,
	'dice3': dice3,
	'result': 'tai' if dice1 + dice2 + dice3 >= 11 else 'xiu'
}

Với id_level1 có giá trị gán cứng là 13371337. Do seed được gán cứng nên kết quả random luôn là 5, 5, 6 (“tài”).

All in vào “tài” đến khi có 64 coin rồi vào trang chủ để lấy flag:

Success

BPCTF{r4f7g2h5j1k9l0p}

Level 2

id_level2 có giá trị là timestamp của server:

self.id_level2 = int(time.time())

Timstamp này được dùng làm level ID, ta chỉ cần dùng giá trị này làm seed thì có thể sinh ra các số ngẫu nhiên tương tự với server.

Code dự đoán:

import random
 
random.seed(int(input('input seed: ')))
 
dice1 = random.randint(1, 6)
dice2 = random.randint(1, 6)
dice3 = random.randint(1, 6)
 
print(f'dice1: {dice1}')
print(f'dice2: {dice2}')
print(f'dice3: {dice3}')
print('tai' if dice1 +  dice2 + dice3 >= 11 else 'xiu')

Gấp đôi tới khi đủ 1024 coin rồi vào trang chủ để lấy flag:

Success

BPCTF{s3d6v8b4n7m5k1o}