https://github.com/0xricksanchez/like-dbg Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Copilot + Packages + Security + Code review + Issues + Discussions + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Skills + GitHub Sponsors + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} 0xricksanchez / like-dbg Public * Notifications * Fork 12 * Star 268 Fully dockerized Linux kernel debugging environment License MIT license 268 stars 12 forks Star Notifications * Code * Issues 6 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights 0xricksanchez/like-dbg This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 1 tag Code * Clone HTTPS GitHub CLI [https://github.com/0] Use Git or checkout with SVN using the web URL. [gh repo clone 0xrick] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @0xricksanchez 0xricksanchez Linter errors + code formatting (#15) ... d2d7b10 Aug 11, 2022 Linter errors + code formatting (#15) * remove linting errors * Disabled check E203 as it clashes with black * blacked the kernel_build again... d2d7b10 Git stats * 24 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows img io/scripts src .dockerfile_android .dockerfile_base .dockerfile_dbg .dockerfile_dbge .dockerfile_kbuilder .dockerfile_rootfs .dockerignore .flake8 .gitignore .hist .tmux.conf LICENSE README.md config.ini pyproject.toml requirements.txt start_kgdb.py View code LInux-KErnel DeBuGger (LIKE-DBG) Caveats Features Requirements Configuration Showcase README.md 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 o [*] Commit id o [*] Release tag, or o [*] ..-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 About Fully dockerized Linux kernel debugging environment Topics linux docker debugging kernel exploit linux-kernel gdb pwn exploit-development Resources Readme License MIT license Stars 268 stars Watchers 6 watching Forks 12 forks Releases 1 Init Latest Aug 9, 2022 Packages 0 No packages published Contributors 2 * @0xricksanchez 0xricksanchez 434b * @SikkiLadho SikkiLadho Mushahid Hussain Languages * Python 77.0% * Shell 22.5% * GDB 0.5% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.