Giter Site home page Giter Site logo

like-dbg's Introduction

LInux-KErnel DeBuGger (LIKE-DBG)

VERY MUCH IN POC/WIP STATE

This repository aims at automating the boring steps when trying to set up a Linux kernel debugging environment. All steps from building the kernel to running the kernel and attaching the debugger are transparently done inside docker containers to keep system requirements minimal. Currently there's a dedicated docker container for every step:

  • Building the kernel
  • Creating a root file system to use with the earlier build kernel
  • A debuggee container that launches QEMU with our custom kernel + rootfs
  • A debug container that houses the debugging logic

Caveats

  • Currently only x86_64 and arm64 Linux kernel builds are supported
  • Only recent kernel builds will likely succeed building due to how the requirements for the toolchain differs between versions
  • No android kernel support right now
  • Fine-tuning of GDB environment (e.g. custom breakpoints) missing

Features

  • Automated kernel/root file system builds based on config.ini
    • Multi-arch: x86_64 and arm64
    • Kernel compilation modes (generic, syzkaller) + custom flag support
    • Building of kernel from
      • Commit id
      • Release tag, or
      • <major>.<minor>.<patch>-version
    • Applying patch files
  • Debugger powered by: GDB + gef
  • QEMU runtime options for the kernel like kaslr, smep, smap, kpti, and others
  • Re-use builds
    • Images
    • root file systems
    • kernels
  • Minimal host system requirements

Requirements

  • docker (may work with podman as well)
  • tmux
  • python>=3.7
    • venv

Configuration

Everything is configured in the config.ini Some fields should not be altered but in general the fields that are of interest to create a custom-tailored kernel debugging environment should be self explanatory.

Once you're set, executing the commands below should drop you into a 3-tile tmux configuration with a booted kernel in QEMU, an attached GDB debugger, and one terminal for free allocation

$ tmux
$ python3 -m venv .like-dbg
$ source .like-dbg/bin/activate
$ python3 -m pip install --upgrade pip
$ python3 -m pip install -r requirements.txt
$ python3 start_kgdb.py

Showcase

img/example.png

like-dbg's People

Contributors

0xricksanchez 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.