pwndbg/pwndbg

pwndbg

pwndbg dodaje widoki nad GDB dla procesu, który wolno ci debugować. Ta strona nie opisuje eksploita.

11 058·15 paź 2026PythonMIT

repository-open-graph

pwndbg

license
Tests
codecov.io
Discord

pwndbg (/paʊnˈdiˌbʌɡ/) is a GDB and LLDB plug-in that makes debugging suck less,
with a focus on features needed by low-level software developers, hardware hackers,
reverse-engineers and exploit developers.

It has a boatload of features, see our Features page
and CHEATSHEET (feel free to print it!). If you have any questions you may read the
documentation or asks us in our Discord server.

Want Pwndbg to keep moving fast, or, have us give a talk about it? Sponsor us!

Why?

Vanilla GDB and LLDB are terrible to use for reverse engineering and exploit development.
Typing x/30gx $rsp or navigating cumbersome LLDB commands is not fun and often provides
minimal information. The year is 2026, and core debuggers still lack many user-friendly
features such as a robust hexdump command. WinDbg users are completely lost when they
occasionally need to bump into GDB or LLDB.

Pwndbg is a Python module which can be loaded into GDB or run as a REPL interface for LLDB.
It provides a suite of utilities and enhancements that fill the gaps left by these debuggers,
smoothing out rough edges and making them more user-friendly.

Installation

See installation instructions.

What about ...?

Many past (gdbinit, PEDA) and present projects (GEF,
bata24/GEF) offer great features, but are hard to extend and are packaged
as large single files (103KB, 195KB, 423KB,
5.24MB). Pwndbg aims to replace them with a faster, cleaner, and
more robust implementation.

When to Use GDB or LLDB?

Pwndbg supports both GDB and LLDB, and each debugger has its own strengths.
Here's a quick guide to help you decide which one to use:

Use Case Supported Debugger
Debugging Linux binaries or ELF files GDB, LLDB
Debugging Mach-O binaries on macOS LLDB
Linux kernel debugging (qemu-system) GDB, LLDB
Linux user-space emulation (qemu-user) GDB
Embedded debugging (ARM Cortex M* or RISC-V/32) GDB, LLDB

Pwndbg ensures a consistent experience across both, so switching between them is seamless.

The LLDB implementation in pwndbg is still in early-stage and may contain bugs or limitations.

Known issues are tracked in GitHub Issues.

If you encounter any problems, feel free to report them or discuss on our Discord server.

Compatibility Table

Feature Supported Version Notes
pwndbg-gdb - Python 3.10+
- GDB 12.1+
Battle-tested on Ubuntu 22.04/24.04
pwndbg-lldb - Python 3.12+
- LLDB 19+
Experimental/early-stage support
qemu-user QEMU 8.1+ vFile API is needed for vmmap
qemu-system QEMU 6.2+ Supported version since Ubuntu 22.04

Contributing

Pull requests are welcome ❤️. Check out the Contributing Guide.

Acknowledgements

Pwndbg was originally created by Zach Riggle, who is no longer with us. We want to thank Zach for all of his contributions to pwndbg and the wider security community.



hide:

  • navigation

Setup

There are multiple ways to install Pwndbg, depending on how you want to use it. Skim the table of contents on the right to find your preferred installation method. We support both GDB and LLDB, Linux and MacOS! If you're a new user, we recommend the system install script. If you remember the times of yore you might prefer the ~/.gdbinit install.

To run the pwndbg binary from your pwntools scripts, set:

context.gdb_binary = "pwndbg"

Install Script

pwndbg-gdb

This will provide the pwndbg program. You can use it the same way you use gdb. To later update, just re-run the same command.
The script will install the latest portable release from our GitHub releases.

=== "System install"
Install the binary for all users of the system. This requires root permissions, and will invoke sudo.

=== "curl/sh"
    ```{.bash .copy}
    # (recommended)
    curl --proto '=https' --tlsv1.2 -LsSf 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb
    ```

=== "GNU wget/sh"
    ```{.bash .copy}
    wget --https-only --secure-protocol=TLSv1_2 -qO- 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb
    ```
=== "BusyBox wget/sh"
    ```{.bash .copy}
    wget -qO- 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb
    ```

??? info "Uninstalling"
    If you wish to uninstall, run
    ```{.bash .copy}
    sudo rm -r /usr/local/lib/pwndbg-gdb /usr/local/bin/pwndbg
    ```

=== "User install"
Install the binary for the current user. Root access not required.

=== "curl/sh"
    ```{.bash .copy}
    curl --proto '=https' --tlsv1.2 -LsSf 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb -u
    ```
=== "GNU wget/sh"
    ```{.bash .copy}
    wget --https-only --secure-protocol=TLSv1_2 -qO- 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb -u
    ```
=== "BusyBox wget/sh"
    ```{.bash .copy}
    wget -qO- 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb -u
    ```

??? info "Uninstalling"
    If you wish to uninstall, run
    ```{.bash .copy}
    rm -r ~/.local/lib/pwndbg-gdb ~/.local/bin/pwndbg
    ```

pwndbg-lldb

This installation method provides the pwndbg-lldb ./your-binary command.

=== "System install"
{.bash .copy} curl --proto '=https' --tlsv1.2 -LsSf 'https://install.pwndbg.re' | sh -s -- -t pwndbg-lldb

??? info "Uninstalling"
    If you wish to uninstall, run
    ```{.bash .copy}
    sudo rm -r /usr/local/lib/pwndbg-lldb /usr/local/bin/pwndbg-lldb
    ```

=== "User install"
{.bash .copy} curl --proto '=https' --tlsv1.2 -LsSf 'https://install.pwndbg.re' | sh -s -- -t pwndbg-lldb -u

