File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1
- FROM ubuntu:14 .04
1
+ FROM ubuntu:16 .04
2
2
3
3
RUN sed -i "s/http:\/\/ archive.ubuntu.com/http:\/\/ mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list
4
4
RUN apt-get update && apt-get -y dist-upgrade
@@ -9,13 +9,23 @@ RUN useradd -m ctf
9
9
COPY ./bin/ /home/ctf/
10
10
COPY ./ctf.xinetd /etc/xinetd.d/ctf
11
11
COPY ./start.sh /start.sh
12
+ RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail
12
13
13
14
RUN chmod +x /start.sh
14
15
RUN chown -R root:ctf /home/ctf
15
16
RUN chmod -R 750 /home/ctf
16
17
RUN chmod 740 /home/ctf/flag
18
+
17
19
RUN cp -R /lib* /home/ctf
18
20
RUN cp -R /usr/lib* /home/ctf
21
+
22
+ RUN mkdir /home/ctf/dev
23
+ RUN mknod /home/ctf/dev/null c 1 3
24
+ RUN mknod /home/ctf/dev/zero c 1 5
25
+ RUN mknod /home/ctf/dev/random c 1 8
26
+ RUN mknod /home/ctf/dev/urandom c 1 9
27
+ RUN chmod 666 /home/ctf/dev/*
28
+
19
29
RUN mkdir /home/ctf/bin
20
30
RUN cp /bin/sh /home/ctf/bin
21
31
RUN cp /bin/ls /home/ctf/bin
Original file line number Diff line number Diff line change 1
- # replace helloworld to your program
2
1
service ctf
3
2
{
4
3
disable = no
5
4
socket_type = stream
6
5
protocol = tcp
7
6
wait = no
8
7
user = root
8
+ type = UNLISTED
9
+ port = 9999
9
10
bind = 0.0.0.0
10
11
server = /usr/sbin/chroot
12
+ # replace helloworld to your program
11
13
server_args = --userspec=1000:1000 /home/ctf ./helloworld
12
- type = UNLISTED
13
- port = 9999
14
+ banner_fail = /etc/banner_fail
15
+ # safety options
16
+ per_source = 10 # the maximum instances of this service per source IP address
17
+ rlimit_cpu = 20 # the maximum number of CPU seconds that the service may use
18
+ #rlimit_as = 1024M # the Address Space resource limit for the service
19
+ #access_times = 2:00-9:00 12:00-24:00
14
20
}
You can’t perform that action at this time.
0 commit comments