- L: Linux alpine
- N: Nginx
- M: MySQL
- P: PHP 7.4
- PHP MySQL Ext
- mysql
- mysqli
challenge_gyctf_2020_web_babyphp
- FLAG=ctfhub{nginx_mysql_php_74}
You should rewrite flag.sh when you use this image.
The $FLAG
is not mandatory, but i hope you use it!
- src 网站源码
- db.sql This file should be use in Dockerfile
- index.php
- ...etc
- Dockerfile
- docker-compose.yml
You should create database and user!
DROP DATABASE IF EXISTS `ctfhub`;
CREATE DATABASE ctfhub;
GRANT SELECT,INSERT,UPDATE,DELETE on ctfhub.* to ctfhub@'127.0.0.1' identified by 'ctfhub';
GRANT SELECT,INSERT,UPDATE,DELETE on ctfhub.* to ctfhub@localhost identified by 'ctfhub';
use ctfhub;
-- create table...
FROM ctfhub/base_web_nginx_mysql_php_74
COPY src /var/www/html
COPY _files/flag.sh /flag.sh
RUN sh -c 'mysqld_safe &' \
&& sleep 5s \
&& mysql -uroot -proot -e "source /var/www/html/db.sql" \
&& rm -f /var/www/html/db.sql