$ cat writeup.md…
$ cat writeup.md…
Hack.lu2026
Task: A bootable raw GPT appliance accepts a candidate encoded into kernel command-line byte parameters, with its checker hidden in systemd services. Solution: Extract its SquashFS root, model service success and failure branches as Z3 constraints, and independently trace the accepting path.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
We put the flag into the kernel command line and the flag checker ...where???
The archive supplies a raw bootable disk, OVMF firmware files, and run.sh. Find the input accepted by the appliance without assuming the flag is stored as plaintext in the image.
run.sh converts the supplied candidate, not a stored flag, into arguments ctf.byte.0=.. ctf.byte.1=.. and passes them via SMBIOS io.systemd.boot.kernel-cmdline-extra. The GPT EFI partition begins at sector 2048; the root-x86-64 partition begins at sector 75776 and contains SquashFS. The checker is not a single conventional executable: the extracted root has approximately 7,910 UUID-named services in usr/lib/systemd/system/ plus ten service templates.
Each graph node has OnSuccess and OnFailure edges; some have Requisite=<template>@<byte-index>.service. The templates use ConditionKernelCommandLine=ctf.byte.%i=<two-digit hex> for sets of byte values. Eight sets test individual bits, one permits every possible byte, and another tests whether ctf.byte.%i exists. Terminal units print CTF_RESULT=ACCEPT or CTF_RESULT=REJECT. Consequently, the graph implements an obfuscated byte-by-byte checker. The existence test at index 88 enforces the absence of a 89th byte.
Extract the root partition from the organizer's raw image, then unpack the filesystem:
dd if=public/flag_check_appliance_v2_FINAL.raw of=root.squashfs bs=512 skip=75776 unsquashfs -d rootfs root.squashfs
Represent each input byte as an 8-bit Z3 variable and each UUID service as a Boolean meaning "this node eventually accepts." A normal /usr/bin/true service takes its success edge; a node with a Requisite follows its success or failure edge according to the template predicate. Assert that the entry service accepts, constrain the public flag{...} format and length, and solve. Finally, evaluate the actual graph with the resulting bytes rather than trusting only the symbolic model. Run this script from the extraction directory after installing z3-solver:
#!/usr/bin/env python3 from pathlib import Path import re import z3 ...
$ grep --similar