In digital forensics, you rarely know where to look or what a trace will look like. In Biometric Systems and Information Protection, I use a Capture the Flag competition to let students try both roles. This year, three teams from secondary schools in Plzeň joined the university students.
Tomáš Lebeda, a doctoral student in the Department of Cybernetics at the Faculty of Applied Sciences, University of West Bohemia, ran the technical side of the competition. He designed the first version as an exercise in using the Linux command line. This year he prepared virtual machines for the secondary-school teams, set up access and helped teams with technical issues during the game. I invited the secondary schools in Plzeň to take part.
Five flags per team
Each team started as the attacker. It received five short text strings, known in the game as flags, and hid them on its Linux virtual machine. In the second phase the teams switched to the defender’s role and looked for traces on the other teams’ machines, as they would in a forensic investigation. At the final session, the authors showed how another team could retrieve their flags with the same permissions available during the game.
Some of the university teams are also taking Internet Technologies (KKY/ITE). They practise Linux administration, monitoring and backups on the same virtual machine that runs the distributed application they build in the project. For a look at how the course starts, my article on preparing teaching materials includes the study summary and slides from the opening lecture.
How do you hide a flag?
A sample flag might look like blue_team_flag_A7q2M9p4Zd. The first part identifies the team and the last ten characters are unique to each flag. Under the rules, the whole string had to remain on the machine and be retrievable with standard tools available there. It could be in the contents of a file, in a directory name or in an extended file attribute.
We can try the last option with a file of our own in the project directory. A Linux filesystem can store named attributes alongside a file’s contents. On Linux with the tools from the attr package, I can store a flag using setfattr and display it with getfattr.
# Create a notes file in the project directory.
mkdir -p ctf-demo
printf '%s\n' 'Project notes' > ctf-demo/notes.txt
# Store the flag in an extended attribute.
setfattr -n user.ctf -v 'blue_team_flag_A7q2M9p4Zd' ctf-demo/notes.txt
# cat prints the file contents and getfattr prints its extended attributes.
cat ctf-demo/notes.txt
getfattr -d ctf-demo/notes.txtcat prints only Project notes. The getfattr output includes user.ctf="blue_team_flag_A7q2M9p4Zd". Once you know about extended attributes, a single command will do. The interesting part of the exercise is deciding where to look in the first place.
Agentic AI on both sides
The teams made extensive use of agentic AI during the game. As attackers, they used it to devise and prepare places to hide their flags. As defenders, they used it while looking for traces on the competition machines. At the final session, I was interested in how the students explained their approach and what the other teams could learn from it.
Forty flags each, two different scores
The teams were named after colours. The final three columns belong to the secondary-school teams. Brown and Gray represented VOŠ and SPŠE Plzeň and Pink represented INFIS, the Secondary School of Informatics and Financial Services in Plzeň. Blue, Yellow, Red, Green, Magenta and Cyan represented the Faculty of Applied Sciences.
Both Gray and Brown found all 40 flags from the other teams. Their opponents earned 11 points from Gray’s flags and 18 from Brown’s. Gray finished first with 29 points, Brown second with 22, and Blue led the university teams with 19. A flag found by all eight opponents costs its owner eight points.
At the final session, we recognised Blue as the top university team and Gray as the top secondary-school team. Both teams received small gifts from Aimtec and SIT Port.
That struck me as a little unfair to Brown, who finished second overall and went home without a prize. Our main reason for running the game was to give students practical experience of hiding and finding traces on a Linux machine and explaining their approach to others.
What the teams showed at the final session
One team came up with fourteen ideas for its five flags. Students considered using older revisions of a PDF, and someone on another team suggested spelling out a flag in an MP3. Meanwhile, one team forgot to delete flags.txt from the home directory of the account their opponents used to sign in. The team channels on Discord saw 583 messages, including 91 on a single day, 10 November.
The competition also put the machines’ operation to the test. When one virtual machine disappeared, the team restored its flags from a backup and the other teams regained access. On another occasion, a team noticed that its opponents could only see part of a clue, fixed it and told everyone. As a teacher, I liked seeing the immediate consequences of keeping backups and applying the rules fairly. Every other team feels it when a machine is down or part of a clue is missing.
At the final session on 30 November, I enjoyed watching the teams ask each other about their approaches. Brown built a challenge around a fictional chip, and the presentation touched on finding documentation and on a Linux driver. What I liked most was how their flags told a single story. Players had to find them in a particular order, and each discovery moved the story along.
I have a lot of respect for what Brown put together. I’m sure they’ll find their feet in cybersecurity.
I thank Tomáš for running the technical side and supporting the teams. I also thank Kateřina Šperlová, project manager at SIT Port, and Jiří Dobrý, software development manager at Aimtec, for providing the prizes. We plan to invite more schools in the 2027 winter semester. After this year’s presentations, I would also like to give an award for the most original hiding place.
Links
- Biometric Systems and Information Protection: Syllabus for the course in which Capture the Flag forms part of the semester assignment.
- Internet Technologies: Syllabus for the course in which teams build distributed applications.