Crackme: Meist's Passfind Crackme
Today we're going to be solving "meist's passfind" crackme. It is described as the most easy crackme that the author could come up with. One simply needs to find the password and enter it. Great!
Available here: https://crackmes.one/crackme/68be3593224c0ec5dcedbe2d
MD5: f7215afaac27af81c31362fe09b0e17d
SHA1: f4fbe3a9d2afad8cf4b31aac2b5fe308d0d1e3f8
SHA256: 752ed87f3783e8ba14f1585152a6abf4f8e174ca3635b705a7a9c0f88b6405e5
Running Detect it Easy, we can see that the executable is compiled as an x64 PE console application but we're unable to determine what compiler was used or what language it was written in.
Taking a look at the strings, it's possible that this was compiled using the mingw compiler and possibly written in assembly. That would explain why DIE had so little information on the binary.
Dropping the executable in Ghidra and running all the defaults, we're greeted with this:
Let's take this step by step. I took a look inside of the __main() function and there wasn't anything really going on except for revealing that this executable was created using MSY2 Rev5 v15.1.0.
Moving forward, we see three local variables initialized to 0. Then we're greeted to a prompt. Next we see a call to scanf and we cant tell by the "%d" that it is expecting a number for our input. Our input is being stored in the local_c variable.
After that, our input is being compared against 0x5e0 (1504 in decimal). If our input is equal to 0x5e0, we can see that we get the good boy message. If our input is not equal to 0x5e0, we take the else jump and we can see that we get a bad boy message.
But what about the scanf after the good/bad boy message? That's just there to prevent the console from closing immediately. It will wait for you to enter a character and then terminate.
The astute observer may be asking, but what about the third variable? It's never used. The author decided to set that memory address to 0 at the start of the function which is why Ghidra assumed it would be used as a local variable.
I'm not really sure what the logic behind that could be. Perhaps an oversight? I assume the author originally intended to use three variables: a char, an int, and a short int but ended up removing the use of the short as he progressed through development. I say this because based on the [sub rsp, 0x30], he is only allocating space for two variables(assuming 8 bytes each to keep it aligned). x64 convention dictates that 32 bytes need to be allocated for the shadow store. So assuming they followed convention, that leaves room for his two local variables.
One final thought, go ahead and enter a string of characters after the good/bad boy message and see what happens. Do you know why that happened? Let me know on x.com @g_bobbyhill.
Here's the final code:
Comments
Post a Comment