Writeup - Sameer's Challenge (ASVCTF 2022)
ASVCTF 2022 - Sameer’s Challenge Writeup
- Type - Rev
- Name - Sameer’s Challenge
- Points - 150
Description
1 | A Basic RE Challenge |
Writeup
What the code was doing was taking the flag, base64-encoding every fourth character, and then checking that the letters matched in a random order. To reverse, I took the assert()
statements and modified them slightly so that they initialized an array of ?
s to the “checked” value in the order they were actually in. This gave us the value QQ==SV{dw==3lcMA==m3_dA==o_RMw==}
. Base64-encoding a single character results in four characters, 2 letters and 2 =
. For example, QQ==
was A
, dw==
was w
, etc. I wrote a solve script that detected the base64 encoding and decoded them, otherwise the letter was just added to the flag.
Solve Script
1 | import base64 |
Flag: ASV{w3lc0m3_to_R3}