CSCTF 2026 · Reverse engineering · 384 pts
Fence Shift.
A geofence's acceptance rule depends on parameters that silently changed mid-mission — working out exactly when each change took effect is the whole challenge.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Reverse engineering |
| Points | 384 |
| Status | Solved during the event |
| Target | firmware + mission.pcapng, offline |
TL;DR. The firmware's geofence checker uses a specific fixed-point scale factor to convert centimeter offsets to the same units as GPS coordinates, and applies a percentage margin to the configured radius. Replaying the mission capture and tracking exactly when each confirmed parameter update took effect (not when it was merely requested) gives two separate geofence states — provisioned and active — and which of 22 reposition commands each one would have accepted.
Challenge
Determine which of 22 ground-originated reposition commands a drone's active and provisioned geofences would each have accepted.
Solution
Reversing the firmware's fence-check unit (fcu) finds it reads a fixed 28-byte little-endian record: a center latitude/longitude (as 1e-7-degree integers), a radius and max-altitude in centimeters, east/north offsets in centimeters, a margin percentage (capped at 100), and a tag. It accepts a position when the squared distance from a shifted center is within an effective radius, where the shift converts the centimeter offsets to degrees using a specific scale constant found in the binary (8983, i.e. roughly 0.8983 — the real centimeters-to-1e-7-degrees conversion at this location's latitude, not the more commonly seen 9015), and the effective radius is (100 + margin) * radius / 100, converted to degree units with the same scale factor.
Parsing the mission capture (MAVLink v2) gives an initial fixed geofence center from the first GLOBAL_POSITION_INT message, and an initial provisioned fence from the first PARAM_VALUE burst. Over the capture, several ground-originated PARAM_SET requests change the margin, radius, and offsets — but each change only takes effect at the aircraft's own confirming PARAM_VALUE response, not at the moment the ground station requested it, since the real fence enforced on-board only updates after acknowledgment. Tracking which confirmed parameter set was active immediately before each of the 22 ground-originated reposition requests gives two separate bitmasks — one for the fence as provisioned from the start, one for the fence as it was actually active at each request's moment — recording which requests each would have accepted.
As a strong internal check: the active-fence center shifted by the confirmed offsets lands exactly on the coordinates of one of the reposition requests, and a separate request's distance from the shifted center comes out to exactly the effective radius — not approximately, but exactly, which is the kind of coincidence that only happens when the model (including the subtle 8983 scale factor, corrected from an initial, wrong guess of 9015) is exactly right.
Flag
CSCTF{active_2bbb27_provisioned_3aa227}What I took from it
- When a system's live configuration can change mid-session, the acceptance rule it was actually enforcing at a given moment is whatever was last *confirmed*, not whatever was most recently *requested* — conflating the two gives a plausible but wrong answer.