HackTheBox Golfer Challenge
Explore the basics of cybersecurity in the Golfer Challenge on Hack The Box. This easy-level Challenge introduces encryption reversal and file handling concepts in a clear and accessible way, perfect for beginners.
https://app.hackthebox.com/challenges/378
Description#
A friend gave you an odd executable file, in fact it is very tiny for a simple ELF, what secret can this file hide?
Exploitation#
Steps Taken for Binary Modification#
Using Hexadecimal Editing:#
- Dump the binary to a hexadecimal file for editing:
xxd -p golfer > golfer.hex - Edit the hexadecimal file:
- Open
golfer.hexin a text editor. - Locate and replace the sequence
e9d6000000withe900000000to modify the binary’s behavior.
- Open
- Rebuild the patched binary from the edited hexadecimal file:
xxd -r -p golfer.hex golfer.patched - Set execute permissions on the new binary:
chmod +x golfer.patched - Run the patched binary to observe the changes:
./golfer.patched
Using radare2:#
- Open the binary with radare2 with relocation adjustments and write permissions:
sudo r2 -e bin.relocs.apply=true -w ./golfer - Navigate to the specific address and modify the instruction:
s 0x0800004c # Seek to the desired address pd 1 # Display the current instruction wao nop # Replace the instruction with NOP pd 1 # Display the modified instruction q # Quit radare2 - Execute the modified binary:
./golfer
Summary#
The Golfer Challenge provides a hands-on introduction to basic exploitation and file manipulation techniques. By manipulating the assembly, you can navigate to where the flag is hidden. This challenge is a great starting point for beginners in cybersecurity.
Read other posts