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

Update with in game admin #7

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
692b816
Removed short names from task list. Only display point values
gartnera Jan 28, 2016
cea92f1
Modified description text.
gartnera Jan 28, 2016
1ab38ff
Updated task text.
gartnera Jan 28, 2016
55ffb1f
Hide attatchment text if there is no attachment.
gartnera Jan 28, 2016
bef6bbd
Modified the database structure.
gartnera Jan 29, 2016
cbdec0a
Updated task route to accommodate database changes.
gartnera Jan 29, 2016
608ac04
Removed unneeded enumerate.
gartnera Jan 29, 2016
395a768
Updated tasks code to show add buttons for categories and tasks.
gartnera Jan 29, 2016
b743c34
Added admin_required decorator and associated error
gartnera Jan 29, 2016
5ce38cf
Updated get_user code, calls, and template.
gartnera Jan 29, 2016
0d3505c
Fixed missing closing tag
gartnera Jan 29, 2016
791b3b0
Added functionaly to add categories
gartnera Jan 29, 2016
8d0bb7b
Moved admin check to grid build from template.
gartnera Jan 29, 2016
e67b0b1
Added logic to allow add-box for empty categories
gartnera Jan 29, 2016
6b515e0
Added task creation functionality.
gartnera Jan 29, 2016
58086e3
Client side changes to match server side
gartnera Jan 29, 2016
67e88c8
Task addition template
gartnera Jan 29, 2016
8fd1c18
Removed short_name from categories table.
gartnera Jan 29, 2016
72d7a78
Added percentage ring around tasks.
gartnera Feb 1, 2016
8a8881c
Added class to chall-box span
gartnera Feb 1, 2016
db1dfc7
Added basic edit functionality.
gartnera Feb 1, 2016
3e9a5c0
Added edit button on task if admin.
gartnera Feb 1, 2016
eb2dac7
Fixed if isAdmin wrong line
gartnera Feb 1, 2016
641cbaf
Added file upload functionality to task creation
gartnera Feb 1, 2016
04ca62b
Remove description <p></p> wrapping
gartnera Feb 1, 2016
1381cae
Updated and added more SQL for delete cascade.
gartnera Feb 1, 2016
2922844
Disable task flag input when solved.
gartnera Feb 1, 2016
4da87e6
Added logic for task page if no tasks present in database.
gartnera Feb 1, 2016
0858d09
Added edit file (replace/add) file functionality
gartnera Feb 1, 2016
b469b11
Initial work on mobile compatibility.
gartnera Feb 1, 2016
40be195
Added animated/interactive background. More mobile tweaks.
gartnera Feb 2, 2016
84ac4cd
Updated templates for new background
gartnera Feb 2, 2016
1084c9e
Updated SQL and added email field to users.
gartnera Feb 2, 2016
9200ada
Added code to encforce sqlite foreign key constraits.
gartnera Feb 2, 2016
8242bcb
Added email field when logging in
gartnera Feb 2, 2016
64c48ef
Added proxy config option and associated code
gartnera Feb 2, 2016
04b2b01
Added IP logging
gartnera Feb 2, 2016
73277b5
Changed font to improve cross platform compatibility.
gartnera Feb 2, 2016
612e8d9
Fixed error message not visible
gartnera Feb 2, 2016
9c822d3
Added configuration option for competition start time.
gartnera Feb 3, 2016
48aef29
Update for uWSGI compatibility.
gartnera Feb 3, 2016
f76b29d
Updated dependencies
gartnera Feb 3, 2016
4304800
Readded hidden user field. Hide admin by default.
gartnera Feb 3, 2016
4923f3e
Switched from htmllaundry to bleach
gartnera Feb 3, 2016
ab4b5da
Updated deployment instructions
gartnera Feb 7, 2016
d719eb4
Added scoreboard.json url/endpoint
gartnera Feb 7, 2016
a134d11
If no value specified in edit flag field, use the original value.
gartnera Feb 8, 2016
eeb39e3
Removed old code and files.
gartnera Feb 8, 2016
51210d8
Added command to create files folder
gartnera Feb 8, 2016
3b96a8f
Updated image
gartnera Feb 9, 2016
f4df8b3
Added delete button and functionality for tasks
gartnera Feb 12, 2016
2dc3192
Simplified task grid page logic.
gartnera Mar 5, 2016
86f8d70
Added category edit/delete functionality.
gartnera Mar 5, 2016
e7abb5e
Exclude hidden users from percent complete calculation.
gartnera Mar 27, 2016
5fa79c8
Update dateutil/dateparser usages to match upstream changes.
gartnera Mar 30, 2016
5bacc3a
Updated dependencies
gartnera Mar 31, 2016
33b0d76
Added placeholder text for flag edit
gartnera Mar 31, 2016
e0d4dd3
Optimized tasks page generation code.
gartnera Apr 2, 2016
c18f3f0
Added settings page to change password and email.
gartnera Apr 10, 2016
149a652
Removed animated background
gartnera Mar 5, 2017
64ecdc9
Added requirements.txt
gartnera Mar 5, 2017
e017db7
Added settings template
gartnera Mar 5, 2017
f60fc14
Made description optional.
gartnera Mar 25, 2017
0dff113
Changed settings password field type.
gartnera Mar 27, 2017
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
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tinyctf-platform

