summaryrefslogtreecommitdiffstats
path: root/chall/Dockerfile
blob: 1b8b51f32d45f451d1e0351b7b78df50a93e1a95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# docker build -t gearboy . && docker run --rm -it -p1024:1024 gearboy
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive 

RUN apt-get update && \
    apt-get install --no-install-recommends -y xinetd libncurses5-dev libncurses5 python3 python3-pip gdbserver build-essential git libsdl2-dev libglew-dev && \
    apt-get clean

RUN pip3 install --no-cache-dir cryptography==3.3 pwntools

RUN useradd -d /home/ctf/ -m -p ctf -s /bin/bash ctf && echo "ctf:ctf" | chpasswd

WORKDIR /home/ctf

RUN git clone https://github.com/drhelius/Gearboy.git gearboy && cd gearboy && git checkout 2cb66cdcb05f77147b9a5941e8ab92bceea828ae

WORKDIR /home/ctf/gearboy/
COPY headless.patch /home/ctf/gearboy/

RUN git apply --ignore-space-change --ignore-whitespace headless.patch

WORKDIR /home/ctf/gearboy/platforms/linux
RUN make

COPY flag /
COPY wrapper.py /home/ctf/wrapper.py

COPY python_svc /etc/xinetd.d/

env TERM=linux TERMINFO=/etc/terminfo

EXPOSE 1024

CMD ["xinetd", "-dontfork"]