GDB
GDB is the GNU debugger; it lets you run, pause and inspect programs, which is fundamental for debugging and binary exploitation learning.
Legal & ethical use. Use this tool only on systems, networks and data that you own or have explicit written permission to test. Unauthorised access or scanning can break computer-misuse laws (for example Pakistan's Prevention of Electronic Crimes Act, 2016, and equivalents elsewhere). Practise in your own lab or in authorised environments such as CTFs.
What it is used for
- Debug your own C programs
- Inspect registers and memory when solving binary CTFs
Key features
- Breakpoints and stepping
- Memory and register inspection
- Scripting and remote debugging
Installation
Install from your distribution (`sudo apt install gdb`).
Beginner usage guide
Compile a small C program with -g, start it under gdb, set a breakpoint at main and step through.
Example commands
Run these only against your own lab or authorised targets. Placeholder addresses such as 192.0.2.x are documentation ranges.
Start a program under GDB
gdb ./a.outInside GDB use `break main`, `run`, `next`, `info registers`.
References
Source verification
Last reviewed: 2026-10-27
Links checked over HTTP: 2026-10-27 07:51 UTC — official: 200, docs: 200, repo: 200
Command flags checked against the real binary gdb (GNU gdb (Debian 17.2-1+b1) 17.2) on 2026-10-27.
