Writeup · Cyberweek Africa 2026 - National CTF (Finals)

Heritage Trail 3: Crossroads of the Coast

osinteasy-mediumsolvedFlag: FLAG{REDACTED}

Overview

This stage combines two skills. Four clues about Kenyan coastal heritage sites each give one letter. The four letters spell a word that is not the flag. It is a direction, and it names the edge of the supplied image where the hidden data sits.

The image hint says the signal is very narrow and that bits travel from top to bottom, eight at a time. That points to a single pixel column read top to bottom, with each group of 8 bits forming one ASCII byte.

Recon

The challenge image is a 1536 x 1024 RGB PNG showing an illustrated map of the Kenyan coast (Lamu, Manda Island, Malindi, Kilifi, Mombasa, Shimoni). The map itself carries no visible clue. Everything relevant is in the pixel data.

file coastal_signal_flag_encoded.png
coastal_signal_flag_encoded.png: PNG image data, 1536 x 1024, 8-bit/color RGB, non-interlaced

The clues name the National Museums of Kenya as the source for all four stops.

Exploitation

Stop 1: The town in the forest

Clue: A Swahili town about 16 km south of Malindi, with 12th century origins, rebuilt with new walls in the 15th and 16th centuries.

Research path:

  1. Search for 16 km south of Malindi Swahili town rebuilt new walls.
  2. The description matches Gede (Gedi) Ruins, in the Arabuko-Sokoke forest. Multiple pages repeat the wording: origin in the 12th century, rebuilt with new town walls in the 15th and 16th centuries.
  3. The 2nd letter of GEDE or GEDI is E under either spelling.
Item Result
Site Gede (Gedi) Ruins
Requested character 2nd
Extracted letter E

Stop 2: The museum of the archipelago

Clue: The flagship museum of a group of thematic museums in a UNESCO World Heritage old town in the northern coastal archipelago. Collections include clothing, jewellery, manuscripts, maritime objects and archaeological finds. Take the 2nd letter of the town’s name.

Research path:

  1. The group of thematic museums is in Lamu Old Town, and its flagship is the Lamu Museum.
  2. The town is Lamu, and the 2nd letter of LAMU is A.
Item Result
Museum Lamu Museum
Town Lamu
Requested character 2nd
Extracted letter A

Stop 3: A fort of its own

Clue: A Swahili settlement in the Lamu Archipelago whose history records resistance to Omani domination, and which, unlike Mombasa and Lamu, built a fort of its own. Take the 1st letter of the town’s name.

Research path:

  1. The NMK Lamu brochure covers Siyu Fort on Pate Island. It says that, unlike Fort Jesus in Mombasa and the fort in Lamu, which were built by foreigners, the Siyu people built their own.
  2. The same text says the fort was built to safeguard Siyu residents from Omani domination.
  3. The town is Siyu, and the 1st letter is S.
Item Result
Town Siyu (Siyu Fort, Pate Island)
Requested character 1st
Extracted letter S

Stop 4: Across the water

Clue: A thriving 15th–16th century Swahili trading town on Manda Island, about a 30-minute boat ride from Lamu Town, with a distinctive Friday Mosque.

Research path:

  1. The NMK page for Takwa gives the south-eastern corner of Manda Island, a 30-minute boat ride from Lamu Town, and a 15th and 16th century trading town.
  2. The Friday Mosque with a large pillar atop the qibla wall is a notable feature of the site.
  3. The 1st letter of TAKWA is T.
Item Result
Site Takwa Ruins
Requested character 1st
Extracted letter T

Assembling the direction

Stop Site Letter
1 Gede Ruins E
2 Lamu A
3 Siyu S
4 Takwa T

The four letters give EAST. The challenge says not to submit this word as the flag. It names the edge of the image to inspect: the right-hand edge.

Extracting the signal

The hint says bits travel top to bottom, eight at a time. For the east edge, that means the rightmost pixel column (x = 1535) read from the first row to the last. The least significant bit of each channel is the usual place to hide data, so I tested each channel separately.

from PIL import Image
import numpy as np

a = np.array(Image.open("coastal_signal_flag_encoded.png"))
H, W, _ = a.shape

def decode(bits):
    out = []
    for i in range(0, len(bits) - 7, 8):
        v = 0
        for b in bits[i:i + 8]:
            v = (v << 1) | int(b)
        out.append(v)
    return bytes(out)

def printable(b):
    return "".join(chr(c) if 32 <= c < 127 else "." for c in b)

for col in (W - 1, W - 2, W - 3):
    for ch, name in enumerate("RGB"):
        bits = a[:, col, ch] & 1          # LSB of one channel, top to bottom
        print(col, name, printable(decode(bits))[:64])

Results:

  • Column x = 1535, red channel LSBs decode to readable ASCII. The first 13 bytes are the flag, in the form `FLAG{REDACTED}.
  • After the flag, the bytes turn into noise. That is just the least significant bits of the underlying artwork, so the message is short and not padded.
  • The green and blue channels at the same column, the interleaved RGB bits, and the two neighbouring columns (x = 1534, x = 1533) all decode to unreadable bytes.

Flag

The red-channel LSBs of the rightmost pixel column decode, top to bottom and 8 bits per byte, to the flag:

FLAG{REDACTED}

Lessons / Takeaways

  • A clue answer can be a pointer rather than the flag. The four letters here selected an edge of the image. Following the instruction not to submit the word saved a wasted attempt.
  • Turn the hint into an extraction plan. “Bits travel from top to bottom, eight at a time” means one column, row order, 8 bits per byte, MSB first.
  • Test each channel on its own. The message was only in the red channel, and interleaving all three channels would have scrambled it.
  • A short readable prefix confirms the guess. Seeing FLAG{ immediately told me the bit order and channel were right, and the noise after the closing brace is expected.
  • Cross-check spelling variants. Gede and Gedi share the same 2nd letter, so the answer does not depend on which spelling the official page uses.
  • Say what was not re-verified. Stop 2 relied on earlier research, so the writeup records that rather than claiming a fresh check.

Techniques

  • Open-Source Intelligence (OSINT)
  • Public-Source Research
  • LSB Steganography
  • Clue-Based Enumeration