-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (31 loc) · 1.29 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM debian:bookworm
RUN apt update -y && apt upgrade -y && apt install -y build-essential wget cmake google-perftools
############### INSTALL FNETD
RUN wget https://cloud.sec.in.tum.de/index.php/s/65BwEo2zgLFGa65/download/fnetd.tar.xz -O /fnetd.tar.xz
RUN tar -xf fnetd.tar.xz
RUN mkdir /fnetd/build
WORKDIR /fnetd/build
RUN cmake .. -G "Unix Makefiles"
RUN make
WORKDIR /
############### END INSTALL
## Add your own dummy get_flag here
COPY get_flag /bin/get_flag
RUN chmod 0755 /bin/get_flag
## Uncomment to use course libc.
COPY "libc-2.36.so" "/lib/x86_64-linux-gnu/libc-2.36-bx.so"
RUN ln -sf /lib/x86_64-linux-gnu/libc-2.36-bx.so /lib/x86_64-linux-gnu/libc.so.6
RUN useradd -m pwn
COPY image_files/translator /translator
RUN echo "LD_PRELOAD=/usr/lib/libtcmalloc.so.4" | tee -a /etc/environment
RUN ln -s /translator/translator.sh /bin/t
RUN chmod 0755 /translator/translator.sh
COPY vuln /home/pwn/vuln
RUN chmod 0755 /home/pwn/vuln
RUN apt update && apt install python3 git gdb -y
RUN git clone https://github.com/pwndbg/pwndbg.git \
&& cd /pwndbg && git checkout 2024.08.29 && ./setup.sh
EXPOSE 1337
# Feel free to replace password with the actual chall pw
ENV FNETD_PASSWORD=fnetd_password
CMD ["/fnetd/build/fnetd", "-p", "1337", "-u", "pwn", "-lt", "2", "-lm", "536870912", "./vuln"]