Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add files.
- Loading branch information
1 parent
c808ad0
commit 8364752
Showing
5 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM phusion/baseimage:0.9.22 | ||
|
||
# Use baseimage-docker's init system. | ||
CMD ["/sbin/my_init"] | ||
|
||
RUN apt-get update && apt-get install -y xinetd tcpdump \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& rm /etc/xinetd.d/* | ||
|
||
ADD banner_fail /etc/banner_fail | ||
RUN mkdir -p /etc/service/xinetd && mkdir -p /etc/service/tcpdump | ||
ADD xinetd.sh /etc/service/xinetd/run | ||
ADD tcpdump.sh /etc/service/tcpdump/run | ||
RUN chmod +x /etc/service/xinetd/run && chmod +x /etc/service/tcpdump/run | ||
|
||
ADD ctf.xinetd.example /etc/xinetd.d/ctf | ||
|
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 @@ | ||
Your ip reaches access limit, please wait for a while. |
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,19 @@ | ||
service ctf | ||
{ | ||
disable = no | ||
socket_type = stream | ||
protocol = tcp | ||
wait = no | ||
user = root | ||
type = UNLISTED | ||
port = 20000 | ||
bind = 0.0.0.0 | ||
server = /bin/date | ||
server_args = -R | ||
banner_fail = /etc/banner_fail | ||
# safety options | ||
per_source = 10 # the maximum instances of this service per source IP address | ||
rlimit_cpu = 20 # the maximum number of CPU seconds that the service may use | ||
rlimit_as = 512M # the Address Space resource limit for the service | ||
#access_times = 2:00-9:00 12:00-24:00 | ||
} |
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,24 @@ | ||
#!/bin/sh | ||
|
||
if [ -z $TCPDUMP_ENABLE ]; then | ||
echo "Set TCPDUMP_ENABLE to enable packet capture." | ||
exit 0 | ||
fi | ||
|
||
if [ -z $TCPDUMP_DIR ]; then | ||
TCPDUMP_DIR=/var/lib/tcpdump | ||
fi | ||
|
||
if [ -z $TCPDUMP_SPLIT_SIZE ]; then | ||
TCPDUMP_SPLIT_SIZE=10m | ||
fi | ||
|
||
if [ -z $CTF_PORT ]; then | ||
CTF_PORT=20000 | ||
fi | ||
|
||
mkdir -p $TCPDUMP_DIR | ||
echo "TCPDUMP: capture port: $CTF_PORT, split size: $TCPDUMP_SPLIT_SIZE" | ||
exec /usr/sbin/tcpdump -i eth0 port $CTF_PORT -w $TCPDUMP_DIR/capture.pcap -C $TCPDUMP_SPLIT_SIZE | ||
|
||
|
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,4 @@ | ||
#!/bin/sh | ||
|
||
exec /usr/sbin/xinetd -dontfork -stayalive -inetd_compat | ||
|