学习PWN 在KALI系统安装 python2 的pip和pwn

因为很多pwn的exp都是用python2写的,为了方便,在Python2安装pip和pwn
首先安装pip
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py
分别输入这两条命令就可以装上

然后装pwntools
输入
sudo pip2 install pwntools
报了一堆错
Collecting intervaltree>=3.0
Using cached intervaltree-3.1.0.tar.gz (32 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-NfOBVC/intervaltree/setup.py’

error: invalid command ‘egg_info’
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

安装失败

网上搜索
说要安装capstone,
git clone https://github.com/aquynh/capstone
cd capstone
make
sudo make install
按顺序操作下来没有报错

然后安装pwntools
git clone https://github.com/Gallopsled/pwntools
cd pwntools
sudo python setup.py install
显示
You must install the Python development headers!
$ apt-get install python-dev

输入
sudo apt-get install python-dev

显示
*没有可用的软件包 python-dev,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
然而下列软件包会取代它:
python2-dev:i386 python2:i386 python2-dev python2 python-dev-is-python3
E: 软件包 python-dev 没有可安装候选

看到
https://blog.csdn.net/sorryagain/article/details/123932406
用这一条命令
python2 -m pip install --upgrade pwntools -i https://pypi.tuna.tsinghua.edu.cn/simple
安装以后就可以用pwntools了
-m好像是官方建议,会不容易报错
-i的意思是指定了下载源,后面是清华的下载源,会比较快

你可能感兴趣的:(学习,pip,python)