Git Product home page Git Product logo

buffer-overflows's Introduction

Introduction to buffer overflows

As a first project for my University's Computer Security course I was tasked to find and exploit buffer overflow vulnerabilities on three different simple programs.

Prerequisites

Before diving into buffer overflows you should be familiar with:

  • Basic C/C++ understanding.
  • Linux permissions.
  • Basic Assembly knowledge.
  • GDB and program memory allocation (stack, frames).

The GNU project debugger (a.k.a. GDB) is especially useful and since I won’t go into details on how to use it, if you’re not familiar with go check the docs or any good tutorial. The parts that are useful to this project are: disassembling the program, inspecting variable content and print frame information such as saved return address.

Now you can start reading about buffer overflows here.

(also the GDB manual here)

The scenario

There are three other users on the same Linux machine so the /home directory looks like this:

jason@linux /home $ ls

hyperuser jason masteruser superuser

Each of the users (superuser, hyperuser, masteruser) have an executable on their home directory which can be executed by other users and runs with the suid bit enabled. That means that when executed the program will have the owners privileges and not the privileges of the user executing it.

Each user also have a secret.txt file which can be read only by him.

Aim of the project

The goal is to introduce students to buffer overflow vulnerabilities. In order to reveal the final secret, each of the three secrets from superuser, hyperuser and masteruser must be combined.

Each of the executables have a different flaw that must be exploited with the ultimate goal in each case to create a Shell running with the victim's privileges.

  • superuser: he has the convert.c program without any protection against buffer overflows and is the easiest target.
  • hyperuser: has the arpsender.c program which uses a canary to protect against buffer overflows. (not ready yet)
  • masteruser: has the zoo.cpp program that must be exploited using the VPTR. (not ready yet)

Links

  • Computer Security course website
  • Course slides on b.o. here
  • "Smashing the stack for fun and profit" great introduction to buffer overflows here.

License

MIT License - fork, modify and use however you want.

buffer-overflows's People

Contributors

jasonpap avatar lemondmn2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

buffer-overflows's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.