Skip to main content

CTF sessions

A CTF is a pool born from a campaign, with a game layer on top: flags, answers graded automatically, a score, a leaderboard, a live dashboard and an answer key that shows the logs proving each answer. It has two faces:

  • /ctf, in the application, for the facilitator: deploy a session, start it, launch the attack, follow the score and correct;
  • web-score, a separate public site (port 3007), for the players and for the screen in the room: each participant's answer form, the leaderboard, the dashboard.

Players never get an account on the application. Each participant — a team or a single player — receives a link to its own page, and that link is all it needs.

Deploying a session​

/ctf lists the “Deployed CTFs” — name, campaign, communities with how many are running, participants — and, below, the “Deploy a CTF” form.

A campaign is the recipe of a session, authored under Catalog → CTF campaigns: one ships by default, Operation Nostromo, and you can edit it or add your own. It forces a company profile and a population (demo-weyland-yutani), chooses twelve technologies, the threat scenario that will be launched, the background noise that runs all day on a few compromised hosts, and the asset connectors. The “What gets deployed” card says what the campaign will build; when a piece is missing from the database — a scenario or a profile not seeded yet — it is named in red and “Deploy the CTF” stays disabled.

The form then asks for:

FieldWhat it decides
Session nameThe name of the pool, and the prefix of its communities
Time zoneWhere the simulated population lives — “Inherited from the population” by default
Number of communitiesThe communities that receive the logs — one Sekoia space and one API key each, 1 to 30
Number of participantsAt least one per community, up to 99 — empty: one per community
Sekoia regionApplied to every community; adjustable per community afterwards in the pool grid
Sekoia API keysOne per line, one per community, in order: the first key goes to the first community

The number of keys must match the number of communities, and there must be at least as many participants as communities, or nothing is deployed. Keys are write-only: the screen never shows them again.

Deploying builds the template <name> — Modèle with the forced profile and the archetype mapping, then the pool and its communities <name> — Communauté 01, Communauté 02…, each with its key. Creating the intakes and the asset connectors in each community's Sekoia space then starts in the background, as from the pool page.

Participants and communities​

A community is what receives the logs: a Sekoia space, an API key, intakes, a volume — which is why there are 30 at most. A participant is what plays: a player link, an identity, answers and a score. Several participants can read the logs of the same community — they then investigate the same Sekoia space, and each answers and ranks on its own.

The participants are dealt in turn across the communities, in the order they were created: with 2 communities and 5 participants, participants 01, 03 and 05 read the first, 02 and 04 the second. With a single community, everyone reads it. A participant is never removed, and one can be added afterwards. A community added later from the pool page receives one participant of its own.

Running it​

/ctf/<poolId> is the control panel, card after card:

  1. Deployment — the number of communities and of participants, the link “Scoring & answer key →” and “Open the full pool”: the pool is an ordinary pool, and everything its page allows remains possible.
  2. Session dashboard — the public address of the dashboard, the screen to project, with “Copy” and “Open the dashboard ↗”, which opens it in a new tab. Without WEB_SCORE_PUBLIC_URL, the bare path and a warning, without the button.
  3. User / server mapping — how many users, servers and sites play an archetype.
  4. Provisioning — intakes and asset connectors, done / total and failures per batch; “Re-run provisioning” only targets what is missing.
  5. “Start the logs (noise included)” — the per-minute generation on every community: the legitimate working day and the background implant beacon. It stays disabled until every community has its intake keys.
  6. “Launch the scenario” — the attack chain, on every community at once, with one seed and one clock: every community receives the same attack at the same minute. It stays disabled until the logs are running — the scenario rides on the activity already in progress.
  7. Timer — “Start the timer” opens the participants' answers and starts the timer that breaks ties. It stays disabled until the scenario has been launched — there is nothing to answer before the key is frozen — and starting it is final: the card then only shows “Started:” and the instant. Start it when the participants begin, not before.
  8. Participants — “Add a participant” gives a latecomer a link, in the Community you pick: the one with the fewest participants is preselected. The new link shows right away, with “Copy”; “All player links” leads to the answer key page. A participant is never removed.
  9. Communities — state, Sekoia key, intakes ready, participants.
  10. “Reset the CTF” — deletes the pool, its communities, its participants and their player links. It cannot be undone. Ticking “Also delete in Sekoia what the teams reference” first deletes, in each team's Sekoia space, its intakes, asset connectors and entity — the deletion of a pool, in the background, which the card follows. The session is deleted at its end, and only if everything was undone: a kept key, a failure or a configuration left in Sekoia keeps the session, whose pool screen lists what remains — reset again, or without the box. The box is disabled while the logs run; with nothing referenced in Sekoia, the session goes at once. The list of CTFs offers the same box.

