ubuntu64位系统安装
ubuntu下载官网:Enterprise Open Source and Linux | Ubuntu
打开创建新的虚拟机
选择稍后安装操作系统
选择ubuntu64位
选择要安装的路径
打开CD/DVD选项
选择ubuntu的镜像
完成后开启虚拟机
选择中文简体
重启之后即可使用安装的系统
pwntools安装
sudo apt-get update
sudo apt-get install python3 python3-pip
sudo apt-get install libc6-dev-i386 libffi-dev
pip3 install pwntools
pwndbg安装
确保系统上已经安装了以下软件包:
- Python 2.7 或 Python 3.x
- GDB(GNU Debugger)调试器
- Git
克隆 pwndbg 存储库
在命令行中执行以下命令,克隆 pwndbg 存储库到本地:git clone https://github.com/pwndbg/pwndbg
安装 pwndbg进入克隆的存储库目录:cd pwndbg
运行安装脚本:./setup.sh
libcsearcher动态库安装
从 libcsearcher 的存储库中获取源代码。通过以下命令克隆 libcsearcher 存储库:
git clone https://github.com/lieanu/libcsearcher.git
进入 libcsearcher 目录 ,使用 cd
命令进入 libcsearcher 目录:cd libcsearcher
编译 libcsearcher,在终端中,执行以下命令来编译 libcsearcher:make
安装 libcsearcher,继续在终端中执行以下命令来安装 libcsearcher 动态库:sudo make install
验证安装为了验证 libcsearcher 是否成功安装,你可以创建一个简单的 C 程序,并在其中使用 libcsearcher 动态库的功能。
#include <stdio.h>
#include <stdlib.h>
#include <libcsearcher.h>
int main() {
libcsearcher_init();
printf("Libc base address: 0x%lx\n", libcsearcher_base());
printf("System address: 0x%lx\n", libcsearcher_symbol("system"));
libcsearcher_cleanup();
return 0;
}
保存文件后,使用以下命令编译并运行该程序:
gcc example.c -o example -lcsearcher
./example
如果一切正常,能够看到打印出的 libc 基址和 system 函数的地址。