`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.

![alt text](http://i.imgur.com/dqGeLNM.jpg "tinyctf-platform in action")
![alt text](https://i.imgur.com/ofB52E4.png "tinyctf-platform in action")

Deployment
----------
Expand All @@ -20,21 +20,24 @@ Install some prerequisites
yum install -y git
yum install -y gcc-c++
yum install -y python-devel
yum install -y sqlite3

Install Flask and dataset

easy_install Flask
easy_install dataset
easy_install python-dateutil
easy_install bleach
exit

Clone the repo

git clone https://github.com/balidani/tinyctf-platform.git
cd tinyctf-platform/

Import the tasks
Build the database

python task_import.py
./buildTables.sh

Start the server

Expand All @@ -46,4 +49,3 @@ Caveats
-------

* CSRF is currently not addressed
* The platform does not support tasks with the same score and category right now
10 changes: 10 additions & 0 deletions buildTables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

mkdir static/files

sqlite3 ctf.db 'CREATE TABLE categories ( id INTEGER PRIMARY KEY, name TEXT );'
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);'

sqlite3 ctf.db 'CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT NOT NULL, email TEXT, isAdmin BOOLEAN, isHidden BOOLEAN, password TEXT)';

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);'
6 changes: 5 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

"host": "0.0.0.0",
"port": 8888,

"isProxied": false,

"startTime": "3-31-16 8:00AM",

"db": "sqlite:///ctf.db",

"language_file": "lang.json",
"language": "english",

"debug": false
}
}
37 changes: 34 additions & 3 deletions lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,54 @@
"submit": "Submit",
"success": "Correct flag!",
"failure": "Incorrect flag",
"points_format": "%d points",
"solution_format": "solved by %d",
"no_description": "(none)",
"placeholder": "flag{insert_flag_here}"
"placeholder": "Flag goes here"
},
"addcat" : {
"add_title": "Add a Category",
"edit_title": "Edit a Category",
"delete_title": "Delete a Category",
"delete_desc": "Are you sure you want to delete this category?",
"name_label": "Category Name: "
},
"addtask" : {
"add_title": "Add a Task",
"edit_title": "Edit a Task",
"delete_title": "Delete task",
"delete_desc": "Are you sure you want to delete this task?",
"cat_label": "Category: ",
"name_label": "Task Name: ",
"description_label": "Description: ",
"flag_label": "Flag: ",
"score_label": "Score: "
},
"scoreboard": {
"title": "Scoreboard",
"player": "Player",
"score": "Score"
},
"settings": {
"title": "Settings",
"old_pw": "Current Password:",
"new_pw": "New Password:",
"email": "Email:"
},
"error": {
"title": "Error",
"unknown": "Unknown error",
"login_required": "You need to be logged in to see this page",
"admin_required": "You need to be an admin to see this page",
"invalid_credentials": "Invalid username or password",
"invalid_password": "The password you entered does not match your current password",
"already_registered": "This user is already registered",
"empty_user": "Empty username is not allowed",
"task_not_found": "TBD"
"task_not_found": "TBD",
"form": "Invalid form input",
"not_started": "Competition hasn't started yet"


}
}
}
}
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Flask
dataset
python-dateutil
bleach
Loading