Skip to content

Commit 3b6db85

Browse files
committed
chore: update patches from latest commit [skip ci]
1 parent fcf7e8c commit 3b6db85

File tree

79 files changed

+3875
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3875
-0
lines changed

patches/.github_workflows_create-patches.yml.patch

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,52 @@ index 3f8c07b..ca1b632 100644
6767
- name: split-patches
6868
+ name: patches
6969
path: patches/
70+
diff --git a/.github/workflows/create-patches.yml b/.github/workflows/create-patches.yml
71+
new file mode 100644
72+
index 0000000..ca1b632
73+
--- /dev/null
74+
+++ b/.github/workflows/create-patches.yml
75+
@@ -0,0 +1,43 @@
76+
+name: Create Patches
77+
+
78+
+on:
79+
+ push:
80+
+ branches: [ "cla" ]
81+
+
82+
+jobs:
83+
+ generate-patches:
84+
+ runs-on: ubuntu-latest
85+
+
86+
+ steps:
87+
+ - name: Checkout repository
88+
+ uses: actions/checkout@v4
89+
+ with:
90+
+ fetch-depth: 0
91+
+ ref: ${{ github.ref_name }}
92+
+
93+
+ - name: Install build dependencies
94+
+ run: sudo apt-get update && sudo apt-get install -y make
95+
+
96+
+ - name: Run make create-patch
97+
+ run: make create-patch
98+
+
99+
+ - name: Commit and push patch files
100+
+ run: |
101+
+ git config user.name "GitHub Actions"
102+
+ git config user.email "actions@github.com"
103+
+
104+
+ if [ -n "$(git status --porcelain patches/)" ]; then
105+
+ git add patches/
106+
+ git commit -m "chore: update patches from latest commit [skip ci]"
107+
+ git push origin HEAD:${GITHUB_REF_NAME}
108+
+ else
109+
+ echo "No changes in patches/ to commit."
110+
+ fi
111+
+ env:
112+
+ GITHUB_REF_NAME: ${{ github.ref_name }}
113+
+
114+
+ - name: Upload patch files as artifact
115+
+ uses: actions/upload-artifact@v4
116+
+ with:
117+
+ name: patches
118+
+ path: patches/

patches/Makefile.patch

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,47 @@ index 07c1f2c..49323ab 100644
142142
/^diff --git a\// { \
143143
if (out) close(out); \
144144
fname = $$3; \
145+
diff --git a/Makefile b/Makefile
146+
index e504646..c4ed576 100644
147+
--- a/Makefile
148+
+++ b/Makefile
149+
@@ -19,6 +19,22 @@ versions:
150+
fi \
151+
done
152+
153+
+create-patch:
154+
+ @mkdir -p patches
155+
+ @echo -e "\e[1;34m[+] Creating and splitting patch from branch 'cla' against 'main' (excluding patches/)...\e[0m"
156+
+ @git fetch origin main >/dev/null 2>&1
157+
+ @git diff origin/main...HEAD -- . ':(exclude)patches/' | awk '\
158+
+ /^diff --git a\// { \
159+
+ if (out) close(out); \
160+
+ fname = $$3; \
161+
+ sub(/^a\//, "", fname); \
162+
+ gsub(/\//, "_", fname); \
163+
+ out = "patches/" fname ".patch"; \
164+
+ } \
165+
+ { if (out) print >> out } \
166+
+ '
167+
+ @echo -e "\e[1;32m[+] Patch files saved to ./patches/\e[0m"
168+
+
169+
PATCH:=./name.patch
170+
patch:
171+
@if [ -f ${PATCH} ]; then \
172+
@@ -32,6 +48,16 @@ patch:
173+
echo -e "\e[1;31m[+] ${PATCH} file does not exist"; \
174+
fi
175+
176+
+patch-all:
177+
+ @for patchfile in patches/*.patch; do \
178+
+ for f in $(wildcard */); do \
179+
+ if [[ -d "$$f" && -f "$$f/Makefile" ]]; then \
180+
+ echo -e "\e[1;35m[+] Patching $$f with $$patchfile\e[0m"; \
181+
+ patch -d $$f --backup-if-mismatch -p2 < "$$patchfile"; \
182+
+ fi \
183+
+ done \
184+
+ done
185+
+
186+
test:
187+
@for DIR_NAME in $(wildcard */); do \
188+
if [ -f $$DIR_NAME/Makefile ]; then \

