PWN 环境配置(Ubuntu系统)
如果不清楚从github上下载的工具的使用方法,可以在项目根目录下查看README文档
vscode
在Ubuntu 软件中心下载vscode(记得换成国内源,不会的话去搜索教程)
下载之后启动并安装python扩展
pip换源(阿里源)
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
pwntools
sudo apt-get update
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install --upgrade pwntools
Pwngdb (注意和pwndbg区分)
cd ~/
git clone https://github.com/scwuaptx/Pwngdb.git
cp ~/Pwngdb/.gdbinit ~/
pwndbg
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
sudo ./setup.sh
Pwngdb和pwndbg安装完之后输入
vim ~/.gdbinit
将文件修改成下面的内容然后保存
source ~/pwndbg/gdbinit.py
source ~/Pwngdb/pwngdb.py
#source ~/peda/peda.py
source ~/Pwngdb/angelheap/gdbinit.py
define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end
接着在终端输入gdb命令,如果回显是pwndbg>
说明安装成功
ROPgadget
pip install ropgadget --user
one_gadget
sudo apt-get install ruby-dev
gem install one_gadget
glibc-all-in-one
git clone https://github.com/matrix1001/glibc-all-in-one
python3 update_list
cat list #查看可下载的glibc文件名
./download 2.33-0ubuntu5_amd64
patchelf
git clone https://github.com/NixOS/patchelf
./bootstrap.sh
如果报错,则:
sudo apt-get install autoconf automake libtool
继续执行
./bootstrap.sh
./configure
make
sudo make install
make check
使用方法
patchelf --set-interpreter /lib64/33_5-linux.so.2 ./chunk_extend_2
patchelf --replace-needed libc.so.6 /home/your_name/glibc-all-in-one/libs/2.33-0ubuntu5_amd64/ld-2.33.so ./chunk_extend_2
#libc.so.6为需要替换的libc路径 第二个参数是需要加载的glibc的目录 chunk_extend_2 是二进制文件
ldd ./bin #查看elf的ld和libc
free_libc
git clone https://github.com/dsyzy/free-libc
# git成功后在项目里打开终端输入下面命令
chmod +x clibc install.sh
sudo ./install.sh
标签:sudo,install,Pwngdb,配置,pip,git,pwndbg,Ubuntu,PWN
From: https://www.cnblogs.com/S1nyer/p/17994090