Hello dear friends and welcome back, today I want to show you how I did resolve the Baby RE from hack the box.
The binary is a 64bit ELF and it required to insert the key in a way to get the flag.
The next step is to execute the binary with the debugger
- gdb ./baby
- disassemble main
We can notice that the strcmp is invoked, so we can set a breakpoint on the main function after that execute the binary in gdb, when the breakpoint is triggered we set a second breakpoint on the strcmp function. The last step is to insert some input in this way the second breakpoint will be triggered and we will be able to get the key value from the strcmp function.
The steps are
- b main
- r
- disassemble main
- b *0x000055555555519a
- c
- insert some input
- get the key value
As you can see from the screenshot in the register we have the value of the key so we can you that value to get the flag.
If you enjoy this post, please share it