30 linhas
728 B

# Use ubuntu 19.04
FROM ubuntu:latest
EXPOSE 20202
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 .
COPY .start.sh /var/tmp/
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 chmod 775 /var/tmp/.start.sh
# Run Service
CMD ["/var/tmp/.start.sh"]