Skip to content

Commit 4f07d52

Browse files
committed
Final state of competition
1 parent 5ec0245 commit 4f07d52

Some content is hidden

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

49 files changed

+3166
-1
lines changed

_backupFinal

Lines changed: 0 additions & 1 deletion
This file was deleted.

_final/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Dániel Bali
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

_final/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
tinyctf-platform
2+
================
3+
4+
`tinyctf-platform` is yet another open-source (jeopardy style) CTF platform. It is relatively easy to set up and modify. Hopefully it will become even better over time, with other people contributing.
5+
6+
![alt text](https://i.imgur.com/ofB52E4.png "tinyctf-platform in action")
7+
8+
Deployment
9+
----------
10+
11+
To deploy `tinyctf-platform` on an EC2 instance, execute the following commands:
12+
13+
Become root, upgrade
14+
15+
sudo su
16+
yum upgrade -y
17+
18+
Install some prerequisites
19+
20+
yum install -y git
21+
yum install -y gcc-c++
22+
yum install -y python-devel
23+
yum install -y sqlite3
24+
25+
Install Flask and dataset
26+
27+
easy_install Flask
28+
easy_install dataset
29+
easy_install dateparser
30+
easy_install bleach
31+
exit
32+
33+
Clone the repo
34+
35+
git clone https://github.com/balidani/tinyctf-platform.git
36+
cd tinyctf-platform/
37+
38+
Build the database
39+
40+
./buildTables.sh
41+
42+
Start the server
43+
44+
python server.py
45+
46+
*Note*: Flask should run on top of a proper web server if you plan to have many players.
47+
48+
Caveats
49+
-------
50+
51+
* CSRF is currently not addressed

_final/buildTables.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
mkdir static/files
4+
5+
sqlite3 ctf.db 'CREATE TABLE categories ( id INTEGER PRIMARY KEY, name TEXT );'
6+
sqlite3 ctf.db 'CREATE TABLE tasks (id INTEGER PRIMARY KEY, name TEXT, desc TEXT, file TEXT, flag TEXT, score INT, category INT, FOREIGN KEY(category) REFERENCES categories(id) ON DELETE CASCADE);'
7+
8+
sqlite3 ctf.db 'CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT NOT NULL, email TEXT, isAdmin BOOLEAN, isHidden BOOLEAN, password TEXT)';
9+
10+
sqlite3 ctf.db 'CREATE TABLE flags (task_id INTEGER, user_id INTEGER, score INTEGER, timestamp BIGINT, ip TEXT, PRIMARY KEY (task_id, user_id), FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE);'

_final/config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"secret_key": "imepprules",
3+
4+
"host": "0.0.0.0",
5+
"port": 4444,
6+
7+
"isProxied": false,
8+
9+
"startTime": "3-18-16 15:30PM",
10+
"endTime": "3-22-16 12:00PM",
11+
12+
"db": "sqlite:///ctf.db",
13+
14+
"language_file": "lang.json",
15+
"language": "portugues",
16+
17+
"debug": true
18+
}

_final/ctf.db

20 KB
Binary file not shown.

