https://app.hackthebox.com/challenges/92

Description

Show us your basic skills! (P.S. There are 4 ways to solve this, are you willing to try them all?)

Exploitation

To retrieve the flag, you can choose one of the following methods:

  • Decompile the binary and analyze the main function.
  • Use ltrace to determine the correct strcmp value and run the program with the expected input.
  • Execute the following command to extract and reconstruct the flag directly:
objdump -D baby | grep -E "movabs.*0x|movl.*0x|movw.*0x" | grep -oE "0x[[:alnum:]]{4,16}" | while read -r line; do
  printf "%s" "${line:2}" | xxd -r -p | rev 2>/dev/null
done

Summary

Baby RE: trace the binary, isolate the validation routine, and invert it to recover the flag.