1.- Provided challenge description
The code is inside this program, can you find it?
This challenge tests your Python knowledge, so it’s a good idea to have at least the bare minimum idea of how to write simple programs on it
We try to run the script (python3 code.py
) and it errors out, by looking at the code we can see that it expects an argument
so we provide a random one to it, prints out “No”
By inspecting the code you can see that it does some Python String Slicings, so it should be as easy as reversing the algorithm used to craft the flag (The result gets compared to a string to know if that’s the flag)
The main idea behind the algorithm is that it works kinda like a cocktail mixer, you pour some content from the left glass and then some from the right glass; generating an unique mixture crafted by both glasses (The flag)
While you can do the reversing manually, I personally wrote a script that crafted the flag automatically.
Advent{NJgm4LQC6afk8MstzVuiFAtn21xpjAWq}
A simple blog for everything me
Writeup for the second 2022's Advent of Hack CTF challenge