-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
ChoiSian
committed
Jul 30, 2023
1 parent
a5412e3
commit f81f77c
Showing
6 changed files
with
58 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
*.DS_Store | ||
*.gdb_history |
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 @@ | ||
FROM ubuntu:16.04 | ||
MAINTAINER insp3ct0r_x | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV TZ Asia/Seoul | ||
|
||
RUN sed -i "s/archive.ubuntu.com/mirror.kakao.com/g" /etc/apt/sources.list | ||
RUN apt update && apt upgrade -y | ||
RUN apt install xinetd gdbserver binutils -y | ||
|
||
RUN dpkg --add-architecture i386 | ||
RUN apt update | ||
RUN apt install libc6-dbg libc6:i386 libc6-dbg:i386 -y | ||
|
||
WORKDIR /root/ | ||
COPY chall.bin /root/ | ||
RUN chmod 755 /root/chall.bin | ||
COPY chall.daemon /etc/xinetd.d/chall | ||
RUN echo "chall 9929/tcp" >> /etc/services | ||
|
||
COPY ep.sh /root/ | ||
RUN chmod 755 /root/ep.sh | ||
ENTRYPOINT ["/root/ep.sh"] |
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,11 @@ | ||
service chall | ||
{ | ||
socket_type = stream | ||
flags = REUSE | ||
wait = no | ||
protocol = tcp | ||
user = root | ||
disable = no | ||
server = /root/chall.bin | ||
port = 9929 | ||
} |
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,10 @@ | ||
services: | ||
chall: | ||
build: ./ | ||
ports: | ||
- "9929:9929" # for challenge | ||
- "929:929" # for remote debugging | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined |
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 @@ | ||
#!/bin/bash | ||
|
||
echo "[!] Container is started... Setting up xinetd" | ||
/etc/init.d/xinetd restart 1>/dev/null | ||
|
||
echo "[!] If challenge session is connected, gdbserver is run automatically..." | ||
while [[ 1 ]]; do | ||
PID=$(pidof /root/chall.bin 2>/dev/null) | ||
if [[ -n $PID ]]; then | ||
gdbserver 0.0.0.0:929 --attach $PID 2>/dev/null | ||
fi | ||
done |