CYBR 358 · Cyber Operations
Buffer Overflow
A two-week take-home lab: overflow a stack buffer, return into win(), then turn on each modern mitigation and record which ones stop you.
What this lab is
The package below is the whole lab. The graded handout, the worksheet you submit, the vulnerable source, and the container that builds it are all inside it; this page exists so the lab can be found and cited the same way as every other lab in the course.
What you do
You overflow a stack buffer in a small program and redirect its return address into a win() function. That technique is called ret2win. You then rebuild the same program with each modern defense switched on, one at a time, and write down which defenses stop the attack and which do not. The last section asks you to fix the bug in the source.
What is in the package
Buffer Overflow.pdf— the graded handout, including the troubleshooting section.Buffer Overflow - Student Worksheet.docx— what you fill in and submit.lab/Dockerfile— the identical environment for everyone.lab/src/—vuln.c, the correctedvuln_fixed.c, thewin()stub, and the Makefile that builds the baseline and every mitigation branch.lab/solve.example.py— an exploit scaffold with the blanks left for you.lab/hints/— four hint files. Open them freely, in order, with no penalty.lab/lab-doctor.sh— the environment check to run first.
Getting started
docker build -t cybr358-bof lab/
docker run --rm -it cybr358-bof
/lab/lab-doctor.shIf every line of the environment check reads [ok], you are ready. If not, fix the failing checks before you start; the handout explains each one. On an Apple Silicon Mac the debugger may not work under emulation — the handout describes the x86-64 virtual machine route instead.
Submitting
Your completed worksheet, your payload.bin, your solve script, and your evidence, exactly as the handout describes. A correctly reported result earns the points; an invented result earns zero.
Scope
Everything you attack lives inside the container that ships with this lab. Do not point any of it at a machine you do not own.