ADD file:82f06126089fd0ca482c29baeb90ef37ac3a9f5f6a0f2f5c968a605846627d47 in / |
CMD ["bash"] |
RUN /bin/sh -c apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/* # buildkit |
RUN /bin/sh -c mkdir -p /var/run/sshd /etc/ssh # buildkit |
COPY ssh_host_keys /etc/ssh/ # buildkit |
RUN /bin/sh -c chmod 600 /etc/ssh/ssh_host_* && chmod 644 /etc/ssh/ssh_host_*.pub # buildkit |
RUN /bin/sh -c echo 'PermitRootLogin no' >> /etc/ssh/sshd_config && echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && echo 'HostKey /etc/ssh/ssh_host_rsa_key' >> /etc/ssh/sshd_config && echo 'HostKey /etc/ssh/ssh_host_ecdsa_key' >> /etc/ssh/sshd_config && echo 'HostKey /etc/ssh/ssh_host_ed25519_key' >> /etc/ssh/sshd_config # buildkit |
RUN /bin/sh -c useradd -m -s /bin/bash ctf && echo 'ctf:ctfilt' | chpasswd # buildkit |
COPY ctfilt_base_assets/welcome.txt /etc/motd # buildkit |
RUN /bin/sh -c echo "#!/usr/bin/env bash" > /root/entrypoint.sh && echo "/usr/sbin/sshd" >> /root/entrypoint.sh && chmod +x /root/entrypoint.sh # buildkit |
EXPOSE map[22/tcp:{}] |
ENTRYPOINT ["/root/entrypoint.sh"] |
COPY /usr/src/modify_permissions/target/release/modify_permissions /home/ctf/modify_permissions # buildkit |
RUN /bin/sh -c chown root:root /home/ctf/modify_permissions # buildkit |
RUN /bin/sh -c chmod 4771 /home/ctf/modify_permissions # buildkit |
ARG FLAG=FLAG{sUid_ESEKZGmW} |
RUN |1 FLAG=FLAG{sUid_ESEKZGmW} /bin/sh -c echo "${FLAG}" > /home/ctf/flag.txt # buildkit |
RUN |1 FLAG=FLAG{sUid_ESEKZGmW} /bin/sh -c chown root:root /home/ctf/flag.txt # buildkit |
RUN |1 FLAG=FLAG{sUid_ESEKZGmW} /bin/sh -c chmod 700 /home/ctf/flag.txt # buildkit |
EXPOSE map[22/tcp:{}] |
RUN |1 FLAG=FLAG{sUid_ESEKZGmW} /bin/sh -c echo "tail -f /dev/null" >> /root/entrypoint.sh # buildkit |