pwn环境的配置

ubuntu64位系统安装

ubuntu下载官网:Enterprise Open Source and Linux | Ubuntu

打开创建新的虚拟机

选择稍后安装操作系统

选择ubuntu64位

选择要安装的路径

打开CD/DVD选项

选择ubuntu的镜像

 完成后开启虚拟机

选择中文简体

重启之后即可使用安装的系统

pwntools安装

sudo su
apt-get update
apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
sudo apt-get update
sudo apt-get install python3 python3-pip
sudo apt-get install libc6-dev-i386 libffi-dev
pip3 install pwntools

pwndbg安装

确保系统上已经安装了以下软件包:

  1. Python 2.7 或 Python 3.x
  2. GDB(GNU Debugger)调试器
  3. 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 函数的地址。

  • 22
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值