Skip to main content
Be Bitwise

Full Exploit Chain

Complete exploit: overflow a buffer to overwrite the return address, redirecting execution to attacker-controlled code that stores a marker value.

A full exploit chain combines multiple techniques into a working attack: first the attacker identifies a buffer overflow, then calculates the offset to the return address, fills the buffer with padding, and overwrites the return address with the address of their payload. When the vulnerable function returns, the CPU jumps to the attacker's code. This simulation walks through each stage of that process, showing how individual techniques from earlier modules combine into a complete exploit.

Simulator

Loading simulator...

Walkthrough Guide

  1. 1

    Set up the vulnerable function

    Do this: Step through the return address setup at address 203

    Watch for: Return address 15 stored at address 203

    This mimics a function's stack frame. The legitimate return address is 15. The attacker's goal is to replace this with their own address.

  2. 2

    Overflow with padding

    Do this: Step through the three STORE instructions writing zeros to addresses 200-202

    Watch for: Zeros fill addresses 200, 201, 202 (the buffer). Address 203 still holds 15

    The attacker fills the buffer with padding (zeros). The content does not matter — it just advances the write position toward the return address.

  3. 3

    Overwrite the return address

    Do this: Step through MOV R2, #4 / STORE [R0], R2

    Watch for: Address 203 changes from 15 to 4

    The attacker writes their chosen target address (4) over the return address. When the function returns, the CPU will jump to address 4 instead of 15.

  4. 4

    Verify and execute attacker code

    Do this: Step through the remaining instructions

    Watch for: R4 = 4 (confirming the hijack), R5 = 15 (attacker's marker value)

    R4 confirms the return address was changed. R5 = 15 is the attacker's 'proof of execution' marker. In a real exploit, this would be shellcode that opens a shell or downloads a payload.

Objectives

  • •Watch padding fill the buffer at addresses 200-202
  • •See address 203 change from 15 (safe) to 4 (attacker's target)
  • •Verify R4 = 4, confirming the return address was hijacked
  • •See R5 = 15 as the attacker's marker, proving code execution

Hints

  • This combines the buffer overflow from Module 15 with controlled redirection - the essence of every exploit