Giter Site home page Giter Site logo

rop's Introduction

ROP Playground

This Project helps to understand Return Oriented Programming (ROP). I've implemented a vulnerable server, written in C, and a client, written in JavaScript. The client can be used to send malicious messages to the server.

Let's start!

  1. Run make debug or make run to start the server
  2. Execute the attack with make attack

Note: If you use make run make sure to change the ROP gadget addresses in the client script. This has to be done because Address Space Layout Randomization (ASLR) randomly shifts your ROP gadgets. When you use a debugger ASLR is automatically turned off.

Explanation

When the server starts, it listens on port 1337 for messages with the following byte format:

0    1    2    3         n
+----+----+----+-- ... --+
| ps |  payload          |
+----+----+----+-- ... --+

ps represents the payload size of the message which is sent by the client. Unfortunately, the server doesn't validate incoming ps values. Besides, the buffer which stores the message payload can only hold up to 32 bytes.

When the attacker chooses a value of ps which is greater than 32, a buffer overflow occurs.

  1. Classic Buffer Overflow

  2. Stack Canaries

  3. ASLR

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.