top of page
Search

BSidesTLV 2022 CTF - "Medium Expectations"


ree

I tried a pretty easy Crypto challenge.

After using Netcat, the server asks us to guess the correct numbers repeatedly.

ree

After looking at the source code ("challenge.py"), it seemed that the server generates a random number in the appropriate range each time.

ree

However, there is an interesting function - random.seed().

ree

After reading about this function, I understood that it takes a number (the result of the operation inside it) and this will be the seed for the random functions (rand_range).

Okay, so it is not actually random. The random seed has a fixed value.

I checked the result of this operation and got a reasonable value, but it did not work after I tried it.


I thought it might be quicker if I just ran this program in PyCharm after modifying and printing the results for each iteration, and it worked. After connecting to the server, I just used the numbers and got the flag.


ree

Happy hacking :)

Orel 🐇

 
 
 

Comments


Subscribe to my newsletter • Don’t miss out!

  • LinkedIn
bottom of page