Writeup · Cyberweek Africa 2026 - National CTF (Finals)

The Lost Signal 3: The Switching Room

reversingunknownsolvedFlag: FLAG{REDACTED}

Event: Cyberweek Africa 2026 - National CTF (Finals) Category: Reverse Engineering Points: 350 Flag: FLAG{REDACTED} **R3:** 8B303FABB0B6` (retain for Chapter 4)

Summary

The Lost Signal — Chapter 3. A fictional coastal telephone-exchange archive (Kenya, 2002 telecoms era) containing a call register, fragmented switching receipts, a trunk inventory, an operator bulletin, and a small offline replay console (exchange_console.py).

The goal: identify the authentic retained call from the evidence, reconstruct its switching route, and replay it on the stateful console so that COMMIT succeeds. A successful commit reconstructs the sealed relay, prints R3, and releases the Chapter 3 flag.

Everything is local and simulated — no network services, no physical equipment. Python 3.9+ stdlib is sufficient.

Solver script: solve.py (at the challenge root). It parses the CSVs, verifies the TX/RX receipt pairs, builds the phase-aware command sequence, drives the console, and extracts the flag/R3.

Evidence

File Purpose
call_records.csv Call register with circuit, service, bearer, origin, destination, campaign and status
exchange_audit.csv TX/RX receipts — unordered, with duplicates and forgeries
trunk_inventory.csv Directed ports, each with one service phase and a bearer class
operator_bulletin.txt Procedure and acceptance rules (CSX/02)
exchange_console.py Stateful simulator; source inspection permitted
sealed_relay.bin Encrypted archive, decrypted on a valid commit

Input carried over from Chapter 2 (Voices Through the Air): R2 = 60AAA70740D0.

call_records.csv — picking the call

The operator bulletin (CSX/02) states the retained call is:

  • type CR-MVT / COAST-RELAY
  • campaign LM-08
  • status RECOVERABLE
  • origin MSA

Only one row matches all four:

circuit origin_service bearer origin_switch destination_switch campaign status
C-481 CR-MVT COAST-RELAY MSA LAM LM-08 RECOVERABLE

The others each fail on exactly one point:

circuit reason rejected
C-482 test relay (TEST-RELAY, BK-TRN calibration exercise)
C-483 closed (CLOSED), originates at NBO
C-489 earlier campaign LM-07 (unverified)

exchange_audit.csv — authenticating the route

A genuine switch transfer is recorded twice: a TX entry at the originating exchange and an RX entry at the receiving exchange. Both must agree on circuit, source, destination, trunk port, service phase, receipt code, and bearer. The audit is unordered and contains forged, incomplete, copied, and test-programme entries.

For C-481, three hops pass the TX/RX cross-check:

Hop TX/RX From To Port Phase Receipt Bearer
1 TX + RX MSA MLD M3 1 4FA9 COAST-RELAY
2 TX + RX MLD KLF K2 3 8D2E COAST-RELAY
3 TX + RX KLF LAM L7 1 1C6B COAST-RELAY

The decoys fail for a concrete reason each:

  • T8 (MSA→VOI): TX receipt 7C4F (EV-06-TX) vs RX receipt 35B8 (EV-07-RX) — receipts differ, so the transfer is forged.
  • M9 (MLD→LAM): a TEST-RELAY port (EV-08), not part of the coast relay.
  • E2 (MLD→NBO): TX entry exists (EV-10-TX) but there is no matching RX entry — incomplete.

Resulting authenticated route: MSA → MLD → KLF → LAM via M3 → K2 → L7.

MSA --M3(phase 1)--> MLD --K2(phase 3)--> KLF --L7(phase 1)--> LAM

The T8/P6 detour through VOI and the M9 shortcut are decoys: T8 fails on mismatched receipts, M9 is a TEST-RELAY bearer, E2 has no RX counterpart.

trunk_inventory.csv — service phases

Confirms each directed port’s single available service phase and bearer:

Port From To Phase Bearer
M3 MSA MLD 1 COAST-RELAY
K2 MLD KLF 3 COAST-RELAY
L7 KLF LAM 1 COAST-RELAY

Replaying the clock phases

The console runs a four-phase virtual clock (0–3). HOLD reserves the current exchange; WAIT <1|2> advances the clock while holding (max 2 phases per hold); TRANSFER <port> is accepted only when the console clock equals the trunk’s service phase, and a successful transfer advances the clock one phase and drops HOLD.

Hop Clock before Action Transfer lands on Clock after
M3 0 HOLD, WAIT 1 phase 1 ✓ 2
K2 2 HOLD, WAIT 1 phase 3 ✓ 0
L7 0 HOLD, WAIT 1 phase 1 ✓ 2

Each transfer pushes the clock on by one phase, which is why every hop after the first needs a one-phase wait.

Console commands

AUTH 60AAA70740D0
DIAL C-481
HOLD
WAIT 1
TRANSFER M3
HOLD
WAIT 1
TRANSFER K2
HOLD
WAIT 1
TRANSFER L7
COMMIT

60AAA70740D0 is R2, recovered from Chapter 2 (Voices Through the Air).

The console accepted the commit with route M3@1>K2@3>L7@1. The recovered relay message reads:

COASTAL_SWITCH_CONFIRMED|NEXT=HANDOVER_TRACE|ARCHIVE=2002

Output:

COMMIT ACCEPTED — recovered archive replay
ROUTE=M3@1>K2@3>L7@1
RELAY=COASTAL_SWITCH_CONFIRMED|NEXT=HANDOVER_TRACE|ARCHIVE=2002
R3=8B303FABB0B6
FLAG{REDACTED}
Keep R3 for Chapter 4.

Vulnerability Analysis

Flag

`FLAG{REDACTED}

R3 = 8B303FABB0B6 — retain for Chapter 4.

Solver script

solve.py at the challenge root reproduces the solve programmatically:

  1. Parses call_records.csv, exchange_audit.csv, and trunk_inventory.csv.
  2. Selects C-481 (CR-MVT / COAST-RELAY, LM-08, RECOVERABLE, origin MSA).
  3. Pairs TX with RX entries that agree on every field, rejecting forged/incomplete entries (T8, M9, E2).
  4. Walks verified hops from MSA to LAM, computing the HOLD/WAIT deltas needed to align the four-phase clock with each trunk’s service phase.
  5. Drives exchange_console.py via stdin (AUTH → DIAL → hops → COMMIT → QUIT) and prints the route, R3, and flag.

Run:

python3 solve.py

Notes

  • The protocol, exchange, switches, call records, receipts, and CR-MVT service are fictional competition material, not a real telephony recording.
  • Source inspection of exchange_console.py is permitted by the challenge rules; the commit is gated by an archive route seal (sha256("LS03|{R2}|{circuit}|{route}")[:20]) and the sealed-relay decryption in sealed_relay.bin, so the route must be genuinely authenticated — random guessing cannot commit.
  • The same R2 and route string seed a SHA-256 counter-mode keystream that XORs sealed_relay.bin into plaintext, and the plaintext must begin with COASTAL_SWITCH_CONFIRMED|. A wrong circuit, route or R2 yields a different keystream, so there is no shortcut around reconstructing the route.
  • R3 is the first 12 hex characters of sha256("LS03|R2|CSX-02-FRAGMENT-17|route|plaintext").
  • The 2002 Kenyan telecommunications context is sourced from the Communications Authority of Kenya; the challenge itself tests technical reconstruction, not date/trivia recall.