This is a pygame challenge where we need to get a specific key generated by a baby moving at a certain x-coordinate for specific rounds. It calls a generate_flag function that will generate the flag. We can extract this function and brute force the key
def GenerateFlagText(sum):
key = sum >> 8
encoded = "\xd0\xc7\xdf\xdb\xd4\xd0\xd4\xdc\xe3\xdb\xd1\xcd\x9f\xb5\xa7\xa7\xa0\xac\xa3\xb4\x88\xaf\xa6\xaa\xbe\xa8\xe3\xa0\xbe\xff\xb1\xbc\xb9"
plaintext = []
for i in range(0, len(encoded)):
plaintext.append(chr(ord(encoded[i]) ^ (key+i)))
return ''.join(plaintext)
for i in range(1000000):
retstr = GenerateFlagText(i)
if ('flare' in retstr):
print(retstr)We know the flag format, so we search for all the flags that include it.
We get the flag drilling_for_teddies@flare-on.com