This is a CTF type web project based on the OverTheWire web using Flask and docker for the labs.
- Clone repository
git clone https://github.com/KermitPurple96/minihack
- Install packages
sudo apt update
sudo apt install mysql-server
sudo apt -y install wget php php-cgi php-mysqli php-pear php-mbstring libapache2-mod-php php-common php-phpseclib php-mysql
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
Abort when phpmyadmin error
mysql -u root -p
mysql> UNINSTALL COMPONENT "file://component_validate_password";
mysql> exit
sudo apt install phpmyadmin
mysql -u root -p
mysql>INSTALL COMPONENT "file://component_validate_password";
mysql> exit
sudo phpenmod mbstring
sudo systemctl restart apache2
apt install docker.io -y
apt install docker-compose
sudo apt-get install python3
sudo apt install python3-pip
sudo apt-get install python3-dev libmysqlclient-dev
apt install python3-virtualenv
- Create virtual environment
cd /home/kermit/minihack
virtualenv env --python=python3
- Activate virtual environment
source /home/kermit/minihack/env/bin/activate
- Install libraries
pip3 install --upgrade pip
pip3 install wheel
apt install pkgconf
export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient)
export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient)
pip install Flask
pip3 install mysqlclient
pip3 install mysql
pip install -U Flask-WTF
pip install email_validator
pip install Flask-MySQLdb
pip install Werkzeug
pip install Flask-Login
pip install MarkupSafe
pip install bootstrap-flask
- Start Flask server
/home/kermit/minihack/start.sh
- Create docker images
docker build -t entorno /home/kermit/minihack/dockerfiles/entorno
docker build -t archivos /home/kermit/minihack/dockerfiles/archivos
docker build -t comandos /home/kermit/minihack/dockerfiles/comandos
docker build -t networking /home/kermit/minihack/dockerfiles/networking
docker build -t usuarios /home/kermit/minihack/dockerfiles/usuarios
docker build -t procesos /home/kermit/minihack/dockerfiles/procesos
docker build -t pivote /home/kermit/minihack/dockerfiles/pivote
- Start the containers
cd /home/kermit/minihack/dockerfiles
docker-compose up -d