Pwn环境搭建


#安装python3
sudo apt --only-upgrade install python3

#安装python2
sudo apt install python2

#python版本切换
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2


#查看glibc版本
getconf GNU_LIBC_VERSION

#安装git、vim、checksec
sudo apt install git
sudo apt install vim
sudo apt install checksec

#安装gdb
cd ~
sudo apt install gdb
gdb -v

#安装pwndbg
cd ~
git clone https://github.com/pwndbg/pwndbg.git
cd ~/pwndbg
./setup.sh
若遇到 error: subprocess-exited-with-error
将python2设置为默认即可

#安装pwngdb
git clone https://github.com/scwuaptx/Pwngdb.git

#融合pwngdb与gwndbg的功能
vim ~/.gdbinit
source /home/lighthouse/pwntools/pwndbg/gdbinit.py
source /home/lighthouse/pwntools/Pwngdb/pwngdb.py
source /home/lighthouse/pwntools/peda/peda.py
source /home/lighthouse/pwntools/Pwngdb/angelheap/gdbinit.py

#安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
sudo python3 get-pip.py    # 运行安装脚本
#安装pwntools
pip install pwn -i http://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn


#安装ROPgadget
sudo pip3 install capstone
git clone https://github.com/JonathanSalwan/ROPgadget.git
cd ROPgadget
sudo python3 setup.py install
#安装one_gadget
sudo apt install -y ruby ruby-dev
sudo gem install one_gadget