Code Monkey home page Code Monkey logo

pku-pitfalls's Introduction

PKU Pitfalls

Requirements

  • CPU must support Intel PKU. This includes Skylake Server architectures chips e.g. Xeon Scalable series.
    • Note: Amazon's EC2 c5.large instance offers an easy way to access a PKU-capable CPU.
  • Linux kernel >= 4.9.0, compiled with PKU support enabled (e.g. recent Ubuntu or Debian).
    • Tested with Debian 8 kernel 4.9: sudo apt-get install linux-image-4.9.0-0.bpo.11-amd64 linux-headers-4.9.0-0.bpo.11-amd64
  • docker

Running

Build the docker image using the provided script:

./build.sh

Building the image also compiles all of the necessary components including ERIM itself and the PoCs.

Run the docker image:

./run.sh

The image will automatically run each PoC. Each PoC uses a common library called secure_lib. secure_lib is a minimal example of a library that allocates and uses isolated memory to protect a secret (the secret is in fact the hardcoded string S0_5ecr3T). Each PoC attempts to access the isolated memory without using a legitimate call gate. A successful PoC will access the secret and then print it out in the following format:

TRYING TO STEAL THE SECRET: S0_5ecr3T

This output indicates that the exploit succeeded and the untrusted component was able to access the protected memory without using a legitimate call gate. Most of the PoCs should be very quick with the exception of scan_race, which may take several minutes to run as it adjusts and tries different timing configuration.

Project Structure

  • The erim/ directory contains the original ERIM source code, with some changes to improve support for the ptrace-based sandbox.
  • pku_exploits/ contains proof-of-concepts for several attacks.
    • The code for each PoC lives in pku_exploits/exploits/
    • All PoCs can be tested by running make test in pku_exploits/

pku-pitfalls's People

Contributors

jaredthecoder avatar

Watchers

 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.