Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.
/ memory-errors-lab Public archive

Virtual machine + repository of typical memory errors for teaching computer security courses.

Notifications You must be signed in to change notification settings

phretor/memory-errors-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Error Primer

Code snippets and virtual machine that I use for teaching purposes.

Getting Started

Step 1: Clone this repository

$ git clone https://github.com/phretor/memory-errors-lab.git

Step 2: Install VirtualBox according to your host operating system's recommended procedure.

Step 3: Install Vagrant (instructions here).

Step 4: Start the virtual machine:

$ cd memory-errors-lab/linux64
$ vagrant plugin install vagrant-vbguest
$ vagrant up

If you want to skip the vbguest plugin installation, you'll have to setup the VirtualBox guest additions yourself.

Step 5: Start hacking:

$ vagrant up
$ vagrant ssh

GCC Options

When compiling, the following options are recommended:

-fno-stack-protector           # disables stack-smashing protection
-z execstack                   # enables executable stack
-mpreferred-stack-boundary=2   # aligns memory allocation to 2^2 bytes
-m32                           # compile as 32-bitx86 elf file

Since the -mpreferred-stack-boundary=2 option affects how the machine allocates memory on the stack, it also affects the displacement calculation when preparing format string exploits. Therefore, disabling this option is recommended when practicing with format string bugs.

About

Virtual machine + repository of typical memory errors for teaching computer security courses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages