Skip to main content

4. Swapper (PLT/GOT)

Challenge Overview

In this challenge, you’ll be working with a simple C program that manipulates an array of numbers. Your task is to identify and exploit an out-of-bounds vulnerability in the program to read the contents of flag.txt, which exists in the same directory as the binary.

Hint: You should employ PLT/GOT to successfully exploit the vulnerability.

Out-of-Bounds Vulnerability

An out-of-bounds vulnerability occurs when a program accesses memory outside the boundaries of a valid buffer or array. This can happen when the program fails to check if an index is within the valid range before accessing an element in an array. Exploiting this vulnerability can lead to unexpected behavior or even allow you to manipulate parts of the program’s memory that should not be accessible.

Submission

Once you've successfully obtained the flag, submit it to our CTF server (link to be provided soon).