From b8f0880d6875e94a8b5dae0816177f0178054343 Mon Sep 17 00:00:00 2001 From: myitinos Date: Sat, 16 Feb 2019 14:39:32 +0800 Subject: [PATCH] added Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ba2aa8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Use ubuntu 16.04 +FROM ubuntu:16.04 +EXPOSE 2020 +RUN apt-get update + +# install socat editor ssh +RUN apt-get install socat -y + +RUN adduser --disabled-password --gecos "" ksl +RUN echo "ksl:sebuahrahasiamas" | chpasswd + +RUN mkdir chall +WORKDIR /chall + +# Secure ENV +COPY flag.txt . +COPY version002 . + +RUN echo 'alias kill="echo no kill please!"' >> ~/.bashrc +RUN chmod 700 /tmp /usr/bin/* /bin/* /dev/shm +# RUN chmod 755 /usr/bin/env /bin/dash /bin/bash /bin/sh /bin/nc /bin/cat /usr/bin/curl /usr/bin/groups /usr/bin/id /bin/ls /usr/bin/python /usr/bin/ruby + +RUN chown root:ksl /chall/version002 +RUN chmod 775 /chall/version002 + +# Run Service + +RUN echo '#!/bin/bash'"\n(socat TCP-LISTEN:2020,reuseaddr,fork EXEC:"/chall/version002,su=nobody")" > /var/tmp/.start.sh && chmod +x /var/tmp/.start.sh + +CMD ["/var/tmp/.start.sh"]