Skip to content
Go back

Compiled THM Write Up

Published:  at  01:49 PM

Table Of Contents

Open Table Of Contents

Intro

Compiled Room THM

THM recently released a 5 minutes hack rooms, which are pretty easy even for beginners. This is one of those rooms.
So instead of doom scrolling, you can test your skills out and spend your time more wisely.

Download Task THM

Let’s download the task file.

Password Ask THM

The file is an executable format. Make sure to run chmod +x Compiled-1688545393558.Compiled if it’s not permitted.
When we run the file, it asks for the password.

Try Again THM

The password is not that simple, obviously. We need to retrieve this.

Ghidra

Ghidra THM

Let’s use Ghidra. You can use any reversing tool you prefer.

Ghidra Import THM

Select Files > Import (OR) Press “I” to import our executable file.

Open in Ghidra THM

Double Click our file to open in Code Editor.

Analyze Ghidra THM

Select “Yes” to analyze our file.

Analyze Ghidra Again THM

Select “Analyze”.

Choose Main THM

From the left, navigate to symbol tree, select Functions > main.
To the right is the decompilation of the main function. We’ll be focusing on this one.

If you’re familiar with C, I’m sure you’ve already guessed the password.
There’s a “scanf” which accepts our input. However, there are some texts in both sides of a format specifier “%s”.
Don’t let this confuse you. Let’s trace the code in our head step by step.

Code Logic THM

Cool! It’s DoYouEven_init. Is that correct?

Correct Password THM

It works…Awesome!

Outro

Now we gonna put this in the field and fetch our score (and streak).

Finish Compiled THM

And That’s it. Hope you enjoyed this room. Happy Reversing!


Spotted a Mistake?
Share this post on:

Previous Post
AI - Friend or Foe
Next Post
Memory Management in Assembly (You're the Boss Now!)