Setup a fresh Ubuntu Linux environment for CTF
2020-10-04 阅读量:

Change apt source mirror

1
. /etc/os-release; sudo wget "https://mirrors.ustc.edu.cn/repogen/conf/ubuntu-https-4-${UBUNTU_CODENAME}" -O /etc/apt/sources.list

Update apt repo cache and Upgrade system

1
2
sudo su
apt update && apt upgrade -y && apt dist-upgrade -y && apt clean -y && apt autoclean -y && apt remove -y && apt autoremove -y

Change Timezone

1
timedatectl set-timezone Asia/Shanghai

Install basic tools

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
sudo apt install -y \
tmux \
zsh \
git \
tig \
unar \
build-essential \
cmake \
nasm \
python3 \
python3-pip \
unzip \
gdb \
lrzsz \
zip \
unzip \
tree
1
2
3
4
5
6
7
8
9
10
sudo python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
sudo python3 -m pip install pip -U
sudo python3 -m pip install \
ipython \
requests \
bs4 \
pillow \
pwntools \
keystone-engine \
ropper
1
2
3
4
wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz
unar go1.15.3.linux-amd64.tar.gz
sudo mv go1.15.3.linux-amd64 /opt/go
export PATH=/opt/go/bin:$PATH
1
2
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

Install oh-my-zsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install SpaceVim

1
2
3
curl -sLf https://spacevim.org/install.sh | bash
sudo su
curl -sLf https://spacevim.org/install.sh | bash

Install powerline

1
sudo apt install powerline

Install NerdFonts

1
2
3
4
5
6
7
sudo su
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/DroidSansMono.zip

unzip DroidSansMono.zip -d ~/.fonts
fc-cache -fv

rm -rf ./DroidSansMono.zip

Install BurpSuite Pro

Install gef

1
sh -c "$(curl -fsSL http://gef.blah.cat/sh)"

Config tmux

1
2
3
4
5
sudo su
git clone --recursive https://github.com/tony/tmux-config.git /opt/tmux
ln -s /opt/tmux/.tmux.conf ~/.tmux.conf
su kali
ln -s /opt/tmux/.tmux.conf ~/.tmux.conf
1
2
3
4
change the 100th line of /opt/tmux/.tmux.conf from
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
to
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind \%; bind \% split-window -h -c "#{pane_current_path}"'

Execute sudo not prompting for password