Sineyed
177 words
1 minutes
Hack the Box Reverse Engineering Challenge 1 Writeup

Programs/Applications Used#

  • Kali Linux
  • Ghidra
  • strace
  • ltrace

Useful Links#

Preliminary Steps#

The first step to begin with is reading challenge description and checking the downloads. We have a binary file, so can start by just trying to run it.

Binary after unpacking and initial zip

Binary Analysis#

Upon trying to run the file, we simply get another prompt.

Binary run

So now to use strace and ltrace to see what they give:

Trace command outputs

Seeing this SIGILL, I looked up what that means (see above) and then opened up the executable in Ghidra and headed to the main().

Initial Ghidra run

Here I saw the UD2 mentioned in the stackoverflow post, so began to decompile each one (Right click, decompile):

Decompile step

At this point, while decompiling each one, I noticed the strlen function, and then noticed the strncmp external call as well below this. I noticed that in the first strncmp function it had the plain text ‘Itz’ at the end of the variable as well:

Functions

Functions

Going down each strncmp, I also found the print that states what format the flag would be printed in:

Flag found

After doing this, the flag came out to be:

HTB{Itz_0nLy_UD2}

Hack the Box Reverse Engineering Challenge 1 Writeup
https://nevermore23274.github.io/posts/htb-re1/
Author
Sineyed
Published at
2024-02-19
© 2023 Sineyed. All Rights Reserved.
Powered by Fuwari