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

New chain 25 #45

Open
wants to merge 3 commits into
base: master
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
1 change: 1 addition & 0 deletions ansible/roles/deploy_tasks/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
- 24
- 27
- 28
- 2502

- name: upload cleanup docker script
copy:
Expand Down
18 changes: 18 additions & 0 deletions ansible/roles/deploy_tasks/templates/suzen2502.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

ID="$1"
TAG="$2"
if [ "$TAG" == "latest" ]; then
TAG="latest:1234567890"
fi

dockerstdout=$(docker exec ${ID} md5sum /home/suzen/diary.txt)
echo $dockerstdout
dockerstdout=$(tr -dc '[[:print:]]' <<< "$dockerstdout")
md5=$(echo ${dockerstdout} | awk '{print $1}')
echo $md5

if [[ "$md5"="c00f9a27ecb962c76600167ebc3e2dc7" && 'stat -c %A /home/suzen/diary.txt'="--w-r--rw-" ]]; then
FLAG="{{ levels | selectattr('name', 'equalto', 'suzen2502') | map(attribute='flag') | join(',') }}"
docker exec ${ID} mkdir "/home/suzen/${FLAG}"
fi
23 changes: 23 additions & 0 deletions ansible/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,29 @@ levels :
flag : "V2kwTGFlN0FwaGllTmd1OWVlc2gK"
chain : 19

#Chain25
#chmod W
- name : suzen2501
password: "suzen2501"
sault : "vsiuyTqw"
flag : "Gj5DjtFMvw59AlcmwTh6Hd6bAyhR"
chain : 25

# chmod R
- name : suzen2502
password: "Gj5DjtFMvw59AlcmwTh6Hd6bAyhR"
sault : "vsiuyTqw"
flag : "V2kwTGFlN0FwaGllTmd1OWVlc2gK"
chain : 25

#chmod X, R + find
- name : suzen2503
password: "V2kwTGFlN0FwaGllTmd1OWVlc2gK"
sault : "vsiuyTqw"
flag : "YWVnaGdTanVvejd2b5760HNvaEwK"
chain : 25


## EXAMPLE TEMPLATE
# - name : suzen
# password: ""
Expand Down
12 changes: 12 additions & 0 deletions chains/chain25/level2501/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM debian:buster

ADD hello /bin
RUN useradd -m suzen

ADD flag /home/suzen

RUN chmod 000 /home/suzen/flag && chown suzen /home/suzen/flag

ENTRYPOINT ["/bin/hello"]
WORKDIR /home/suzen
USER suzen
1 change: 1 addition & 0 deletions chains/chain25/level2501/flag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gj5DjtFMvw59AlcmwTh6Hd6bAyhR
9 changes: 9 additions & 0 deletions chains/chain25/level2501/hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo -e "\n#############################################"
echo -e "# #"
echo -e "# Hello! It's level 2501 #"
echo -e "# #"
echo -e "# Read file with the FLAG #"
echo -e "# #"
echo -e "#############################################"
bash
12 changes: 12 additions & 0 deletions chains/chain25/level2502/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM debian:buster

ADD hello /bin
RUN useradd -m suzen

ADD diary.txt /home/suzen

RUN chmod 000 /home/suzen/diary.txt && chown suzen /home/suzen/diary.txt

ENTRYPOINT ["/bin/hello"]
WORKDIR /home/suzen
USER suzen
Empty file.
14 changes: 14 additions & 0 deletions chains/chain25/level2502/hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
echo -e "\n#############################################"
echo -e "# #"
echo -e "# Hello! It's level 2502 #"
echo -e "# #"
echo -e "# Give such rights to diary.txt : #"
echo -e "# -Owner only to Write, #"
echo -e "# -Group only to Read #"
echo -e "# -Others to Read and Write #"
echo -e "# And write "SuzenEscape" to diary.txt #"
echo -e "# Wait for 1 minute and the flag will appear#"
echo -e "# #"
echo -e "#############################################"
bash
14 changes: 14 additions & 0 deletions chains/chain25/level2503/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:buster

ADD hello /bin
RUN useradd -m suzen

ADD Help /home/suzen
ADD fLaG /run/lock
RUN chmod -R -x /run/lock && chown suzen /run/lock

RUN chmod -r /home/suzen/Help && chown suzen /home/suzen/Help && chmod -R -x /home/suzen

ENTRYPOINT ["/bin/hello"]
WORKDIR /home
USER suzen
1 change: 1 addition & 0 deletions chains/chain25/level2503/Help
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You will find the flag in file "fLaG", but I don't know where it is. Saaaaave me, help me to escape
7 changes: 7 additions & 0 deletions chains/chain25/level2503/fLaG
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Congratulations, now you know something about chmod and find.
Your knowledge helped me to escape. Thank you.
Here is your flag.

YWVnaGdTanVvejd2b5760HNvaEwK

Have a good day or night :)
9 changes: 9 additions & 0 deletions chains/chain25/level2503/hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo -e "\n#############################################"
echo -e "# #"
echo -e "# Hello! It's level 2503 #"
echo -e "# #"
echo -e "# I won't help you. You can do it. #"
echo -e "# #"
echo -e "#############################################"
bash