Tags: programming ctf python 

Rating:

## Problem: Find the password

## Source Given: main.py

#I'm thinking of a number from 0 to 2^32 - 1
#Can you guess it?

import random

def generate(seed):
random.seed(seed)
c = 0
while c != ord('}'):
c = random.randint(97, 126)
print(chr(c), end='')
print()

secret = 'ly9ppw=='

import base64

s = int(input("password? >>> "))

if int(base64.b64decode(secret).hex(), 16) == s:
generate(s)
else:
print('nope')

# Solution:
Just Execute three lines from code and get password

secret = 'ly9ppw=='
import base64
int(base64.b64decode(secret).hex(), 16)

After getting password, run the main.py program and give that password to get flag

Original Link: https://youtu.be/KLNPgk_HMcg

Original writeup (https://youtu.be/KLNPgk_HMcg).