challenge-chmod (latest)

Published 2025-04-02 18:56:58 +02:00 by Tymek

Installation

docker pull git.agin.rocks/ctfilt/challenge-chmod:latest
sha256:975758e6b869b808da7ffcb6433a882d172b53c2911bca98c9fb4203a09c7baa

Image layers

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

Labels

Key Value
com.docker.compose.project chmod
com.docker.compose.service challenge-chmod
com.docker.compose.version 2.34.0
Details
Container
2025-04-02 18:56:58 +02:00
3
OCI / Docker
linux/amd64
65 MiB
Versions (1) View all
latest 2025-04-02