31 lines
824 B
Docker
31 lines
824 B
Docker
FROM ubuntu:24.04
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
socat \
|
|
coreutils \
|
|
patchelf && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN useradd --create-home --uid 1337 ctf
|
|
|
|
COPY reverse_and_polish libc.so.6 ld-linux-x86-64.so.2 /app/
|
|
COPY entrypoint.sh /app/entrypoint.sh
|
|
|
|
RUN chmod +x /app/reverse_and_polish /app/ld-linux-x86-64.so.2 && \
|
|
patchelf --set-interpreter /app/ld-linux-x86-64.so.2 \
|
|
--set-rpath /app \
|
|
/app/reverse_and_polish && \
|
|
sed -i 's/\r$//' /app/entrypoint.sh && \
|
|
chmod +x /app/entrypoint.sh
|
|
|
|
RUN mkdir -p /data && chown ctf:ctf /data
|
|
WORKDIR /data
|
|
|
|
USER ctf
|
|
|
|
EXPOSE 1337
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
CMD ["socat", "TCP-LISTEN:1337,reuseaddr,fork", "EXEC:stdbuf -i0 -o0 -e0 /app/reverse_and_polish,stderr"]
|