??? info "Uninstalling"
    If you wish to uninstall, run
    ```{.bash .copy}
    rm -r ~/.local/lib/pwndbg-lldb ~/.local/bin/pwndbg-lldb
    ```

Install pwndbg from source

First things first, you need to have uv installed (and git and curl):

If you just want the most up-to-date Pwndbg, the simplest thing to do is just:

uv tool install git+https://github.com/pwndbg/pwndbg[gdb,lldb]

which gives you the pwndbg and pwndbg-lldb binaries. If you want to update, just re-run this command.

I want to use my system GDB / LLDB

If you don't want Pwndbg to use our up-to-date packaged+patched GDB and LLDB, but rather the GDB / LLDB from your system / package manager, you can install Pwndbg with:

# Assuming that your LLDB and GDB are compiled with the same python version :)
PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --python=$PY_VER  git+https://github.com/pwndbg/pwndbg

To view supported GDB and LLDB versions and compiling GDB from source, see these instructions.

System GDB, sourced from ~/.gdbinit

If you want the "classic" setup, where you run the gdb binary and Pwndbg is sourced from ~/.gdbinit you can do that like this:

PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --python=$PY_VER  git+https://github.com/pwndbg/pwndbg
echo "source $(uv tool dir)/pwndbg/share/pwndbg/gdbinit.py" >> ~/.gdbinit

In general, if you have the repository cloned you can run the same commands as in the above sections, but replacing git+https://github.com/pwndbg/pwndbg with . (the current folder) and adding --editable so changes in the source are reflected in the installation.

Lite install

If you are tight on disk space, there are some non-essential dependencies you can omit when installing. You can add the --excludes <(printf 'ziglang\ndecomp2dbg\nipython') argument to any of the uv tool install methods above to save you around ~300 MB.

For example, to get the previous install method with these dependencies omitted, you can run:

PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --excludes <(printf 'ziglang\ndecomp2dbg\nipython') --python=$PY_VER  git+https://github.com/pwndbg/pwndbg
echo "source $(uv tool dir)/pwndbg/share/pwndbg/gdbinit.py" >> ~/.gdbinit

??? info "Uninstalling"
For all of these methods, uninstall with
{.bash .copy} uv tool uninstall pwndbg
and remove the appropriate line from your ~/.gdbinit if necessary.

Other install methods

Homebrew

Install via Homebrew (macOS)

# pwndbg-gdb
brew install pwndbg/tap/pwndbg-gdb

# pwndbg-lldb
brew install pwndbg/tap/pwndbg-lldb

Nix

Install via the Nix package manager (Linux/macOS)

# pwndbg-gdb
nix shell github:pwndbg/pwndbg

# pwndbg-lldb
nix shell github:pwndbg/pwndbg#pwndbg-lldb

Install from a distro package files

When installing with GDB, you may also download a package file to install through your package manager of choice. Download the package from the releases page and pick the appropriate download from the second table.

=== "RPM"
RPM-based Systems (CentOS/Alma/Rocky/RHEL):
{.bash .copy} dnf install ./pwndbg-2026.09.15.x86_64.rpm
=== "DEB"
DEB-based Systems (Debian/Ubuntu/Kali):
{.bash .copy} apt install ./pwndbg_2026.09.15_amd64.deb
=== "Alpine"
{.bash .copy} apk add --allow-untrusted ./pwndbg_2026.09.15_x86_64.apk

=== "Arch Linux"
{.bash .copy} pacman -U ./pwndbg-2026.09.15-1-x86_64.pkg.tar.zst

Distro package repository

You may want to install Pwndbg through your distribution's package manager. This installation method is not officially supported because we cannot control the versions of the python dependencies Pwndbg uses in this case. Please use any other installation method when reproducing bug reports (portable package is probably simplest in this case). If a bug reproduces with a distro package but not with any of the supported installation methods, please report it to the package maintainer; if the problem cannot be fixed, let us know and we will add it to a list of known issues below.

=== "Arch"
{.bash .copy} sudo pacman -S pwndbg
Pwndbg will now be available with the pwndbg and pwndbg-lldb commands.

=== "Gentoo"
{.bash .copy} sudo emerge --ask dev-debug/pwndbg
Pwndbg will now be available with the pwndbg and pwndbg-lldb commands.


Manually install the Portable Version

You can manually download a portable release on the Pwndbg releases page. There are separate releases for GDB and LLDB. Use the first table to pick the appropriate download for your system architecture. You can then unpack the archive with:

tar -v -xf <archive-name>

And run Pwndbg with

./pwndbg/bin/pwndbg

or

./pwndbg/bin/pwndbg-lldb

depending on which version you installed. You may add the appropriate file to your shell's PATH.

??? note "Removing Quarantine Flags (macOS)"

When first setting up the portable version of Pwndbg in macOS, Gatekeeper will normally try to prevent
any code in the extracted files from running until the user explicitly allows each file to be run.
As we ship many files which would require this, the process of manually granting permission for each
one to be run can get quite tiresome.

In order to do this to all files at once, you may choose to run the following command, which removes
the quarantine flag from all extracted files at once:

```{.bash .copy}
xattr -rd com.apple.quarantine pwndbg
```

Assuming that the files were extracted to a folder called `pwndbg`.

Legacy install method

We still support a setup.sh script, but note it requires root as it calls sudo internally.

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

This will get you the same setup as in System GDB, sourced from ~/.gdbinit. You can update with git pull.

Setup for development

For getting setup for development, see contributing/Installing Pwndbg from source.

Czytaj oryginał · README · Setup

Repozytorium

https://github.com/pwndbg/pwndbg · Biblioteka