-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.json
More file actions
344 lines (344 loc) · 8.79 KB
/
schema.json
File metadata and controls
344 lines (344 loc) · 8.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"enabled",
"name",
"slug",
"author",
"category",
"difficulty",
"type",
"flag"
],
"properties": {
"version": {
"type": "string",
"pattern": "^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$",
"description": "The version of the challenge schema",
"examples": [
"1",
"1.0",
"1.0.0"
],
"default": "1"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "Whether the challenge is enabled or not. If disabled, this forces the challenge to not be deployed or interacted with.\nShould only be false if the challenge is not ready."
},
"name": {
"type": "string",
"description": "The name of the challenge",
"examples": [
"Example Challenge"
],
"minLength": 1,
"maxLength": 50
},
"slug": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "The slug of the challenge",
"examples": [
"example-challenge"
],
"minLength": 1,
"maxLength": 50
},
"author": {
"type": "string",
"description": "The author of the challenge",
"examples": [
"John Smith"
],
"minLength": 1,
"maxLength": 100
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9-_:;? ]+$",
"minLength": 1,
"maxLength": 50
},
"description": "Tags for the challenge. Used for filtering and searching.",
"default": []
},
"prerequisites": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"description": "The prerequisites of the challenge. Must be the slugs of the challenges.",
"pattern": "^[a-z0-9-]+$",
"minLength": 1,
"maxLength": 100
},
"description": "Required challenges to solve before this challenge can be displayed"
},
"category": {
"type": "string",
"description": "The category of the challenge",
"enum": [
"web",
"forensics",
"rev",
"crypto",
"pwn",
"boot2root",
"osint",
"misc",
"blockchain",
"mobile",
"test"
]
},
"difficulty": {
"type": "string",
"enum": [
"beginner",
"easy",
"easy-medium",
"medium",
"medium-hard",
"hard",
"very-hard",
"insane"
],
"description": "The difficulty of the challenge"
},
"type": {
"type": "string",
"enum": [
"static",
"shared",
"instanced"
],
"default": "static",
"description": "The type of challenge.\nStatic challenges represent challenges utilizing delivered files and information.\nShared challenges represent challenges that are hosted on a server and shared among multiple teams.\nInstanced challenges represent challenges that are hosted on a server and are unique to each user/team."
},
"instanced_type": {
"type": "string",
"enum": [
"web",
"tcp",
"none"
],
"default": "none",
"description": "The type of instanced challenge.\nDefines how users interact with the challenge."
},
"instanced_name": {
"description": "The slug of the instanced challenge. This is applicable if the `type` is `instanced` and another instance is used instead of itself. May also be itself to specify that the challenge is instanced but does not use another instance.",
"examples": [
"example-challenge",
null
],
"oneOf": [
{
"type": "null"
},
{
"type": "string",
"default": null,
"pattern": "^[a-z0-9-]+$",
"minLength": 1,
"maxLength": 50
}
]
},
"instanced_subdomains": {
"type": "array",
"items": {
"type": "string",
"pattern": "^((web|tcp):)?[a-z0-9-]+$",
"description": "The subdomain of the instanced challenge. This is applicable if the `type` is `instanced` and the challenge is hosted on a server. It will be prefixed with the instanced domain. Each entry may optionally be prefixed with `web:` or `tcp:` (e.g., `web:api`, `tcp:service`, or just `admin`). The prefix indicates the protocol associated with the subdomain.",
"minLength": 0,
"maxLength": 10,
"examples": [
"web",
"admin",
"api",
"tcp:service",
"web:dashboard"
]
},
"description": "The subdomains of the instanced challenge. This is applicable if the `type` is `instanced` and the challenge is hosted on a server. It will be prefixed with the instanced domain.",
"default": [],
"minItems": 0,
"maxItems": 5,
"uniqueItems": true,
"examples": [
[
"web",
"admin",
"api"
],
[
"api"
]
]
},
"connection": {
"type": [
"string",
"null"
],
"default": null,
"description": "The connection string for the challenge. This is applicable if the `type` is not `instanced` and the challenge is hosted on a server. It is used to display connection information for the challenge. You can use the variable `${host}` in the string, which will be replaced with the website domain when rendered.",
"maxLength": 255,
"examples": [
"http://example.com",
"nc example.com 1337",
"nc ${host} 1337"
]
},
"points": {
"type": "integer",
"minimum": 1,
"maximum": 10000,
"default": 1000,
"description": "The amount of points the challenge is worth from the start"
},
"decay": {
"type": "integer",
"minimum": 0,
"maximum": 10000,
"default": 75,
"description": "The percentage of points lost over time"
},
"min_points": {
"type": "integer",
"minimum": 1,
"maximum": 1000,
"default": 100,
"description": "The minimum amount of points the challenge can be worth. min_points must be less than or equal to points."
},
"flag": {
"oneOf": [
{
"type": "string",
"pattern": "^(\\w{2,10}\\{[^}]*\\}|dynamic|null)$",
"minLength": 4,
"maxLength": 1000
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string",
"pattern": "^(\\w{2,10}\\{[^}]*\\}|dynamic|null)$",
"minLength": 4,
"maxLength": 1000
},
{
"type": "object",
"required": [
"flag"
],
"properties": {
"flag": {
"type": "string",
"pattern": "^(\\w{2,10}\\{[^}]*\\}|dynamic|null)$",
"minLength": 4,
"maxLength": 1000
},
"case_sensitive": {
"type": "boolean",
"default": true,
"examples": [
true,
false
],
"description": "Whether the flag is case sensitive or not. If false, the flag will be checked case insensitively. Default is true."
}
}
}
]
},
"minItems": 1
}
],
"description": "The flag of the challenge. May be a single string or an array of strings. Each may be 'dynamic', 'null', or a flag like 'flag{...}'. `flag` may be replaced with between 2 and 10 word chars. If case sensitivity is not explicitly specified, the flag is case sensitive.",
"examples": [
"flag{flag}",
[
"flag{flag1}",
"flag{flag2}"
],
[
{
"flag": "flag{flag1}",
"case_sensitive": true
},
{
"flag": "flag{flag2}",
"case_sensitive": false
}
]
]
},
"description_location": {
"type": "string",
"description": "The location of the description file relative to the challenge directory",
"default": "description.md",
"pattern": "^[a-zA-Z0-9-_\/.]+\\.md$",
"examples": [
"description.md"
]
},
"dockerfile_locations": {
"type": "array",
"items": {
"type": "object",
"required": [
"location",
"context"
],
"properties": {
"location": {
"type": "string",
"description": "The location of the Dockerfile relative to the challenge directory",
"pattern": "^[a-zA-Z0-9-_\/.]+$",
"examples": [
"src/Dockerfile"
]
},
"context": {
"type": "string",
"description": "The context of the Dockerfile relative to the challenge directory",
"pattern": "^[a-zA-Z0-9-_\/.]+$",
"examples": [
"src/"
]
},
"identifier": {
"type": [
"string",
"null"
],
"description": "The identifier of the Dockerfile to suffix the docker image with (None, null, or empty string for no suffix)",
"examples": [
"None",
null
]
}
}
},
"description": "The locations of the Dockerfiles relative to the challenge directory.\nMultiple Dockerfiles can be specified if the challenge requires multiple images.",
"default": []
},
"handout_dir": {
"type": "string",
"description": "The location of the handout directory relative to the challenge directory. Handout directory contains all files that are handed out to users (zipped to a single file that are stored in <category>_<slug>.zip in the files directory).",
"default": "handout",
"pattern": "^[a-zA-Z0-9-_\/]+$",
"examples": [
"handout"
]
}
}
}