Repository navigation
Add ctfd-writeup-upload (participants upload writeup files, admins download them grouped by user) - #63
Open
deploy103 wants to merge 1 commit into
Open
Add ctfd-writeup-upload (participants upload writeup files, admins download them grouped by user)#63deploy103 wants to merge 1 commit into
deploy103 wants to merge 1 commit into
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a149bb-17c6-71eb-9c6b-a8f71a8eb73c Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi CTFd team,
I'd like to add ctfd-writeup-upload, a plugin I wrote for a university CTF, to the community list.
What it does
After (or during) a CTF, participants upload their writeups as real files. Admins download them grouped by participant. Most writeup plugins I could find store plain text or are meant for manual grading; this one handles files (
.pdf .zip .md .txt) and treats them as untrusted input.coretheme with no theme changes (adds a navbar link through the plugin menu API;SHOW_NAV_LINK = Falseturns it off for themes with their own link)..po/.mofiles (a Korean example is included).Security notes (documented in the README)
CSRF nonce on every POST, extension plus magic-byte checks, files stored under random names outside the web root, nothing is ever served inline, escaped file names, per-user locking against concurrent uploads, and a WSGI guard that rejects oversized requests before CTFd's global
before_requesthook parses the body.Compatibility and tests
Tested on the stock
ctfd/ctfd:3.8.3image with MariaDB. The repo ships an end-to-end test (~90 checks: limits, IDOR, CSRF, permissions, ZIPs, concurrency, size guard) and a Playwright browser test (~47 checks), both run against a fresh CTFd.Repo layout
The repository root is the plugin (
__init__.py,config.json,templates/,translations/), so it can be cloned straight intoCTFd/plugins/. MIT licensed.Repo: https://github.com/deploy103/ctfd-writeup-upload (tag
v1.0.0)Feedback is very welcome. Thanks for maintaining this list!