menu EDS
快速搭建一个pwn环境 python2
3431 浏览 | 2021-06-15 | 分类:pwn | 标签:

快速搭建一个pwn环境 python2

由于新版pwntools默认对接的是py3,但是大多数师傅还是习惯用py2来编写exp。而且py2和py3有着较大差异、脚本不能互通,且主流写法仍然是py2的语法。本教程不适用于ubuntu18,快速安装会导致libc2.27更新,添加double free检测,导致堆环境偏差过大,该版本建议找已经搭好了的师傅索要一份。

更换国内源

在ubuntu内搜索software & update,在源中找到other选项,找到国内源,挑一个自己喜欢的。
之后执行。

sudo apt-get update
sudo apt update

安装基础环境

sudo apt-get install lib32z1 lib32ncurses5 git
sudo apt-get install -y libffi-dev libssl-dev
sudo apt install python #新版本ubuntu可能不会集成py2,而且不能通过python-dev来获取

安装pip2

pip2不在apt库内,只能手动安装。
get-2.7.pip

curl http://www.ericdshen.com/2.7get-pip.py >2.7get-pip.py
sudo python 2.7get-pip.py

安装pwntools

python -m pip install -U setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple/
python -m pip install cryptography==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
python -m pip install pwntools -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装peda

git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit

至此一个简单的pwn环境就搭好了,如有其它需求可自行添加。

发表评论

email
web

全部评论 (共 1 条评论)

    EDS
    2022-05-21 15:58
    更新,再装之前需要这个python -m pip install capstone