View on GitHub

TeachOverflows

A collection of programs intended for teaching buffer overflows

TeachOverflows

This is a collection of buffer overflow challenges intended to demonstrate the basic concepts. Compile as-is or add your own custom flags by updating flags.txt in the scripts folder and running ‘scripts/makeflags.sh’.

These programs are intentionally vulnerable and should not be exposed directly to a network the intention is to have them attacked.

Requirements

Instructions

Clone the repo:

$ git clone https://github.com/MyBagofTricks/TeachOverflows.git

Using make

make

Using Docker

docker build -t teach . && docker run -p 80:80 --hostname=TeachOverFlows -p2222:22 -it teach

The Game

Level Type Hint
level01 Practice Enter 60 characters
level02 Practice Enter the string at the correct offset
level03 Practice Enter the strings at the correct offsets
level04 BOF Enter the string, and overwrite the variable
level05 BOF Overflow the buffer and call winner()
level06 BOF Overflow the buffer and call winner()
level07 Format Overwrite the variable with the string, using less than 10 chars
level08 Format Overwrite the variable with 512
level09 Format Overwrite the variable with 0xCAFEF00D
level10 ROP Call the function with the correct argument
level11 ROP Call the first function with the correct arguments, then call ‘winner’
level12 Heap Just like a buffer overflow

Notes

If compiling challenges manually with gcc, use ‘-fno-stack-protector -no-pie’ to disable Address Space Layout Randomization and stack protections. Disabling globally can be done to simplify attacks on libc.

Execute as root to disable ASLR globally:

echo 0 > /proc/sys/kernel/randomize_va_space

Your “encryption” is bad!

Correct. Reversing it should be easy homework.

The Shellcoder’s Handbook: Discovering and Exploiting Security Holes

ISBN-10: 9780470080238 //ISBN-13: 978-0470080238

Sam Bowne’s CNIT 127 Exploit Development Course

Smashing The Stack For Fun And Profit

Protostar CTF