Overview
A 64-bit ELF binary with PIE enabled. The program asks for a hex offset from main and executes a function call to it.
Reconnaissance
Disassembling the binary with objdump reveals three functions:
main(offset0x127e)get_flag(offset0x12ed)print_flag(offset0x11e9)
Exploitation Strategy
The logic computes: Target = main + user_input.
Since the relative distance between print_flag and main is constant regardless of PIE randomization, we compute:
0x11e9 - 0x127e = -0x95
By sending -95 (hex -0x95) to the prompt, we trigger a call directly into print_flag.
Solution Code
echo '-95' | nc 20.197.42.57 2223Flag
CrackOn{-OFfSeT}