Giter Site home page Giter Site logo

buffer_overflow_example's Introduction

Buffer_Overflow_Example

Code to Demonstrate Buffer Overflow Vulnerability in Simple Authentication Apps

This Authentication App Written in C is vulnerable to Buffer Overflow Attack. This Code was Specifically Made to Demonstrate this. This shows How Not to Do Authentication in Basic C Codes. Written as a teenage guy just starting to explore cybersecurity.

In Real Life Scenario, this kind of attack is carried out much more differently. this is just overly simplifying things. In real life , the buffer will contain a Payload With a shellcode and when that is executed, we might get root access to the machine. it can be used for many types of exploits including privilege escalation!

This Code Demonstrates The Buffer Overlow Vulnerability in this Authentication app. To log in and get the "Welcome" Message, the user must type the right password

"somestupidpassword!" - password

The Function compares the password to the supplied string(password) and authenticates the user if the password is right.

The Exploit is in STRCPY Function. It does not map the size of the character array and hence lets us overwrite the memory in parts that we were not supposed to write to. Normally that would cause a Segmentation Fault, But if the Variables are arranged in a specific order in the Stack,then it causes STRCPY to overwrite them!

Stack Cookie

Simple code which adds a 8 bit character as "Stack Cookie" and poses a challenge for user to crack.

buffer_overflow_example's People

Contributors

harshvaragiya avatar

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.