Dockerfile (1154B)
1# To run this challenge locally, 2# (1) build the Docker container 3# docker build -t hacklu2024/blazing-fast-workout-planner . 4# (2) run the Docker container 5# docker run --cap-add SYS_ADMIN --security-opt apparmor=unconfined --rm -p 127.0.0.1:1024:1024 -ti hacklu2024/blazing-fast-workout-planner 6# and connect to localhost:1024 7 8FROM rust:latest AS builder 9 10RUN mkdir /src 11 12COPY ./ /src 13 14RUN cd /src && cargo build 15 16FROM ubuntu@sha256:d4f6f70979d0758d7a6f81e34a61195677f4f4fa576eaf808b79f17499fd93d1 17 18RUN apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y gdb rustup git 19RUN rustup toolchain add nightly-2024-09-09 || : 20RUN cd /tmp && git clone https://github.com/pwndbg/pwndbg.git && cd pwndbg && bash setup.sh 21 22RUN useradd --no-create-home --shell /bin/bash ctf 23 24COPY ynetd /sbin/ynetd 25 26COPY flag.txt /flag.txt 27 28COPY --from=builder /src/target/debug/blazing_fast_workout_planner /chall 29 30RUN chown -R root:root /sbin && \ 31 chown root:root /flag.txt && \ 32 chown root:root /chall && \ 33 chmod 744 /flag.txt && \ 34 chmod 755 /chall 35 36SHELL ["/bin/sh", "-c"] 37CMD ynetd -lt 15 -t 0 -lm 268435456 -lpid 128 -sh n -d / /chall