# pwndbg **Repository Path**: sakana_ctf/pwndbg ## Basic Information - **Project Name**: pwndbg - **Description**: pwndbg (/poʊndbæg/) 是一个GDB插件, 它使GDB的调试不会那么糟糕, 重点添加了底层开发者, 黑客, 逆向工程师与漏洞开发人员所需的功能. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-24 - **Last Updated**: 2023-12-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pwndbg [English](./README.md)|中文 [![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://choosealicense.com/licenses/mit/) [![Unit tests](https://github.com/pwndbg/pwndbg/actions/workflows/tests.yml/badge.svg?branch=dev&event=push)](https://github.com/pwndbg/pwndbg/actions/workflows/tests.yml) [![Discord](https://img.shields.io/discord/843809097920413717?label=Discord&style=plastic)](https://discord.gg/x47DssnGwm) `pwndbg` (/poʊndbæg/) 是一个GDB插件, 它使GDB的调试不会那么糟糕, 重点添加了底层开发者, 黑客, 逆向工程师与漏洞开发人员所需的功能. 它有很多功能, 详见[FEATURES.md](./FEATURES.md). ## 为什么? Vanilla GDB用于逆向工程和开发非常糟糕. 输入`x/g30x $esp`并不有趣,也无法提供更多信息. 现在要2024年了, GDB仍然缺乏一个真正的hexdump命令! GDB的语法晦涩难懂. 当Windbg的用户偶尔需要碰到GDB时, 他们根本找不到思路. ## 哈? Pwndbg是直接加载进GDB中的Python模块, 它提供了一套实用程序和辅助工具以破解GDB的所有漏洞并平滑粗糙的边缘. 过去到现在的其他许多项目(如[gdbinit][gdbinit], [PEDA][PEDA])都填补了这些空白. 每个项目都提供了出色的功能以供使用, 但它们很难扩展(有些已不再维护, 大部分都是[100KB][gdbinit2], [200KB][peda.py]或[363KB][gef.py]大小文件). Pwndbg的存在不仅是为了取代它的前辈, 更希望有一个干净的方法, 可以快速运行, 对奇怪的各种使用方法进行兼容. 它还自带了python仓库, 你只需要运行`setup.sh`便可以使用它的功能. [gdbinit]: https://github.com/gdbinit/Gdbinit [gdbinit2]: https://github.com/gdbinit/Gdbinit/blob/master/gdbinit [PEDA]: https://github.com/longld/peda [peda.py]: https://github.com/longld/peda/blob/master/peda.py [GEF]: https://github.com/hugsy/gef [gef.py]: https://github.com/hugsy/gef/blob/master/gef.py ## 怎么使用? 对于存在第三方库的情况, 可以直接跳转到[便携安装](#便携安装)部分. 当然从源代码安装也非常简单: ```shell git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh ``` 或者通过Nix软件包管理器进行安装(您可以在任何发行版上使用Nix): ```shell nix shell github:pwndbg/pwndbg pwndbg ./your-binary ``` Ubuntu 20.04和GDB 9.2及更高版本的22.04支持Pwndbg。我们不在任何旧版本的Ubuntu上进行测试,因此“pwndbg”可能无法在这些版本上运行(对于Ubuntu 18.04,请使用[2023.07.17:ubuntu18.04-最终版本](https://github.com/pwndbg/pwndbg/releases/tag/2023.07.17))。我们可能会根据具体情况接受解决旧版本问题的拉取请求,请在[Discord](https://discord.gg/x47DssnGwm)上与我们讨论。你也可以随时从Canonical仍然支持你感兴趣的Ubuntu版本的时候签出一个旧版本的`pwndbg`(看不懂喵), 或者你可以尝试直接从源代码构建一个新的GDB。(前面看不懂的部分英文我已给出: You can also always checkout an older version of `pwndbg` from around the time the Ubuntu version you're interested in was still supported by Canonical) 其他Linux发行版也通过`setup.sh`得到支持,包括: * Debian-based OSes (通过apt-get) * Fedora and Red Hat (通过dnf) * Clear (通过swiped) * OpenSUSE LEAP (通过zypper) * Arch and Manjaro (通过社区的AUR包或者pacman包) * Void (通过xbps) * Gentoo (通过emerge) 如果你使用ubuntu以外的其他发行版, 推荐使用[最新版本的GDB](https://www.gnu.org/software/gdb/download/)去构建它: ``` cd mkdir build cd build ../configure --disable-nls --disable-werror --with-system-readline --with-python=`which python3` --with-system-gdbinit=/etc/gdb/gdbinit --enable-targets=all make -j7 ``` ## 便携安装: 一些发行版包含了所有必要的依赖项, 无需安装其他软件包即可工作. ### 通过包安装 从[Pwndbg发布页面](https://github.com/pwndbg/pwndbg/releases)选择所需版本进行下载. 为系统结选择适当的版本(x86_64或aarch64). ### 从RPM-based类系统进行安装(CentOS/Alma/Rocky/RHEL): ```shell dnf install ./pwndbg-2023.07.17.x86_64.rpm # pwndbg ``` ### 从DEB-based系进行安装(Debian/Ubuntu/Kali): ```shell apt install ./pwndbg_2023.07.17_amd64.deb # pwndbg ``` ### 在Alpine系统进行安装: ```shell apk add --allow-untrusted ./pwndbg_2023.07.17_x86_64.apk # pwndbg ``` ### 在Arch Linux系统进行安装: ```shell pacman -U ./pwndbg-2023.07.17-1-x86_64.pkg.tar.zst # pwndbg ``` **备注:** 以下内容非pwndbg官方编写, 由VY开源中国提供:[关于Archlinux安装时存在的问题](https://gitee.com/sakana_ctf/pwndbg/wikis/关于Archlinux安装时存在的问题) ### 在Generic Linux进行安装: ```shell tar -v -xf ./pwndbg_2023.07.17_amd64.tar.gz # ./pwndbg/bin/pwndbg ``` ## 我能做些什么? 有关特性/功能的更多信息,请参阅[FEATURES](./FEATURES.md). ## 谁? Pwndbg是一个开源项目,由[许多贡献者](https://github.com/pwndbg/pwndbg/graphs/contributors)参与维护! Pwndbg最初由[Zach Riggle](https://github.com/zachriggle)进行开发, 他已经离开了. 我们要感谢Zach为Pwndbg和更广泛的安全社区所做的一切贡献. 想一起参与开发吗, 请阅读[CONTRIBUTING](./.github/CONTRIBUTING.md) 或者 [加入我们的Discord服务器](https://discord.gg/x47DssnGwm)! ## 怎么参与开发? 要在本地运行测试,您可以在docker中执行此操作,只需在克隆repo后运行 ```shell docker-compose run main ./tests.sh ``` 免责声明-这操作可无法用在Mac上. ## 联系 如果你有任何觉得不值得[提交在issues](https://github.com/pwndbg/pwndbg/issues)上的问题, 可以直接在[Discord](https://discord.gg/x47DssnGwm)询问以上成员.