-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (38 loc) · 1.27 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
# Origin image
FROM debian:jessie
# Meta Information
MAINTAINER Pourliver "[email protected]"
# PHP sources
RUN echo "deb http://deb.debian.org/debian stretch main" >> /etc/apt/sources.list
RUN echo "deb-src http://deb.debian.org/debian stretch main" >> /etc/apt/sources.list
# Update
RUN apt-get update
# Setup Server Environment
RUN apt-get install -y \
apache2 \
php \
sqlite3 \
libapache2-mod-php \
php-sqlite3
# Add SSRF flag
RUN echo "flag_user:x:1337:1337:FLAG{Wait_This_Is_Not_An_Image!}:/nonexistent:/bin/false" >> /etc/passwd
# Enable mod_rewrite (for .htaccess filtering)
RUN a2enmod rewrite
RUN service apache2 restart
# Allow .htaccess
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# Remove default apache page
RUN rm /var/www/html/index.html
# Copy website
COPY chall/ /var/www/html/
COPY ihack.db /var/www/
COPY adminSecret.php /var/www/
# Fix vendor not being accessible
RUN chmod -R 755 /var/www/html/
# Expose apache's port
# EXPOSE 80 Let the docker-compose file manage this.
# Fix annoying DNS error
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Entry point
#ENTRYPOINT service apache2 start && /bin/bash
CMD /usr/sbin/apache2ctl -D FOREGROUND