When a community's connectors report a blockage, a Blocked deliveries card appears above the panel: one Relaunch button per blocked community, and Relaunch the blocked teams (N) for all of them — the rules are those of the pool. The CTF roles may use it: relaunching is operating the session, like starting its logs.

The application's dashboard (/) sums the sessions up, above the health of the services:

  • “CTF leaderboards” — the top 5 of each campaign played, all sessions together, with each participant's session, time and score. It is the campaign leaderboard of web-score, computed once for both: same order, same names — Ellen R., never the full last name. “Public leaderboard ↗” opens it, when WEB_SCORE_PUBLIC_URL is set;
  • “Running CTFs” — the sessions whose logs are running, that is with at least one community enabled: a deployed CTF that has not started its logs is not listed. Each row gives its phase — “Logs running”, “Scenario launched”, “Timer started” — and “Manage”, which leads to this control panel.

Both are a snapshot: reload the page to refresh them.

The answer key​

/ctf/<poolId>/correction — “Scoring & answer key” — shows the leaderboard, the player links, the answer key and the grading grid. It refreshes live, at every answer a participant sends.

Frozen at launch​

There is no answer key before the first launch: “The scenario has not been launched yet”. At launch, the expected answers are resolved on the population and on what the launch has just played, then frozen. Some answers are drawn by the launch itself — the screen marks them “value of the day” — and they differ from one session to the next: the key of a past session is no use for the next one.

Every real launch freezes the key again, including a launch made from a community's Threats tab; a preview never does. Answers already sent are not graded again against the new key: relaunching in the middle of a session leaves the score as it was — and leaves the timer running from its start.

The key is frozen in both languages: every question, field label, option and line of evidence exists in English and in French, and each screen shows its own language — the facilitator's here, each participant's on web-score. What comes from the population — an account, a city, a workstation — reads the same in both. A key frozen before the CTF was bilingual keeps its French texts in both languages, and the screen says so once (“This answer key was frozen before the CTF was bilingual”); relaunching the scenario freezes it again in English and French.

Sixteen flags and a bonus​

Operation Nostromo carries sixteen flags and a bonus, 255 points in all — and, like any campaign, its flags are authored under Configuration. A flag is made of typed fields, so that grading needs nobody:

Field kindWhat the player does
ChoicePicks one option — radio buttons, or a list beyond eight options
CheckboxesTicks exactly the number of boxes the flag asks for, in no order
TextTypes a value in an announced format — a domain or an IPv4, or an IPv4 alone
NumberTypes an integer within bounds; some accept a tolerance

A list wherever the answer is a category, a formatted text where it is a value to copy from the logs, a number for a duration. Options drawn from the population are frozen with the key, and each page sorts them by their label in its own language, so that their position says nothing. A flag made of several fields is correct only when all of them are.

The questions themselves are not reproduced here: this documentation is public, and players read it too. The facilitator finds them, with their answers, in the answer key.

Grading, and when to step in​

A participant's answer is graded the moment it is sent. When the launch did not produce the value a flag needs, the key says “Value not found in the launch: this flag cannot be graded automatically”, and the answer waits as Pending until the facilitator decides.

A field that asks for the domain of the command server is answered only if the campaign's scenario guarantees one: its expected IOC type must be Domain name or URL — Operation Nostromo ships with Domain name. Otherwise the campaign is not ready, and its deployment names what is missing. A key that still targets a bare address leaves that field Pending rather than expecting an address in a field that asks for a name.

The “Grading grid” shows each participant's last answer per flag and its status — Correct, Incorrect, Pending, Locked (three wrong answers) —, the attempt it came from (attempt 2/3), the points the flag earns, and the earlier attempts, crossed out. Three marks override the automatic grade: ✓ and ✗ set it, ↺ gives the hand back to the automatic grade. A manual mark always wins, and it closes the flag: the participant cannot answer it any more. ↺ reopens it when the last answer was wrong and an attempt remains. The public pages show a mark at the next answer any participant sends, or when they are reloaded — not immediately.

