|
| 1 | +# KerBug Debugger |
| 2 | + |
| 3 | +A lightweight, command-line debugger for Linux x86_64 binaries. |
| 4 | +Built with `ptrace` and pseudo-terminals, KerBug allows you to single-step through programs, inspect registers, and interact with the target process’s standard input/output. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Description |
| 9 | + |
| 10 | +KerBug is a minimalistic debugger designed for educational purposes and low-level system programming exploration. It demonstrates core debugging concepts such as: |
| 11 | + |
| 12 | +- Process tracing using `ptrace` |
| 13 | +- Register inspection (RIP, RSP, RBP, RDI, RSI) |
| 14 | +- Instruction-level single-stepping |
| 15 | +- Interaction with debugged processes via pseudo-terminals (PTY) |
| 16 | +- Dynamic attachment using `PTRACE_ATTACH` and `SIGSTOP` |
| 17 | + |
| 18 | +The project is intended as a learning tool for understanding how debuggers work internally. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Features |
| 23 | + |
| 24 | +- Step-by-step execution of instructions |
| 25 | +- Inspect CPU registers |
| 26 | +- Attach to running processes |
| 27 | +- Interact with program input/output |
| 28 | +- Simple and extensible command-line interface |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Compilation |
| 33 | + |
| 34 | +### Prerequisites |
| 35 | + |
| 36 | +- Linux (x86_64) |
| 37 | +- `g++` (GCC) |
| 38 | +- Standard development libraries |
| 39 | + |
| 40 | +### Build |
| 41 | + |
| 42 | +```bash |
| 43 | +g++ -o kerBug kerBug.cpp -lutil |
| 44 | +``` |
| 45 | +## Usage |
| 46 | +Example: |
| 47 | +```bash |
| 48 | +./kerBug |
| 49 | +``` |
| 50 | +```bash |
| 51 | +...after it runs enter the binary-path (e.g. /home/user/testprogram) |
| 52 | +``` |
| 53 | +## Screenshots |
| 54 | + |
| 55 | + |
| 56 | +## Target Audience |
| 57 | +- System programmers curious about debugger internals |
| 58 | +- Students learning Linux process control and ptrace |
| 59 | +- Security researchers exploring binary analysis tools |
| 60 | +- Hobbyists building custom debugging tools |
| 61 | +## Technical Details |
| 62 | +- Language: C++ (C++11/14) |
| 63 | +- Platform: Linux x86_64 |
| 64 | +- Interface: Command-line |
| 65 | +- Core APIs: ptrace, waitpid, fork, execve, pty |
| 66 | +## Credits |
| 67 | +Created by: |
| 68 | +Fabio Baensch |
| 69 | +GitHub: KernelPhantom-010 |
| 70 | +## Disclaimer |
| 71 | +```bash |
| 72 | +This project is intended for educational and research purposes only. |
| 73 | + |
| 74 | +Do not use this software to inspect or manipulate processes without proper authorization. |
| 75 | +Unauthorized use may violate local laws and regulations. |
| 76 | +The author assumes no liability for any misuse of this tool. |
| 77 | +``` |
0 commit comments