Beleaf CSAW 19 ctf#
category : crackmes/RE#
difficulty : beginners#
url to challenge : https://github.com/osirislab/CSAW-CTF-2019-Quals/tree/master/rev/beleaf#
how i solved it :#
We begin with a basic executable we try to run it and see it asks for a code of somekind,
i tried entering several inputs but to no avail , we need to dig deeper ,
using bininja i located the main function we can see that it performs some kind of a check for the right input
some constraints we see are that our input must be at least 0x20 and that it checks with some encoding function
that performs some kind of actions lets dig in and find something interesting,
this function appears to be finding the index of something inside the data array,
inside the main function we see the following :
if the comparison is wrong, it puts out incorrect therefore it must be true, a comparison between the input string encoded by the function and a certain array-like structure that jumps 8 bytes lets see what it must be equal to,
inside the encoding function we see that we recieve some kind of an index so.. in other words we have to match an index that gets returned from the encoding function to the tagert array, first number we need is 1 so index 1 needs to be returned from the index array which as we see here