前言
最近打 pwn,发现环境很诡异, 所以干脆重装一遍虚拟机,顺便记录一下自己虚拟机的环境,以后方便玩坏了又重装。
sudo 不需要密码
修改 /etc/sudoers 文件,加上一句 NOPASSWD:
1 2 3 4
| # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
aluvion ALL=(ALL) NOPASSWD: ALL
|
安装 docker
一个 docker 就可以解决一万种环境,赞。
https://docs.docker.com/install/linux/docker-ce/ubuntu/
先换个 Ubuntu 源,然后:
1 2 3 4 5 6
| apt-get update apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" apt-get update apt-get install docker-ce
|
安装完成,镜像到时候再 pull 吧:
1 2
| root@Aluvion:/home/aluvion/桌面/Docker# docker --version Docker version 18.09.6, build 481bc77
|
安装 PHP
比较常用的语言……node、go、java 就暂时不装了,需要再在 docker 里面用吧……节省空间。
1 2 3
| add-apt-repository -y ppa:ondrej/php apt-get update apt-get install php
|
我这里网络有点问题,运行了几次才装好,其他什么什么包就暂时不装了:
1 2 3 4 5
| root@Aluvion:/home/aluvion/桌面/Docker# php -v PHP 7.3.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 3 2019 10:00:05) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
|
做密码做 pwn 都能用,赞。
1 2 3
| apt-get install python-pip python-dev git libssl-dev libffi-dev build-essential sudo pip install --upgrade pip sudo pip install --upgrade pwntools
|
安装 Pwndbg
看堆很方便,赞。
1 2 3
| git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh
|
安装 32 位程序运行依赖环境
做完 64 位的题目,做做 32 位的题目。
1 2
| dpkg sudo apt-get -y install lib32z1 lib32ncurses5
|
不过我还没 apt 安装就能运行 32 位程序了?
暂时用到的就这些了,其他东西等之后做 ROP 或者别的要用到再装。
参考文章:
https://www.jianshu.com/p/1476f38e3aa3
https://ch4r1l3.github.io/2018/06/21/pwn%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E6%94%BE%E5%BC%83%E7%AC%AC%E4%B8%80%E7%AB%A0%E2%80%94%E2%80%94%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/