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

Description

Even Mr. Miyagi cannot seem to beat this game. Flap your wings and show him the way!

Exploitation

Running the Game

To start the game, run it using Wine:

wine HackyBird.exe

Using scanmem for Exploitation

  1. Attach scanmem to the game’s process:
sudo scanmem -p "$(pidof HackyBird.exe)"
  1. Search and modify in-game values:
  • Begin by scanning the initial value, typically 0, and update as the game progresses.
  • Example workflow:
0   # initial value  
1   # after scoring  
1   # wait for another state update to further narrow down results  
2   # after the next scoring  
  • Narrow down results by searching for the updated value after each event (e.g., scoring). scanmem filters results by comparing values from the previous scan to the current state, focusing on changes between the last and current value within that time frame.
  1. Modify the memory value:
  • Set the desired value, such as 999:
set 999
  • Alternatively, set every second:
set 999/3
  1. If feeling lucky, modify all found values to speed up the process (may cause crashes):
set 999

Summary

Hacky Bird: inspect the game logic, control the relevant state, and recover the flag.