Skip to content

Add ctfd-writeup-upload (participants upload writeup files, admins download them grouped by user) - #63

Open
deploy103 wants to merge 1 commit into
CTFd:masterfrom
deploy103:add-ctfd-writeup-upload
Open

deploy103 wants to merge 1 commit into
CTFd:masterfrom
deploy103:add-ctfd-writeup-upload

Conversation

@deploy103

Copy link
Copy Markdown

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.

  • Participants: up to 100 files each, 20 MB per file, 200 MB total (all configurable constants). They can list and delete their own files. Exact duplicates (SHA-256) are rejected. They cannot download anything.
  • Admins: files grouped by participant, download one file, one participant's files as a ZIP, or everything as a ZIP (streamed). Delete a file.
  • Works on the stock core theme with no theme changes (adds a navbar link through the plugin menu API; SHOW_NAV_LINK = False turns it off for themes with their own link).
  • English by default; translations are plain gettext .po/.mo files (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_request hook parses the body.

Compatibility and tests

Tested on the stock ctfd/ctfd:3.8.3 image 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 into CTFd/plugins/. MIT licensed.

Repo: https://github.com/deploy103/ctfd-writeup-upload (tag v1.0.0)

Feedback is very welcome. Thanks for maintaining this list!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant