Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

环境配置

可以直接用miniconda配置一个专门用于CTF的环境。

安装Miniconda

下载:

1
2
3
cd ~
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

安装:

1
bash Miniconda3-latest-Linux-x86_64.sh

初始化:

1
2
3
~/miniconda3/bin/conda init

source ~/.bashrc

验证安装:

1
2
conda --version
which conda

创建环境

推荐用Python 3.11,和各种库的适配性更好一点。

1
2
conda create -n ctf python=3.11 -y
conda activate ctf

环境名就叫ctf


创建环境时可能会遇到这样的问题:

1
2
3
4
5
6
7
8
9
10
11
12
CondaToSNonInteractiveError: Terms of Service have not been accepted for the following channels. Please accept or remove them before proceeding:
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/r

To accept these channels' Terms of Service, run the following commands:
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r

For information on safely removing channels from your conda configuration,
please see the official documentation:

https://www.anaconda.com/docs/tools/working-with-conda/channels

这个时候同意一下它的那些政策就好:运行

1
2
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r

然后再创建环境。


安装常用包:

1
2
3
4
5
6
7
8
9
10
11
sudo apt update
sudo apt install -y build-essential python3-dev \
libgmp-dev libssl-dev libffi-dev


python -m pip install -U pip setuptools wheel

python -m pip install \
pwntools cryptography pycryptodome gmpy2 z3-solver \
flask requests beautifulsoup4 \
capstone keystone-engine unicorn ropper sympy

工具

除此之外还有些常用的工具:

1
2
3
4
5
6
7
8
9
sudo apt update
sudo apt install -y \
build-essential gdb gdb-multiarch \
binutils nasm \
python3-dev \
git curl wget \
tmux unzip \
radare2 \
checksec