Linux pwn环境搭建

1.安装pwntools

sudo apt-get update
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pwntools
echo export PATH="/home/`whoami`/.local/bin:\$PATH" >> ~/.zshrc

2.安装pwngdb

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

3.安装splitmind(可选)

cd ~/.local
git clone https://github.com/jerdna-regeiz/splitmind
echo "source $PWD/pwndbg/gdbinit.py" >> ~/.gdbinit
cat << EOF >> ~/.gdbinit
python
import splitmind
(splitmind.Mind()
#.below(display="backtrace")
.above(display="stack")
.right(display="regs")
.right(of="main", display="disasm")
.show("legend", on="disasm")
).build()
end
EOF