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"] |
RUN /bin/sh -c apt-get update && apt-get install -y sudo tcpdump python3 python3-pip && rm -rf /var/lib/apt/lists/* # buildkit |
RUN /bin/sh -c echo 'ctf ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump' > /etc/sudoers.d/ctf # buildkit |
RUN /bin/sh -c echo "come back when you're root!" >> /home/ctf/flag2.txt # buildkit |
COPY script.py /root/script.py # buildkit |
COPY flag.txt /root/flag.txt # buildkit |
COPY flag2.txt /root/flag2.txt # buildkit |
EXPOSE map[22/tcp:{}] |
RUN /bin/sh -c echo "python3 /root/script.py" >> /root/entrypoint.sh # buildkit |