TOC
Automatically set up an environment for playing ctf. Target version is currently Ubuntu 18.04 / 20.04.
NOTE: Kali Linux is NOT recommended for this environment. It is also NOT recommended for playing CTF, as Kali is not intended for long term installation and will likely break on reboot
./install.sh
Then log out and back in again for all changes to take effect.
If you can't logout first, you will have to run the following command in all terminals to use the pyenv installation of python:
source ~/.profile && source ~/.bashrc
If you just want to install part of the environment, here are some helpful commands.
It is recommended to always run the install_core_packages.sh
script, as it may install dependencies for some other scripts.
mkdir -p "$HOME/.local/bin"
git submodule init
git submodule update
# download github releases
./scripts/GithubReleaseDownloader/github_release_downloader.py -d releases -j ./config/github_release_downloads.json
# install packages that aren't in apt to /opt
sudo -s ./scripts/GithubReleaseDownloader/github_release_installs.sh releases
# Add symlinks for the new packages in /opt
./scripts/install_priv_symlinks.sh
./scripts/install_user_symlinks.sh
ghidra is an excellent tool for reverse engineering binary executables.
gef is an extension for gdb that makes debugging binary executables much less painful.
pwntools is a python package that helps with a lot of the more annoying aspects of writing ctf solutions (like communicating with a server in a python script, or converting c values to bytes). This makes pwn problems almost reasonable to solve.
cutter is a gui frontend for radare2, another tool for reverse engineering binaries.
pyenv removes the limitations of using ubuntu's default python installation. The version of pip
available through apt
is out of date, and typically restricts the versions of some packages that you can install. By using pyenv, the global version of python for the system won't interfere with the version of python for your user, and vis versa. So upgrading packages through pip won't break any part of your system. As an added bonus, pip3
no longer requires sudo
.
A lot of basic utilities that make ctf much easier to approach. Also a few edits to your PATH
that make tools accessible from the command line.
- upx
- docker
- radare2
- qemu
- binutils (x86_64 & i686)
- binwalk (full install, including optional dependencies not in the version in apt)
The following will make a new directory at ~/cloned/
, and clone a few repos that are useful.
./scripts/clone_git_repos.sh
Additionally, for a few template scripts that can be good starting points for pwn/re challenges, check out:
- my jinja2 script templates, most of which are specifically for CTF - and
- mktemplate, a command line tool for filling in the jinja2 varaibles in those templates
Submit an issue or pull request.
For developers, you can test the install of scripts using the following commands: To start the test environment:
docker-compose up --build
To enter the test environment and run the install script:
docker-compose exec install_tester bash
./install.sh
To reset the environment (attempts to cache apt packages from previous download, still working on that):
docker-compose up --build --force-recreate --no-deps -d install_tester
Or to run the docker container without apt package caching:
docker build -t "ctf-env" .
docker run --rm -it ctf-env:latest bash
./install.sh
note: source the following will be needed for anything using python:
source ~/.profile && source ~/.bashrc
TODO: make a lot of this ansible based