A manual ✓ validates the participant's last attempt: it earns that attempt's share of the points — 100, 50 or 25% —, a flag never answered earning all of them. It keeps the time of the participant's answer: grading a pending answer by hand, later, costs the participant nothing at the tie-break. Only a mark on a flag the participant never answered counts from the moment it is set.

The evidence logs​

Under each flag, “Evidence logs” shows the messages of the launch in which the answer can be read, every technology included, with the answer values highlighted. They are captured when the key is frozen, never replayed afterwards: replayed, they could contradict the answer they illustrate.

Only logs that were actually delivered are kept — a valid render, from a technology that has an intake key in at least one community. A log nobody received would send the facilitator looking into an empty intake. Twelve logs at most per flag, and the screen says so (“first 12 of 30”). Two flags have no logs: the final synthesis, which every other piece of evidence illustrates, and the bonus, whose answer is not played by the launch.

“Player links” gives one link per participant, numbered, under the community whose logs it reads, with a “Copy” button. The link is built from WEB_SCORE_PUBLIC_URL, which the deployed environments derive from the web-score hostname. Under pnpm dev the variable is not set — it is not part of .env.example — and the screen shows the bare path, with a warning; add WEB_SCORE_PUBLIC_URL=http://localhost:3007 to your .env to get full links.

Once a participant has named itself on its page, every list of this screen — the leaderboard, the player links, the grading grid and the printable key — shows that name in full, company included, above its number and its community (Participant 03 · <name> — Communauté 01); a participant that has not named itself yet shows as Participant 03, above its community and “Not named yet”. The facilitator sees the name, but cannot change it.

“Printable answer key (PDF)” opens the same answer key on a page meant for paper, evidence logs unfolded: your browser's Print → Save as PDF makes the facilitator's copy.

The answer key is visible to every account

Every action of the CTF screens needs an administrator, but opening them does not: a viewer account sees the answer key, the evidence and the player links. Never give a player an account on the application — the player link is all they need.

The players' side: web-score​

web-score is a separate site, without sign-in. Its pages speak English by default, and French on request: an EN / FR switch at the top of every page — the participant's, the projected leaderboard, the portal — keeps the choice in a lang cookie, as the application does. The browser's language is ignored: a participant arrives in English until they click FR. Each screen chooses for itself — the room's projector can stay in French while a participant reads in English. The questions, labels and options come from the answer key, frozen in both languages; the messages the page composes itself — a refusal, an answer read back — follow the page's language.

AddressWhat is there
/t/<token>The participant's page: its flags, its score, its answer form
/leaderboard/<poolId>The session's leaderboard, live
/dashboard/<poolId>The cumulative score of each participant over time, live — the screen to project
/campaign/<campaignSlug>Every participant of every session of a campaign, ranked together — reload to refresh it
/The portal: the campaigns played, each with a link to its leaderboard
/healthThe probe Docker uses

The application hands out the player links, and the CTF control panel gives the dashboard's address. The leaderboard is opened with the pool identifier, which is the end of the /ctf/<poolId> address. The portal lists a campaign once it has at least one session, with how many sessions and participants it brought together — never the sessions themselves, nor the campaign's description, which would give the scenario away.

Naming the participant​

Before its first answer, a participant says who it is, in the “Who are you?” card at the top of its page. Two ways, chosen with “A team” / “A player”:

ModeFields
A teamTeam name, Company
A playerLast name, First name, Company

Every field is required, sixty characters at most. Until the participant has named itself, its flags are listed without any form: “Fill in your identity above to be able to answer.” — and the server refuses an answer sent anyway. The name can be corrected (“Edit (possible until your first answer)”) until the first answer is sent; from then on it is frozen (“Locked since your first answer.”). Only the participant's own answers freeze it: another participant reading the same community changes nothing. A participant that had already answered before this card existed can name itself once.

Names on the public pages​

The leaderboard, the dashboard and the campaign leaderboard name a team by its team name, and a player by first name and the initial of the last name — Ellen R. —, with the company in its own column. The full last name never leaves the server for these pages; only the participant's own page and the facilitator's screens show it. A participant that has not named itself appears as Participant 03 — never under the name of its community, which others share.

The participant's page​

