-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (25 loc) · 1.15 KB
/
Dockerfile
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
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y python build-essential \
git cmake clang pkg-config libcapstone-dev \
autoconf automake libtool curl make g++ unzip \
socat
RUN useradd -ms /bin/bash ctf
RUN git clone https://github.com/pmem/syscall_intercept.git /home/ctf/syscall_intercept
RUN mkdir /home/ctf/syscall_intercept/build
RUN cd /home/ctf/syscall_intercept/build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang &&\
make -j `nproc` && make install
RUN git clone https://github.com/protocolbuffers/protobuf.git /home/ctf/protobuf
RUN cd /home/ctf/protobuf && git fetch --tags && git checkout tags/v3.10.1
RUN cd /home/ctf/protobuf && git submodule update --init --recursive &&\
./autogen.sh
RUN cd /home/ctf/protobuf && ./configure && make -j `nproc` && make install && ldconfig
RUN rm -rf /home/ctf/syscall_intercept
RUN rm -rf /home/ctf/protobuf
COPY ./libsuperfly.so /home/ctf/
COPY ./flag /home/ctf
#COPY ./run.sh /home/ctf/
USER ctf
WORKDIR /home/ctf
EXPOSE 8888
CMD ["socat", "-T60", "TCP-LISTEN:8888,reuseaddr,fork", "EXEC:\"LD_PRELOAD=./libsuperfly.so /usr/bin/python\",pty,stderr"]