triplewings

pwn环境搭建手册

2022-02-28 · 2 min read
pwn_learning

快速搭建一个pwn手的工具机,后续可能会更新ropper,z3,angr等

[toc]

32位环境

sudo dpkg --add-architecture i386
sudo apt-get update
// install build tools
sudo apt install build-essential
sudo apt install gcc-multilib

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 -i https://pypi.tuna.tsinghua.edu.cn/simple

pwndbg

pwndbg

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

pwngdb

pwngdb

cd ~/
git clone https://github.com/scwuaptx/Pwngdb.git 
cp ~/Pwngdb/.gdbinit ~/

.gdbinit文件配置如下

source /home/pwnki/pwndbg/gdbinit.py 
#source ~/peda/peda.py //使用 pwndbg 就要把 peda 注释掉,反过来也一样
source ~/Pwngdb/pwngdb.py
source ~/Pwngdb/angelheap/gdbinit.py

define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end

glibc-all-in-one

glibc-all-in-one

git clone https://github.com/matrix1001/glibc-all-in-one.git

pwn_debug

pwn_debug

git clone https://github.com/ray-cp/pwn_debug.git
cd pwn_debug
sudo python setup.py install 

或许三台虚拟机也狠方便,一般用不上这个↑

ruby安装

ruby官网

tar -zxvf ruby-3.0.0.tar
cd ruby-3.0.0
sudo ./configure
sudo make
sudo make install

seccomp-tools

seccomp-tools

sudo gem install seccomp-tools

one_gadget

og

sudo gem install one_gadget

ctf_xinetd

ctf_xinetd

git clone https://github.com/Eadom/ctf_xinetd.git

glibc源码

增加ubuntu对应版本的glibc源码方便调试出问题

sudo apt-get install glibc-source
cd /usr/src/glibc/
sudo tar -xf glibc-2.27.tar.xz
cd ~/
sudo cp -r /usr/src/glibc/glibc-2.27/ ./

在.gdbinit添加常用文件

dir ~/glibc-2.27/stdlib
dir ~/glibc-2.27/malloc
dir ~/glibc-2.27/libio
dir ~/glibc-2.27/stdio-common
RSS