PWN入门-Web混不下去了怎么办

Web 狗一只,最近打 ctf 愈发觉得 pwn 的重要,于是便有了当爷爷的冲动!

JOJO!我不当狗了!

PWN 环境搭建

安装

我用的是 ubuntu 18.04 ,安装完成后先换源,先备份官方源 sudo cp /etc/apt/source.list /etc/apt/source.list.b ,更新 /etc/apt/sources.list 为以下内容

1
2
3
4
5
6
7
8
9
10
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

更新,并安装必要的软件(vim git gedit ssh socat等)

1
2
3
sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade

安装 pwntools

1
2
3
4
apt-get install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential
pip install -U setuptools
pip install --upgrade pip
pip install --upgrade pwntools

安装 pwndbg

1
2
3
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

安装 peda 插件

1
2
git clone https://github.com/longld/peda.git ~/peda
echosource ~/peda/peda.py” >> ~/.gdbinit

安装 libcdatabase

1
2
3
git clone https://github.com/niklasb/libc-database.git
cd libc-database
./get

pip 出现问题建议先升级

1
2
sudo pip install --upgrade pip
sudo pip3 install --upgrade pip3

出现报错:ImportError: cannot import name main

修改 /usr/bin/pip 为如下内容

1
2
3
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())

pip 太慢建议换源

  • 临时换源

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple [package name]

  • 永久换源

新建 ~/.pip/pip.conf 文件,写入如下内容

1
2
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
AbelChe wechat
扫码加微信
Donate here!!!
0%