_final/lang.json

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"english": {
3+
"frame": {
4+
"title": "CTFIME 0x0",
5+
"toggle": "Toggle navigation",
6+
"login": "Sign in",
7+
"register": "Register",
8+
"logged_in": "Logged in as",
9+
"logout": "log out"
10+
},
11+
"main": {
12+
"title": "IMESEC - CTFIME 0x0",
13+
"text": "Primeiro Capture The Flag realizado pela IME++/IMESEC"
14+
},
15+
"about": {
16+
"title": "About",
17+
"news": "News",
18+
"news_text": "Aproveitem as 48h para ver todas as questões, procurarem na internet, conversar com os outros da equipe.<br>O objetivo desse Capture The Flag é incentivar que todos pesquisem como as coisas funcionam, então aproveitem para aprender!",
19+
"rules": "Rules",
20+
"rules_text": "- Equipes de até 3 pessoas utilizando apenas uma conta<br>- Toda consulta é válida e recomendada<br>- As flags devem ser submetidas com o formato: CTFIME{FLAG}"
21+
},
22+
"tasks": {
23+
"title": "Tasks"
24+
},
25+
"task": {
26+
"description": "Description",
27+
"attachment": "Attachment",
28+
"submit": "Submit",
29+
"success": "Correct flag!",
30+
"failure": "Incorrect flag",
31+
"points_format": "%d points",
32+
"solution_format": "solved by %d",
33+
"no_description": "(none)",
34+
"placeholder": "CTFIME{insert_flag}",
35+
"hint": "Hint",
36+
"no_hint": "(none)",
37+
"show_hint": "Show"
38+
},
39+
"addcat" : {
40+
"title": "Add a Category",
41+
"name_label": "Category Name: "
42+
},
43+
"addtask" : {
44+
"add_title": "Add a Task",
45+
"edit_title": "Edit a Task",
46+
"delete_title": "Delete task",
47+
"delete_desc": "Are you sure you want to delete this task?",
48+
"cat_label": "Category: ",
49+
"name_label": "Task Name: ",
50+
"description_label": "Description: ",
51+
"hint_label": "Hint: ",
52+
"flag_label": "Flag: ",
53+
"score_label": "Score: "
54+
},
55+
"scoreboard": {
56+
"title": "Scoreboard",
57+
"player": "Player",
58+
"score": "Score"
59+
},
60+
"chat":{
61+
"title": "Chat"
62+
},
63+
"error": {
64+
"title": "Error",
65+
"unknown": "Unknown error",
66+
"login_required": "You need to be logged in to see this page",
67+
"admin_required": "You need to be an admin to see this page",
68+
"invalid_credentials": "Invalid username or password",
69+
"already_registered": "This user is already registered",
70+
"empty_user": "Empty username is not allowed",
71+
"task_not_found": "TBD",
72+
"form": "Invalid form input",
73+
"not_started": "Competition hasn't started yet",
74+
"finished": "Competition has already ended"
75+
}
76+
},
77+
78+
"portugues": {
79+
"frame": {
80+
"title": "CTFIME",
81+
"toggle": "Mudar navegação;",
82+
"login": "Entrar",
83+
"register": "Registrar",
84+
"logged_in": "Logado como",
85+
"logout": "sair"
86+
},
87+
"main": {
88+
"title": "CTFIME 0x01",
89+
"text": "Seja bem vindo ao primeiro CTFIME!"
90+
},
91+
"about": {
92+
"title": "Sobre",
93+
"news": "Novidades",
94+
"news_text": "Aproveitem as 48h para ver todas as questões, procurarem na internet, conversar com os outros da equipe.<br>O objetivo desse Capture The Flag é incentivar que todos pesquisem como as coisas funcionam, então aproveitem para aprender!",
95+
"rules": "Regras",
96+
"rules_text": "- Equipes de até 3 pessoas utilizando apenas uma conta<br>- Toda consulta é válida e recomendada<br>- As flags devem ser submetidas com o formato: CTFIME{FLAG}"
97+
},
98+
"tasks": {
99+
"title": "Tarefas"
100+
},
101+
"task": {
102+
"description": "Descrição",
103+
"attachment": "Anexo",
104+
"submit": "Enviar",
105+
"success": "FLAG CORRETA!",
106+
"failure": "Flag incorreta!",
107+
"points_format": "%d pontos",
108+
"solution_format": "Resolvido por %d",
109+
"no_description": "(sem descrição)",
110+
"placeholder": "CTFIME{insira a flag aqui}",
111+
"hint": "Dica",
112+
"no_hint": "(sem dicas)",
113+
"show_hint": "Mostrar"
114+
},
115+
"addcat" : {
116+
"title": "Adicionar categoria",
117+
"name_label": "Nome da categoria: "
118+
},
119+
"addtask" : {
120+
"add_title": "Adicionar tarefa",
121+
"edit_title": "Editar tarefa",
122+
"delete_title": "Deletar tarefa",
123+
"delete_desc": "Tem certeza de que deseja deletar esta tarefa?",
124+
"cat_label": "Categoria: ",
125+
"name_label": "Nome da tarefa: ",
126+
"description_label": "Descrição: ",
127+
"hint_label": "Dica: ",
128+
"flag_label": "Flag: ",
129+
"score_label": "Pontuação: "
130+
},
131+
"scoreboard": {
132+
"title": "Scoreboard",
133+
"player": "Player",
134+
"score": "Pontuação"
135+
},
136+
"chat":{
137+
"title": "Chat"
138+
},
139+
"error": {
140+
"title": "Erro",
141+
"unknown": "Erro desconhecido",
142+
"login_required": "Você precisa se logar para ver esta página",
143+
"admin_required": "Você precisa ser admin para ver esta página",
144+
"invalid_credentials": "Nome de usuário ou senha incorretos",
145+
"already_registered": "Este usuário já existe",
146+
"empty_user": "Usuário vazio não permitido",
147+
"task_not_found": "TBD",
148+
"form": "Entrada inválida",
149+
"not_started": "A competição ainda não começou!",
150+
"finished": "A competição já acabou!"
151+
}
152+
}
153+
}

0 commit comments

Comments
 (0)