-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
XuCcc
committed
Feb 21, 2018
1 parent
c81f210
commit 3a1051f
Showing
10 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN dpkg --add-architecture i386 | ||
RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.aliyun.com/g" /etc/apt/sources.list | ||
RUN apt-get update && apt-get -y dist-upgrade | ||
RUN apt-get install -y xinetd libc6:i386 libncurses5:i386 libstdc++6:i386 | ||
RUN apt-get install -y python2.7 python-pip | ||
|
||
RUN useradd -m ctf | ||
|
||
COPY ./bin/* /home/ctf/ | ||
COPY ./xinetd.conf /etc/xinetd.d/ctf | ||
COPY ./start.sh /root/ | ||
COPY ./send.py /root/ | ||
COPY ./requirements.txt /root/ | ||
|
||
RUN pip install -r /root/requirements.txt | ||
|
||
# xinted 连接失败信息 | ||
RUN echo "Blocked by xinetd" > /etc/banner_fail | ||
|
||
RUN chown -R root:ctf /home/ctf &&\ | ||
chmod -R 750 /home/ctf &&\ | ||
chmod 740 /home/ctf/flag | ||
|
||
# flag 日志 | ||
RUN touch /root/log | ||
RUN chmod 700 /root/* | ||
|
||
WORKDIR /home/ctf | ||
|
||
CMD ["/root/start.sh"] | ||
|
||
EXPOSE 9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Docker demo | ||
|
||
## Usage | ||
|
||
* run `bash RUN.sh` | ||
|
||
## Note | ||
|
||
**Ensure your send.py and log file privileges are correct so ctfers can't read your challenge token and flag log** | ||
|
||
```dockerfile | ||
RUN touch /root/log | ||
RUN chmod 700 /root/* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
docker build -t "pwn" . | ||
docker run -d -p 9999:9999 --name="pwn" pwn |
Empty file.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
/etc/init.d/xinetd start; | ||
python /root/send.py; | ||
sleep infinity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
service ctf | ||
{ | ||
disable = no | ||
socket_type = stream | ||
protocol = tcp | ||
wait = no | ||
user = ctf | ||
bind = 0.0.0.0 | ||
server = /home/ctf/pwn | ||
type = UNLISTED | ||
port = 9999 | ||
} |