为了简洁快速,我安装server版 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/16.04/ubuntu-16.04.7-server-amd64.iso
1.虚拟机断网(减少网络请求),然后安装, 5分钟就好了
2.配置ip自动获取
ifconfig interface ens33(改成你的) dhcp start
sudo /etc/init.d/networking restart
3.安装ssh, 用ssh连接后, 就能复制粘贴了,修改源
sudo apt install openssh-server
sudo vi etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
4.按顺序执行以下安装
# 先断网安装
sudo apt update
sudo apt-get install gcc python3-dev curl -y
curl -x http://192.168.247.1:1081 "https://bootstrap.pypa.io/pip/3.5/get-pip.py" -o "get-pip35.py"
mkdir ~/.pip;cat <<EOT >> ~/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
EOT
python3 get-pip35.py --user
pip3 install pwntools
sudo apt install -y gdb
sudo apt install -y open-vm-tools open-vm-tools-dkms
上面的脚本可优化成下面:(未测试)
sudo apt install openssh-server
sudo apt update
sudo apt install -y gcc python3-dev curl gdb open-vm-tools open-vm-tools-dkms
curl -x http://192.168.247.1:1081 "https://bootstrap.pypa.io/pip/3.5/get-pip.py" -o "get-pip35.py"
mkdir ~/.pip;cat <<EOT >> ~/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
EOT
python3 get-pip35.py --user
pip3 install pwntools
如果出现不能调试的问题(waiting for debugger)。。。安装下面的版本。(我测试后
pip install setuptools==44.0
pip install pwntools==4
# 下面是可选项
pip install MarkupSafe==0.9.2
pip install cryptography==2.5
pip install configparser==3.5
pip install zipp==0.5
pip install importlib-metadata==0.12
pip install importlib-resources==1.0
python2 安装 pwntools问题。
环境 Ubuntu16.
如果使用python2 pip安装pwntools时出现问题。
where pip
# 我的这里定位出了 /usr/bin/pip 和 /home/kali/.local/bin/pip
mv /usr/bin/pip2 /usr/bin/pip2.bak
sudo ln -sf /home/kali/.local/bin/pip /usr/bin/pip2
pip2 install --upgrade pip
pip2 install pwntools
解决问题。