An Easy/Quick/Cheap Integrated Platform H1ve is a self-developed CTF Platform with problem solving, attack, defense and confrontation modes. Among them, the problem solving part supports independent problem container and dynamic Flag to prevent cheating for Web and Pwn problem types. Offensively and defensively, the adversal part supports AWD one-click deployment and features a cool visual battle interface.


0x00. Environment preparation

System: CentOS 7 version: centos-7-x86_64-minimal-1908 Image: ali Cloud download address centos-7-x86_64-minimal-1908 Software source: has been modified to Ali Yum software source

Note: The entire process is performed under the root user.

0x01. Software installation

1. Basic software

yum makeclean
yum makecache
yum install -y git vim
yum install -y yum-utils device-mapper-persistent-data lvm2 bind-utils
Copy the code

2. Install the docker

Set the yum source

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Copy the code

Install the docker

yum install -y docker-ce
docker version
Copy the code

Boot and add boot

systemctl start docker
systemctl enable docker
Copy the code

Configure Docker acceleration

vi /etc/docker/daemon.json
Copy the code

Add the following

{
    "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]}Copy the code

Restart Docker and view Docker information

systemctl daemon-reload
systemctl restart docker
docker info
Copy the code

3. Install the docker – compose

Install python – PIP

yum -y install epel-release
yum -y install python-pip
Copy the code

Check whether the installation is successful

pip -V
Copy the code

Upgrading the PIP version

pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

Copy the code

Install the docker – compose

pip install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple 
docker-compose --version
Copy the code

0x02. Build the H1ve platform

1. Download the project

git clone https://github.com/D0g3-Lab/H1ve.git
Copy the code

2. Build the process

Go to the directory

cd H1ve
Copy the code

Modifying a Configuration File

Sed -i 's/mariadb: 10.4 / mariadb: 10.4.12 / g' single. Yml sed -i 's/mariadb: 10.4 / mariadb: 10.4.12 / g' single - nginx. YmlCopy the code

ERROR: H1VE_MAIN_1 exited with code 1, use solution.

The configuration has been modified in the previous operation, you can skip the following command
rm -rf .data/
docker-compose -f single.yml down
sed -i 's/mariadb: 10.4 / mariadb: 10.4.12 / g' single.yml
Copy the code

Pull the image and start Single Mode (Recommended)

docker-compose -f single.yml up

Starting h1ve_db_1    ... done
Starting h1ve_frpc_1  ... done
Starting h1ve_cache_1 ... done
Starting h1ve_frps_1  ... done
Starting h1ve_main_1  ... done
Attaching to h1ve_db_1, h1ve_cache_1, h1ve_frps_1, h1ve_frpc_1, h1ve_main_1
.....
main_1   | [CTFd Ali-ECS]Started successfully
main_1   |  * Loaded module, <module 'CTFd.plugins.aliyun-instance' from '/root/H1ve/CTFd/plugins/aliyun-instance/__init__.py'>
main_1   |  * Loaded module, <module 'CTFd.plugins.challenges' from '/root/H1ve/CTFd/plugins/challenges/__init__.py'>
main_1   |  * Loaded module, <module 'CTFd.plugins.ctfd-matrix-scoreboard' from '/root/H1ve/CTFd/plugins/ctfd-matrix-scoreboard/__init__.py'>
main_1   | [CTFd Owl]Started successfully
main_1   |  * Loaded module, <module 'CTFd.plugins.ctfd-owl' from '/root/H1ve/CTFd/plugins/ctfd-owl/__init__.py'>
main_1   |  * Loaded module, <module 'CTFd.plugins.ctfd_glowworm' from '/root/H1ve/CTFd/plugins/ctfd_glowworm/__init__.py'>
main_1   |  * Loaded module, <module 'CTFd.plugins.dynamic_challenges' from '/root/H1ve/CTFd/plugins/dynamic_challenges/__init__.py'>
main_1   |  * Loaded module, <module 'CTFd.plugins.flags' from '/root/H1ve/CTFd/plugins/flags/__init__.py'>
main_1   | Starting CTFd
Copy the code

Single-Nginx Mode

docker-compose -f single-nginx.yml up
Copy the code

Check whether the port is open

netstat -lntp
Copy the code

3. Visit H1ve

Browser access: HTTP :IP address :8000

  • Set the CTF platform Name to CTF Name
  • Administrator: Admin Username, Admin Email, Admin Password, and CTF User Mode (Team Mode or User Mode).

0x03. Use the H1ve platform

1. Basic Settings

  • Modify the contents of the home page

Navigation Page All Pages: modify the index file.

  • Modify the logo

Go to the folder of the H1ve project. The logo corresponds to the h1ve. PNG file

cd H1ve/CTFd/themes/H1ve-theme/static/img
ls
bg.jpg  ctfd.ai  ctfd.svg  ctfd_transfer.svg  favicon.ico  h1ve.png  logo.png  logo_old.png
Copy the code

2. Deployment topic

MISC, Crypto, Web

How to build H1VE-CTFD and how to deploy THE DYNAMIC target drone