从零开始的Ubuntu16.04配置

记录一下,方便以后虚拟机爆炸时重新配置。

换源

跳到更新源文件所在的目录下,终端执行:

cd /etc/apt/

此时,我们可以在当前目录看一下里面的文件,终端执行: ls 我们会看到当前目录下所有文件,不出意外 会有一个sources.list文件,这个文件里面写的就是更新源。我们接下来都是对它进行操作

将原来的更新源备份一下,注意要用管理员权限进行操作,终端执行:

sudo cp sources.list copy_sources.list

此时,当前目录下会多一个copy_sources.list的文件,是我们自己的备份,万一我们把更新源改坏了,还可以恢复回来

更换更新源,终端执行:

sudo gedit sources.list

然后复制想换的源进去保存就可以了

阿里源:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

更新源,终端执行:

sudo apt update

安装pip

终端执行:

sudo apt install python-pip

pip换源

新建一个~/.pip/pip.conf

内容为:

1
2
3
4
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

更新pip

终端执行:

sudo pip install --upgrade pip

终端执行:

sudo gedit /usr/bin/pip

from pip import main

改为

from pip._internal import main

保存即可

安装git

终端执行:

sudo apt install git

安装ruby

终端执行:

sudo apt install ruby

安装pwntools

终端执行:

sudo pip install pwntools

安装pwndbg

终端执行:

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

安装one_gadget

终端执行:

sudo gem install one_gadget

安装ROPgadget

终端执行:

sudo pip install ropgadget

安装LibcSearcher

终端执行:

1
2
3
git clone https://github.com/lieanu/LibcSearcher.git
cd LibcSearcher
python setup.py develop

安装z3

终端执行:

pip install z3-solver

安装angr

终端执行:

1
2
3
4
5
pip install virtualenvwrapper
export WORKON_HOME=$HOME/Python-workhome
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv angr
pip install angr

为方便以后使用,写一个vr.sh

1
2
export WORKON_HOME=$HOME/Python-workhome
source /usr/local/bin/virtualenvwrapper.sh

使用时,终端执行:

1
2
. vr.sh
workon angr

进入安装好angr的虚拟环境

文章目录
  1. 1. 换源
  2. 2. 安装pip
  3. 3. pip换源
  4. 4. 更新pip
  5. 5. 安装git
  6. 6. 安装ruby
  7. 7. 安装pwntools
  8. 8. 安装pwndbg
  9. 9. 安装one_gadget
  10. 10. 安装ROPgadget
  11. 11. 安装LibcSearcher
  12. 12. 安装z3
  13. 13. 安装angr
|