File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
FROM ubuntu:20.04
2
2
3
3
RUN apt-get update && \
4
- apt install -y wget build-essential sudo unzip && \
4
+ apt install -y wget build-essential unzip && \
5
5
rm -rf /var/lib/apt/lists/* && \
6
6
useradd -d /home/ctf/ -m -p ctf -s /bin/bash ctf && \
7
7
echo "ctf:ctf" | chpasswd
@@ -15,8 +15,9 @@ RUN gcc chall.c -o chall -fno-stack-protector -z execstack -no-pie
15
15
RUN wget https://github.com/joewalnes/websocketd/releases/download/v0.3.0/websocketd-0.3.0-linux_amd64.zip && \
16
16
unzip websocketd-0.3.0-linux_amd64.zip && \
17
17
chmod +x websocketd && \
18
- chown -R root:root /home/ctf && \
19
18
apt remove -y wget build-essential unzip && \
20
19
apt autoremove -y
21
20
21
+ USER ctf
22
+
22
23
CMD ./start.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ echo $1 > ./flag.txt
4
+ ./chall
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- echo $FLAG > ./flag.txt
4
-
5
- ./websocketd --binary=true --port=$PORT ./chall
3
+ ./websocketd --binary=true --port=$PORT ./chall.sh $FLAG
You can’t perform that action at this time.
0 commit comments