Skip to main content
cli-gamesBlog

Proving You Finished Without Showing the Answers

When you finish a CTF training scenario on CLI-Games, the server replays your commands twice and then signs a practice record that shows no answers.

coauthored by Claude Fable 5.2 and
ctfsecurityeducationcryptographyverification

In a browser-based security exercise, the browser inherently holds all the answers. That means you could cheat it. When you're offering a product to a bunch of security-minded folks, expect that. Normally, we wouldn't care. If you want to cheat, cheat. You're only cheating yourself. But we have ambitions to make this legit, which is why server verification is necessary. Read on and let Claude explain how it works.

Proving You Finished Without Showing the Answers

There are two cheap ways to prove someone finished a security exercise, and both are bad. A badge that says "completed" is easy to fake, because the browser is the one saying it. A proof that lists the commands they ran can be checked, but it hands the answers to the next person.

The CTF training on CLI-Games takes a third route, and it is the piece of this site we would most like other people to copy. When you finish a scenario, the server runs your work again by itself and signs a practice record of what it saw.

The CTF page on cli-games.com: open CTF practice and rotating live Range challenges, with a note for teachers below

What a practice record says

A practice record states one fact: the CLI-Games server replayed your commands against a pinned version of the scenario, twice, each time from a clean start, and reached every objective both times.

That is all it says, and the record page is blunt about it. In its own words, a record does not show identity beyond account control, human effort, independent work, mastery, course credit, or certification. It tells you that an account produced a run that solves the scenario. It can't tell you who was at the keyboard or how much help they had.

So a practice record is not a certification. The roadmap and assurance page lists the stages that come before a certificate, and it says plainly that certificates have not shipped. We would rather sign a small claim that is true than a large one that is not.

The roadmap and assurance page. Its Current truth box reads: the training library is live; course mode, completion certificates, skills credentials, independent recognition, and accreditation are not

How the replay works

When you complete an eligible scenario, the terminal sends the server the commands you ran, along with a digest that identifies the exact version of the scenario you played.

The server doesn't take the browser's word that you finished. It also doesn't trust your commands much, since they are input from the internet. So the check runs in a separate process with a memory cap and eight seconds to finish. That process can't write to disk and inherits none of the server's environment.

Inside it, the server builds the scenario from its definition, runs your commands in order and checks every objective. Then it throws all of that state away, builds the scenario again and runs the same commands a second time.

The second run is the interesting part. The two runs have to agree exactly, which means a scenario can only issue records if it behaves the same way every time it is replayed. If the runs disagree, or the run doesn't reach every objective, or the scenario has changed since you played it, the server issues no record and tells you which of those happened.

Records are issued for 19 scenarios across four training modules: Orientation, Linux Basics, Files & Permissions, and System Enumeration. The list is fixed, and a scenario outside it issues no record.

Signed, and private until you publish

The server signs each record with an Ed25519 key. The public keys are published, so anyone can check a record's signature without trusting the page that displays it.

A record holds the account name, the scenario's name and digest, the number of objectives reached, the number of commands replayed, and digests of the transcript and of the replay. It holds no commands and no answers. Someone reading your record learns that you finished and learns nothing about how, which was the whole problem we started with.

Every record starts private, and only your account can open it. You manage it from the terminal:

  • record - show the record for the scenario you just finished
  • records - list every record on your account
  • record publish - make the record's permanent link work for anyone
  • record feature - also list it on your public profile
  • record hide - take it off your profile again
  • record withdraw - mark a published record as withdrawn

Publishing is a step you choose each time, and a published record stays unlisted until you feature it. Running a scenario again in a different way adds a new record beside the first. No record is ever overwritten.

Module attestations

When your account has a practice record for every required scenario in a module, the server issues a module attestation without being asked. It is a second signed document that lists the practice records it rests on: for each one, the record's id, the scenario, the digests and the date. It is private until you publish it, and it is not a certification either.

Guests get records too

You don't need an account to start. That was Frank's call in October: a guest's records are saved to the guest and come along when the guest registers. A guest's run is replayed and signed the same way, and the record is saved to the guest's callsign.

To keep it, type auth and register. Here is a detail we are fond of. A record names its owner inside the signed part, and a guest's callsign goes back into circulation once the guest registers. A record published later would then name whoever picked that callsign up. So at the moment you register, the server signs your records again under the username you chose.

Two limits apply. A guest can't publish a record. A guest left unused for 48 hours is retired and its records are lost with it, so register before you walk away from work you want to keep.

For teachers

All of this is what makes a group module goal worth setting. A goal such as goal set cs101 module linux-basics counts the members who are past the module's finish line, which is its checkpoint exam, or every scenario when the module has no exam. Only practice records count toward it. A "level complete" message from a student's browser doesn't move the number, and a run the server replayed does.

Guests count toward the goal like everyone else, so a class can start from one link and register before the bell. Bring Your Class walks through setting a group up, and the teachers page has the rest.

To earn a first record, open the CTF training and finish a scenario in Orientation.

There you have it. How server verification works under the hood, why it's necessary, plus a bonus for teachers. The need for that arose when we realized a professor in Finland assigned our modules to his class. Our aim is to someday make completion of the CLI-Games CTF mean something real. That's currently blocked on getting a human with a real cert to audit the program and sign off on it. In the short-term, we still intend to carve out the tracks and let you wear the completions on your profile. That means everywhere you are looked up, your username will carry one of the CLIP (basic), CLIA (defensive), or CLIO (offensive) designators.

If you've already completed some modules, let me know how you liked them or what you'd change. Was it too hard, too easy, did you find help when you wanted it without annoying popups? Was it intuitive to save your scripts to your home directory and apply them elsewhere? message frank or email [email protected].