Giter Club home page Giter Club logo

seccomp's Introduction

Summary
This is a proof-of-concept for the generation of eBPF-based Linux seccomp profiles for syscall filtering using Symbolic execution. The generator receives a x86_64 Linux binary as an input and analyzes which syscalls as well as which syscall arguments it uses. Then, at startup, the binary can load the previously generated seccomp profile into the kernel (eBPF code) which from then on intercepts any syscalls made by the process. When it encounters a syscall/syscall argument combination that does not match with what was found during analysis, it kills the process. The motivation for this generator is to have simple tooling for developers to harden their Linux binaries against remote code execution attacks.

Usage
Generation of the seccomp profile consists of two steps:

  1. The target x86_64 Linux binary is provided to the analyse.py script. This generates a JSON which describes valid syscall/syscall argument combinations.
  2. The builder.cpp application (pre-compiled for convenience) takes the JSON as an input and generates a eBPF-based seccomp profile using libseccomp.

Several example sources and binaries are provided in the examples/ directory.

Caveats
Since this is a proof-of-concept, don't use it in production, obviously. Symbolic execution suffers from the path explosion problem which I deal with by exploring the binary backwards, from the call sites of the syscalls down the call stack. This process makes certain assumptions about the binary's layout, specifically in regards to control flow graph restoration. Thus, anything with complex control flow such as dynamic code execution (e.g. JIT compiler) will certainly fail. Also, I did not implement support for dynamic libraries.

seccomp's People

Contributors

shilch avatar

Stargazers

 avatar  avatar  avatar  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.