patches/README.md.patch

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,78 @@ index 49b3bba..a390c25 100644
6565
Files in `challenge/` hold the main challenge logic. `challenge/flag.txt`
6666
contains the flag. `challenge/Dockerfile` runs the challenge container and
6767
`challenge/entrypoint.sh` contains the entrypoint of the container. For
68+
diff --git a/README.md b/README.md
69+
index 49b3bba..d238898 100644
70+
--- a/README.md
71+
+++ b/README.md
72+
@@ -1,4 +1,9 @@
73+
-# LosTemplates - CTF Challenge Templates
74+
+# CyberLeague Challenge Templates
75+
+
76+
+These templates are intended to facilitate the development of challenges for
77+
+the CyberLeagueAustria. This templates forked from LosTemplates by [LosFuzzys](https://github.com/LosFuzzys).
78+
+
79+
+> **Disclaimer:** While most of the features are working as expected in LosTemplates, we only use a subset of them.
80+
81+
Preconfigured CTF challenge templates with sane defaults and an homogeneous
82+
interface. Instanced web, instanced qemu+ssh, jailed pwn, sagemath, and much
83+
@@ -22,7 +27,6 @@ limits? Quickly ssh into a VPS and run `make deploy-docker`. Problems? Run
84+
`make HOST=0.0.0.0`. Your infrastructure team will have an easier time fixing
85+
Kubernetes.
86+
87+
-Powered by [LosFuzzys](https://losfuzzys.net).
88+
89+
## Versions
90+
91+
@@ -59,13 +63,12 @@ You can check for the latest versions within a script [here](https://raw.githubu
92+
93+
### Challenge Author
94+
95+
-Install `docker`, `bash`, `make`, GNU `envsubst`, GNU/BSD `tar`, GNU `coreutils`
96+
-and `parallel`.
97+
+Install `docker`, `bash`, `make`, GNU `envsubst`, GNU/BSD `tar`, GNU `coreutils`, [YQ](https://github.com/mikefarah/yq) and `parallel`.
98+
99+
**Ubuntu**:
100+
```sh
101+
# Ubuntu 24.04
102+
-sudo apt install bash make gettext tar coreutils parallel
103+
+sudo apt install bash make gettext tar coreutils parallel yq
104+
# Install podman or docker at your choice
105+
sudo apt install podman podman-docker
106+
```
107+
@@ -73,14 +76,14 @@ sudo apt install podman podman-docker
108+
**Fedora**:
109+
```sh
110+
# Fedora 42
111+
-sudo dnf install bash make gettext-envsubst tar coreutils parallel
112+
+sudo dnf install bash make gettext-envsubst tar coreutils parallel yq
113+
# Install podman or docker at your choice
114+
sudo dnf install podman podman-docker
115+
```
116+
117+
**Arch**:
118+
```sh
119+
-sudo pacman -S bash make gettext tar coreutils parallel
120+
+sudo pacman -S bash make gettext tar coreutils parallel yq
121+
# Install podman or docker at your choice
122+
sudo pacman -S docker
123+
# If you prefer rootless docker, install it from AUR
124+
@@ -96,7 +99,7 @@ nix develop
125+
126+
### Players
127+
128+
-For Linux: `docker`.
129+
+For Linux: `docker`, `tar`, [snicat](https://github.com/CTFd/snicat) and a linux shell.
130+
131+
For Windows: `docker` (WSL2 backend) and `tar` support.
132+
133+
@@ -107,6 +110,9 @@ template folder. This `Makefile` holds metadata configuration that authors can
134+
change. The name of the challenge will be the name of the folder holding the
135+
`Makefile` (by default).
136+
137+
+> **Note:** CyberLeague uses a `Manifest.yaml` file in addition to the `Makefile`. The configuration for the challenge is then read from the Manifest.
138+
+
139+
+
140+
Files in `challenge/` hold the main challenge logic. `challenge/flag.txt`
141+
contains the flag. `challenge/Dockerfile` runs the challenge container and
142+
`challenge/entrypoint.sh` contains the entrypoint of the container. For

patches/bash-jail-ubuntu24.04_Makefile.patch

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,49 @@ index 2d34021..e574b68 100644
1313
-This is a multiline challenge description!
1414
+$(shell yq ".flag" Manifest.yaml | tr -d '\n' > challenge/flag.txt)
1515

16+
-Feel free to add more lines.
17+
-endef
18+
-export DESC
19+
-export FLAG = $(shell cat challenge/flag.txt)
20+
-export FAKE_FLAG = $(shell cat dist/flag.txt)
21+
-export TAGS = tag1, tag2, tag with space
22+
+export FULLNAME := $(shell yq -o yaml ".name" Manifest.yaml)
23+
+export DESC := $(shell yq -o yaml ".description" Manifest.yaml | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/<br>/g')
24+
+
25+
+# Config for CTFd
26+
+export AUTHOR := $(shell yq -o yaml ".author.name" Manifest.yaml)
27+
+export CATEGORY := $(shell yq -o yaml ".category" Manifest.yaml)
28+
+export FLAG := $(shell cat challenge/flag.txt)
29+
+export FAKE_FLAG := $(shell cat dist/flag.txt)
30+
+export TAGS := $(shell yq -o yaml ".tags" Manifest.yaml)
31+
32+
############################
33+
# Deployment Configuration #
34+
@@ -43,6 +42,9 @@ MKPATH:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
35+
UNCLEAN_NAME=$(notdir ${MKPATH})
36+
export NAME=$(shell echo ${UNCLEAN_NAME} | tr "[:upper:]" "[:lower:]")
37+
38+
+# Config for CTF-Citadel
39+
+export INDEX = $(shell find ../. -maxdepth 1 -type d | sort -h | awk '/\<${UNCLEAN_NAME}\>/{print NR - 1}')
40+
+
41+
# DO NOT TOUCH
42+
# Major: Big features & breakage of interfaces (in sync)
43+
# Minor: Small functionality changes w/ backward compatibility (in sync)
44+
diff --git a/bash-jail-ubuntu24.04/Makefile b/bash-jail-ubuntu24.04/Makefile
45+
index 2d34021..e574b68 100644
46+
--- a/bash-jail-ubuntu24.04/Makefile
47+
+++ b/bash-jail-ubuntu24.04/Makefile
48+
@@ -13,18 +13,17 @@ kill: ckill skill
49+
# CTFd Configuration #
50+
######################
51+
52+
-export FULLNAME = CTFd challenge name
53+
-export AUTHOR = LosFuzzys
54+
-export CATEGORY = pwn
55+
-define DESC
56+
-This is a multiline challenge description!
57+
+$(shell yq ".flag" Manifest.yaml | tr -d '\n' > challenge/flag.txt)
58+
1659
-Feel free to add more lines.
1760
-endef
1861
-export DESC

patches/bash-jail-ubuntu24.04_Manifest.yaml.patch

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,55 @@ index 0000000..0f99a41
5050
+# If a solvescript is present, it is being used to test the challenge
5151
+check: false
5252
\ No newline at end of file
53+
diff --git a/bash-jail-ubuntu24.04/Manifest.yaml b/bash-jail-ubuntu24.04/Manifest.yaml
54+
new file mode 100644
55+
index 0000000..0f99a41
56+
--- /dev/null
57+
+++ b/bash-jail-ubuntu24.04/Manifest.yaml
58+
@@ -0,0 +1,45 @@
59+
+# The name must match the following regex:
60+
+# ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
61+
+name: ctfd-challenge-name
62+
+
63+
+display_name: "CTFd challenge name"
64+
+
65+
+category: misc
66+
+
67+
+# Tags for CTFd
68+
+tags: []
69+
+
70+
+author:
71+
+ name: CTFd author
72+
+ # The email is ignored in gctf & legacy-kdctf
73+
+ email: ""
74+
+
75+
+# This deployment-information is only relevant for yctf
76+
+points:
77+
+ initial: 550
78+
+ decay: 50
79+
+ minimum: 100
80+
+ function: linear
81+
+
82+
+# This deployment-information is only relevant for yctf
83+
+deployment:
84+
+ ports: []
85+
+ web: false
86+
+ compose: false
87+
+ privileged: true
88+
+
89+
+flag: flag{REAL_REAL_REAL_REAL_REAL_REAL}
90+
+
91+
+# The description can be written as block-content, all line breaks are
92+
+# being retained
93+
+# https://yaml.org/spec/1.2.2/#23-scalars
94+
+description: |
95+
+ Description
96+
+
97+
+# The build-flag is only relevant for yctf
98+
+# It indicates if a container needs to be build (false for offline-challenges)
99+
+build: true
100+
+
101+
+# The check-flag is only relevant for yctf
102+
+# If a solvescript is present, it is being used to test the challenge
103+
+check: false
104+
\ No newline at end of file

patches/bash-jail-ubuntu24.04_README.md.patch

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,72 @@ index 0000000..0089775
6767
+- [ ] I would like to be asked whether my challenge may be used in a CTF not mentioned above
6868
+- [ ] I do not want my challenge to be used in a CTF not mentioned above
6969
+- [ ] I don't really care, please just use it and mention me as author
70+
diff --git a/bash-jail-ubuntu24.04/README.md b/bash-jail-ubuntu24.04/README.md
71+
new file mode 100644
72+
index 0000000..0089775
73+
--- /dev/null
74+
+++ b/bash-jail-ubuntu24.04/README.md
75+
@@ -0,0 +1,63 @@
76+
+# Challenge
77+
+
78+
+## Challenge
79+
+
80+
+**Description**
81+
+<!--
82+
+Please describe your challenge in 2-3 lines
83+
+-->
84+
+
85+
+**Difficulty**: <!--Please estimate the difficulty of the challenge EASY/MEDIUM/HARD-->
86+
+
87+
+
88+
+**Deterministic Flags**:
89+
+<!--
90+
+Please let us know if your challenge expects a specific flag.
91+
+This has to be specified as CTFCitadel randomizes flags
92+
+-->
93+
+My challenge:
94+
+- [ ] expects a deterministic flag
95+
+- [ ] works with a randomly-generated flag (the flag is accessible via `os.environ.get("FLAG")`)
96+
+
97+
+
98+
+**Special Infrastructure needs**:
99+
+<!--
100+
+If your challenge has special infrastructure-needs (e.g. min. 1GB RAM) please
101+
+let us know here
102+
+-->
103+
+
104+
+**Other comments**:
105+
+<!--
106+
+This place is to let us know about other stuff
107+
+-->
108+
+
109+
+
110+
+### Allowed usage
111+
+
112+
+Please let us know how you allow this challenge to be used.
113+
+<!-- These are somehow required as these are the main events the challenge is
114+
+build for-->
115+
+- [x] We are allowed to use this challenge during TopHack
116+
+- [x] We are allowed to use this challenge during KaindorfCTF
117+
+- [x] We are allowed to use this challenge during CyberLeage School CTF
118+
+
119+
+
120+
+#### Usage in training ctfs
121+
+If you do not allow us to use your challenge in a specific CTF, we'll respect that.
122+
+- [ ] We are allowed to use this challenge as part of the CyberLeage 24/7
123+
+- [ ] We are allowed to use this challenge as part of the Grazer Linuxtage CTF or as part of a CTF Workshop at the Grazer Linuxtage
124+
+- [ ] We are allowed to use this challenge as part of the trainings
125+
+
126+
+#### Usage at onsite events
127+
+In the past, challenge authors did unfortunately not get access to these event by
128+
+just being challenge creators :/
129+
+- [ ] We are allowed to use this challenge as part of the SecurityWeek CTF
130+
+- [ ] We are allowed to use this challenge as part of the ACSC Bootcamp
131+
+
132+
+
133+
+Please let us know if we are allowed to use your challenge in a different event
134+
+that has not been mentioned above
135+
+
136+
+- [ ] I would like to be asked whether my challenge may be used in a CTF not mentioned above
137+
+- [ ] I do not want my challenge to be used in a CTF not mentioned above
138+
+- [ ] I don't really care, please just use it and mention me as author

0 commit comments

Comments
 (0)