cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

Dockerfile (1089B)


      1# docker build -t gearboy . && docker run --rm -it -p1024:1024 gearboy
      2FROM ubuntu:20.04
      3
      4ENV DEBIAN_FRONTEND=noninteractive 
      5
      6RUN apt-get update && \
      7    apt-get install --no-install-recommends -y gdb xinetd libncurses5-dev libncurses5 python3 python3-pip gdbserver build-essential git libsdl2-dev libglew-dev && \
      8    apt-get clean
      9
     10RUN pip3 install --no-cache-dir cryptography==3.3 pwntools
     11
     12RUN useradd -d /home/ctf/ -m -p ctf -s /bin/bash ctf && echo "ctf:ctf" | chpasswd
     13
     14WORKDIR /home/ctf
     15
     16RUN git clone https://github.com/drhelius/Gearboy.git gearboy && cd gearboy && git checkout 2cb66cdcb05f77147b9a5941e8ab92bceea828ae
     17
     18WORKDIR /home/ctf/gearboy/
     19COPY headless.patch /home/ctf/gearboy/
     20
     21RUN git apply --ignore-space-change --ignore-whitespace headless.patch
     22
     23WORKDIR /home/ctf/gearboy/platforms/linux
     24RUN make
     25
     26RUN apt install -y curl python3.9 python-is-python3
     27
     28RUN bash -c "$(curl -fsSL http://gef.blah.cat/sh)"
     29
     30COPY flag /
     31COPY wrapper.py /home/ctf/wrapper.py
     32
     33COPY python_svc /etc/xinetd.d/
     34
     35env TERM=linux TERMINFO=/etc/terminfo
     36
     37EXPOSE 1024
     38
     39CMD ["xinetd", "-dontfork"]