Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pwn challenges #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Challenges/Pwn/Goldenwing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
20 changes: 20 additions & 0 deletions Challenges/Pwn/Goldenwing/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/Goldenwing/goldenwing.zip
Binary file not shown.
Binary file added Challenges/Pwn/Goldenwing/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/Goldenwing/pwn
Binary file not shown.
7 changes: 7 additions & 0 deletions Challenges/Pwn/Goldenwing/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
30 changes: 30 additions & 0 deletions Challenges/Pwn/GotIt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
Binary file added Challenges/Pwn/GotIt/GotIt.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions Challenges/Pwn/GotIt/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/GotIt/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/GotIt/pwn
Binary file not shown.
7 changes: 7 additions & 0 deletions Challenges/Pwn/GotIt/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
32 changes: 32 additions & 0 deletions Challenges/Pwn/LoginSystem/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

RUN mkdir /home/ctf/dev

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
20 changes: 20 additions & 0 deletions Challenges/Pwn/LoginSystem/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/LoginSystem/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/LoginSystem/loginsystem.zip
Binary file not shown.
Binary file added Challenges/Pwn/LoginSystem/pwn
Binary file not shown.
9 changes: 9 additions & 0 deletions Challenges/Pwn/LoginSystem/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

head -c8 /dev/urandom > /home/ctf/dev/urandom

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
30 changes: 30 additions & 0 deletions Challenges/Pwn/OneChance/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
Binary file added Challenges/Pwn/OneChance/OneChance.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions Challenges/Pwn/OneChance/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/OneChance/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/OneChance/pwn
Binary file not shown.
7 changes: 7 additions & 0 deletions Challenges/Pwn/OneChance/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
30 changes: 30 additions & 0 deletions Challenges/Pwn/WhereIsFmt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
Binary file added Challenges/Pwn/WhereIsFmt/WhereIsFmt.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions Challenges/Pwn/WhereIsFmt/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/WhereIsFmt/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/WhereIsFmt/pwn
Binary file not shown.
7 changes: 7 additions & 0 deletions Challenges/Pwn/WhereIsFmt/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
30 changes: 30 additions & 0 deletions Challenges/Pwn/luosh/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
20 changes: 20 additions & 0 deletions Challenges/Pwn/luosh/ctf.xinetd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
service ctf
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
type = UNLISTED
port = 9999
bind = 0.0.0.0
server = /usr/sbin/chroot
# replace helloworld to your program
server_args = --userspec=1000:1000 /home/ctf ./pwn
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 = 1024M # the Address Space resource limit for the service
#access_times = 2:00-9:00 12:00-24:00
}
Binary file added Challenges/Pwn/luosh/libc.so.6
Binary file not shown.
Binary file added Challenges/Pwn/luosh/luosh.zip
Binary file not shown.
Binary file added Challenges/Pwn/luosh/pwn
Binary file not shown.
7 changes: 7 additions & 0 deletions Challenges/Pwn/luosh/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Add your startup script
echo $FLAG > /home/ctf/flag && export FLAG=""

# DO NOT DELETE
/etc/init.d/xinetd start;
sleep infinity;
30 changes: 30 additions & 0 deletions Challenges/Pwn/return15/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \
apt-get update && apt-get -y dist-upgrade && \
apt-get install -y lib32z1 xinetd

RUN useradd -m ctf

WORKDIR /home/ctf

RUN cp -R /usr/lib* /home/ctf

RUN mkdir /home/ctf/bin && \
cp /bin/sh /home/ctf/bin && \
cp /bin/ls /home/ctf/bin && \
cp /bin/cat /home/ctf/bin

COPY ./ctf.xinetd /etc/xinetd.d/ctf
COPY ./start.sh /start.sh
RUN echo "Blocked by ctf_xinetd" > /etc/banner_fail

RUN chmod +x /start.sh

COPY ./pwn /home/ctf/
RUN chown -R root:ctf /home/ctf && \
chmod -R 750 /home/ctf

CMD ["/start.sh"]

EXPOSE 9999
Loading