Before the launch, the page lists the flags and their points without any field: “Answers will open when the scenario is launched.” Once the key is frozen, it still waits for the timer: “Answers will open when the facilitator starts the timer” — and the server refuses an answer sent anyway. When the facilitator starts it, an open page opens by itself. Once the timer has started, and once the participant has named itself, each flag gets its form. The header always names the community whose logs to search (“Logs: …”).

  • Three attempts per flag. A correct answer earns 100% of the points on the first attempt, 50% on the second and 25% on the third, rounded down — a 15-point flag earns 15, 7 or 3. Three wrong answers lock the flag. A correct answer, an answer the facilitator has to decide, or a manual mark close it. The page lists the attempts sent, crosses out those that missed, and the form says what the next one is worth (“2nd attempt of 3: a correct answer earns 50% of the points (7 pts).”). Of two members sending the same flag at the same time, one attempt is kept.
  • A malformed answer costs nothing, nor does a repeated one. The browser refuses a malformed answer first — required field, format, bounds —, the server checks again, and a refused answer comes back with what was typed and a message per field, without using up an attempt. An answer identical to an attempt already sent — case and checkbox order aside — is refused the same way (“This answer was already sent: nothing was counted.”).
  • Five badges: Validated · 7/15 pts (2nd attempt), Wrong — 2 attempts left, Locked, Waiting for the facilitator (answered, the facilitator has to decide), No answer. The score in the header counts each validated flag at its attempt's share.
  • Thirty answers per ten seconds per link, beyond which the page asks to wait a few seconds.

Live​

Each answer sent, each name saved, and the timer start publish a signal on Redis; the leaderboard, the dashboard and the participant pages are listening and reload their figures.

Participants with the same score are ranked by time: the one that reached its last points first since the timer start ranks higher. The Time column shows that time (H:MM:SS), — for a participant without points. On the campaign leaderboard, each session is measured from its own start, so sessions played at different hours compare on speed, not on the time of day. Participants still level fall back to their public name. The order is the same on the screen in the room and on the facilitator's screen (Time column) — and in both languages: ties are never broken by the language of whoever is watching.

The dashboard's time axis starts at the timer start, and draws the first eight participants; the others are in the table under the chart.

Deploying web-score​

web-score has its own image (apps/web-score/Dockerfile) and is a service of the four composes. In dev, preprod and prod, Traefik publishes it on its own hostname, given by the GitLab variable <ENV>_WEB_SCORE_HOST: deploy.sh requires it and stops without it. The application derives the player links from it (WEB_SCORE_PUBLIC_URL = https://<WEB_SCORE_HOST>). Beyond its port, web-score reads DATABASE_URL, REDIS_URL and REDIS_QUEUE_PREFIX, nothing else.

It is the only frontend that reads and writes PostgreSQL directly, without going through api-config, and what it may do is bounded by a test (tests/web-score-guard.spec.ts): it never writes a community, never creates or deletes a participant, never reads a player token back, grades with the expected answers on the server without ever sending them to the browser, never reads the evidence logs, and never names a player's last name on its public pages. What that means for security is in Security and accounts.

It runs as a single replica: the submission limit and the Redis connections live in memory.

The facilitator documents​

ctf-weyland-yutani/ holds the kickoff deck, the facilitator guide, the trainee guide and the threat scenario of Operation Nostromo, in French and English. They were written before the /ctf screen: they describe a pool built by hand and scoring on paper. Where they differ from the screen, the screen is right.

What does not exist yet​

  • Re-grading after a relaunch: the key is frozen again, the answers already sent keep their grade.
  • Restarting or stopping the timer: its start is final, and it never stops — answers stay open until the CTF is reset.
  • A ticking clock on the public pages: they show each participant's time, not the time elapsed.
  • An extra attempt: ↺ reopens a flag only while an attempt remains; a locked flag can only be marked by hand.
  • A manual mark pushed live to the public pages: it shows at the next answer of any participant, or on reload.
  • A live campaign ranking: /campaign/<campaignSlug> refreshes on reload only.
  • Removing a participant: one can be added, never removed — a participant that answered keeps its points.
  • Changing a participant's name from the application: the facilitator sees it, only the player link can change it — and only until its first answer.
  • Unique names: two participants may choose the same name; the number, on the facilitator's screen, tells them apart.
  • More than one replica of web-score.
  • A language for the whole session: each screen picks its own with the EN / FR switch; the facilitator cannot impose one, nor hand out a player link that opens in French.