File tree Expand file tree Collapse file tree 12 files changed +170
-1
lines changed Expand file tree Collapse file tree 12 files changed +170
-1
lines changed Original file line number Diff line number Diff line change 13
13
* .7z filter =lfs diff =lfs merge =lfs - text
14
14
pwn /race /docker /bin /race filter =lfs diff =lfs merge =lfs - text
15
15
pwn /race /challenge filter =lfs diff =lfs merge =lfs - text
16
+
17
+ pwn /simple_fmt /challenge filter =lfs diff =lfs merge =lfs - text
18
+ pwn /simple_fmt /docker /bin /fmt filter =lfs diff =lfs merge =lfs - text
Original file line number Diff line number Diff line change 10
10
11
11
## 分数
12
12
13
- 50
13
+ 75
14
14
15
15
## flag
16
16
Original file line number Diff line number Diff line change
1
+ # Race
2
+
3
+ ## 题目名称
4
+
5
+ simple_fmt
6
+
7
+ ## 分类
8
+
9
+ * pwn
10
+
11
+ ## 分数
12
+
13
+ 50
14
+
15
+ ## flag
16
+
17
+ ``` txt
18
+ zsctf{fmt_gogogo_2020}
19
+ ```
20
+
21
+ ## develop
22
+
23
+ ``` bash
24
+ # 测试环境
25
+ 无
26
+ ```
27
+
28
+ ## 题目搭建
29
+
30
+ ``` bash
31
+ cd pwn/simple_fmt/docker && docker-compose up -d
32
+ ```
33
+
34
+ > 修改 docker-compose.yml 环境变量可改变 flag。
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:18.04
2
+
3
+ RUN sed -i "s/http:\/\/ archive.ubuntu.com/http:\/\/ mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
4
+ apt-get update && apt-get -y dist-upgrade && \
5
+ apt-get install -y lib32z1 xinetd
6
+
7
+ RUN useradd -m ctf
8
+
9
+ WORKDIR /home/ctf
10
+
11
+ RUN cp -R /lib* /home/ctf && \
12
+ cp -R /usr/lib* /home/ctf
13
+
14
+ RUN mkdir /home/ctf/dev && \
15
+ mknod /home/ctf/dev/null c 1 3 && \
16
+ mknod /home/ctf/dev/zero c 1 5 && \
17
+ mknod /home/ctf/dev/random c 1 8 && \
18
+ mknod /home/ctf/dev/urandom c 1 9 && \
19
+ chmod 666 /home/ctf/dev/*
20
+
21
+ RUN mkdir /home/ctf/bin && \
22
+ cp /bin/sh /home/ctf/bin && \
23
+ cp /bin/ls /home/ctf/bin && \
24
+ cp /bin/cat /home/ctf/bin
25
+
26
+ COPY ./ctf.xinetd /etc/xinetd.d/ctf
27
+ COPY ./start.sh /start.sh
28
+ RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail
29
+
30
+ RUN chmod +x /start.sh
31
+
32
+ COPY ./bin/ /home/ctf/
33
+ RUN chown -R root:ctf /home/ctf && \
34
+ chmod -R 750 /home/ctf && \
35
+ chmod 740 /home/ctf/flag
36
+
37
+ CMD ["/start.sh" ]
38
+
39
+ EXPOSE 9999
Original file line number Diff line number Diff line change
1
+ zsctf{}
Original file line number Diff line number Diff line change
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18223164a91d6047f0362f00d5f19595427b06e7cc129f66c01aceb96549c991
3
+ size 13608
Original file line number Diff line number Diff line change
1
+ service ctf
2
+ {
3
+ disable = no
4
+ socket_type = stream
5
+ protocol = tcp
6
+ wait = no
7
+ user = root
8
+ type = UNLISTED
9
+ port = 9999
10
+ bind = 0.0.0.0
11
+ server = /usr/sbin/chroot
12
+ server_args = --userspec=1000:1000 /home/ctf ./fmt
13
+ banner_fail = /etc/banner_fail
14
+ # safety options
15
+ per_source = 10 # the maximum instances of this service per source IP address
16
+ rlimit_cpu = 20 # the maximum number of CPU seconds that the service may use
17
+ #rlimit_as = 1024M # the Address Space resource limit for the service
18
+ #access_times = 2:00-9:00 12:00-24:00
19
+ }
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ race :
4
+ build :
5
+ context : ./
6
+ dockerfile : Dockerfile
7
+ ports :
8
+ - " 1001:9999"
9
+ environment :
10
+ - FLAG=zsctf{fmt_gogogo_2020}
You can’t perform that action at this time.
0 commit comments