-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 726 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 726 Bytes
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
FROM ubuntu:latest
RUN apt update && apt install -y \
apache2 \
php \
gcc \
systemd \
openssl \
&& apt clean
COPY rootAuth.c /home/www-data/rootAuth.c
RUN mkdir -p /home/www-data && \
echo "ssi{$(openssl rand -hex 8)}" > /home/www-data/user.txt && \
chown www-data:www-data /home/www-data/user.txt && \
chmod 600 /home/www-data/user.txt && \
echo "ssi{$(openssl rand -hex 8)}" > /root/root.txt && \
chmod 600 /root/root.txt && \
rm -rf /home/ubuntu
RUN gcc -fno-stack-protector -z execstack -o /home/www-data/rootAuth /home/www-data/rootAuth.c && \
chmod u+s /home/www-data/rootAuth
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]