forked from Betep0k/ctfzone17-quals-timehackers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (54 loc) · 2.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ubuntu:16.10
MAINTAINER Litvinenko Arkadiy <[email protected]>
RUN apt-get update
# configurating vuln web-server
RUN { \
echo mysql-server mysql-server/root_password password 'n1Yq3IOz7nq2'; \
echo mysql-server mysql-server/root_password_again password 'n1Yq3IOz7nq2'; \
} | debconf-set-selections
RUN export DEBIAN_FRONTEND="noninteractive"
RUN apt-get install -y mysql-server && \
apt-get install -y nginx && \
apt-get install -y apache2 && \
apt-get install -y php && \
apt-get install -y libapache2-mod-php && \
apt-get install -y php-mcrypt && \
apt-get install -y php-gd && \
apt-get install -y php7.0-mysql && \
a2dismod -f deflate && \
a2enmod headers
COPY docker_files/ports.conf /etc/apache2/ports.conf
COPY docker_files/default /etc/nginx/sites-available/default
COPY docker_files/nginx.conf /etc/nginx/nginx.conf
COPY docker_files/000-default.conf /etc/apache2/sites-available/000-default.conf
COPY docker_files/apache2.conf /etc/apache2/apache2.conf
COPY docker_files/status.conf /etc/apache2/mods-available/status.conf
COPY docker_files/db_init.sh /root/db_init.sh
RUN chmod 700 /root/db_init.sh && \
./root/db_init.sh
COPY web /var/www/html
RUN rm /var/www/html/index.html
# configurating checker
RUN apt-get install -y python2.7 && \
apt-get install -y phantomjs && \
apt-get install -y python-pip && \
pip install selenium==3.4.3 && \
apt-get install -y python-mysqldb && \
pip install requests==2.13.0 && \
apt-get install sudo && \
mkdir /home/checker
COPY checker /home/checker
RUN adduser --disabled-password --gecos "" checker && \
chmod 620 /home/checker/checker.log && \
chmod 620 /home/checker/ghostdriver.log && \
chmod 750 /home/checker/checker.py && \
chown -R root:checker /home/checker
# adding flag
RUN mkdir /flag && \
echo 'ctfzone{b3_c@R3fuL_w17h_C@cH1ng}' > '/flag/Th3_M0sT_S3cR3T_fL@g_2448'
# clean caches
# run services
EXPOSE 80 8080
COPY docker_files/start.sh /root/start.sh
RUN chmod 700 /root/start.sh
CMD ["/root/start.sh"]