e54d98498c8d04de4a9764a62d9dc7a8d7c7f8c4
- plugin_tests/: 9 tests running the plugin inside CTFd 3.8.9's test app (users and teams mode): own/shared flags, single reports, admins, invalid owners and empty flags, teams, create_flag_if_missing, the admin flag form, the admin page and dismissing. - make venv (uv, Python 3.11), make lint, make format, make test: same tools and versions as ctfd-whale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ctfd-cheaters
A CTFd plugin that detects flag sharing through personal flags: flags generated for one user (for example by ctfd-whale for each user's instance).
- Adds the
personalflag type. Its data is the id of the user the flag belongs to. - Any user's personal flag is accepted, so a shared flag still solves the challenge. When an account submits a personal flag that belongs to another account, the cheat is recorded once and logged.
- In teams mode, sharing a flag within a team is not reported. Admins (e.g. testing challenges in preview mode) are never reported.
- Cheaters in the admin menu lists the reports, with their challenge, users, teams, flag and date; reports can be dismissed.
Requirements
- CTFd 3.8.9 (the version this plugin targets).
- Challenges with personal flags must use the any flag logic: "all" would require every user's flag.
Installation
Install it as CTFd/plugins/ctfd_cheaters (with an underscore): other
plugins import it as CTFd.plugins.ctfd_cheaters, and its assets are
served from that directory.
git clone <this repository> CTFd/CTFd/plugins/ctfd_cheaters
For other plugins
from CTFd.plugins.ctfd_cheaters import create_flag_if_missing
flag_id = create_flag_if_missing(challenge_id=..., user_id=..., flag_content="flag{...}")
returns the id of the user's personal flag for the challenge, creating it
with flag_content if the user has none yet.
Development
make venv # uv, Python 3.11 like CTFd's Docker image; CTFD_PATH=../CTFd
make lint
make test # runs inside CTFd's own test app
Languages
Python
80.4%
HTML
16%
Makefile
3.6%