WCU / Cybersecurity
~/CSC 472/Class 03/KP 07
Class 03 · KP 07 / 17

Hijacking Control Flow

  • When a function returns, ret pops the saved return address into RIP and jumps there.
  • If we overwrote that saved address, ret jumps to our chosen location.
  • We did not change any code — we changed where execution goes next.
Key Takeaway

Control-flow hijack = the attacker chooses the value of the instruction pointer by corrupting a saved return address.