BBomb - Phase 3
Category: Binary Bomb
75 points
Reflections? Rotations? Translations? This is starting to sound like geometry…
Author: treap_treap
Solution
Third phase of Binary Bomb
challenge chain which started with
BBomb - Phase 1.
This time challenge started to be a bit more difficult. Additionally there were two functions with challenge logic. One of them looked like rot13 (below).
I’ve decided to not overthink too much and simply rewritten the logic in Python to bruteforce the flag.
from string import ascii_letters, digits
encoded_flag = '\"_9~Jb0!=A`G!06qfc8\'_20uf6`2%7'
decoded_flag = ''
def func3_1(s):
o = ord(s)
if 64 < o < 91:
o -= 13
if o < 65:
o += 26
if 96 < o < 123:
o -= 13
if o < 97:
o += 26
return chr(o)
def func3_2(s):
o = ord(s)
if 32 < o != 127:
o -= 47
if o < 33:
o += 94
return chr(o)
for i in range(len(encoded_flag)):
for c in ascii_letters + digits + '_':
char = func3_2(func3_1(c))
if char == encoded_flag[i]:
decoded_flag = decoded_flag + c
break
print('Flag: DawgCTF{{{}}}'.format(decoded_flag))
Flag
DawgCTF{D0uBl3_Cyc1iC_rO74tI0n_S7r1nGs}