summaryrefslogtreecommitdiffstats
path: root/server/Dockerfile
blob: fecd048d4ba3e84d4e295f31f0e49972b410d6b3 (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
36
37
38
39
# 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 gdb 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

RUN apt install -y curl python3.9 python-is-python3

RUN bash -c "$(curl -fsSL http://gef.blah.cat/sh)"

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"]