Writeup · Cyberweek Africa 2026 - National CTF (Finals)

Kivuli 9: GitBlame

mischardsolvedFlag: FLAG{REDACTED}

Overview

A developer committed secrets, panicked, and rewrote history. The repository looks clean — three ordinary release commits on master (v1.0, v1.1, v1.2), nothing out of place. The flag is split into two halves, each hidden by a different sleight of hand, and the key to reassemble it is somewhere in the repository itself. One value recovered (the kernel magic count 19269) is kept separate because ModuleZero depends on it.

Recon

Surface history

git log --all --oneline
2074fbf (HEAD -> master) release: v1.2
e99ad65 release: v1.1
18ad49b release: v1.0

Each release commit only bumps the version in README.md. Nothing secret is reachable from any ref.

Dangling objects

git fsck --unreachable --no-reflogs
unreachable commit ...
unreachable blob 2ad684eb999fa7ac064db2c013d5e056d4f9a66a
...

A blob is left dangling — orphaned by the history rewrite. Git never truly forgets what it once tracked.

git cat-file -p 2ad684eb999fa7ac064db2c013d5e056d4f9a66a
CLASSIFIED
FLAG{cwa2026_finals_
KERNEL_MAGIC_COUNT: 19269
Decimal: 19269
Note: Required for MISC-01

Exploitation

Sleight of hand #1 — history rewrite (half 1)

The secret was committed and then excised from every branch/tag, leaving the blob unreachable. Recovering it with git fsck --unreachable yields half 1:

FLAG{cwa2026_finals_

Sleight of hand #2 — hidden in plain sight (half 2)

The same orphaned blob contains a second value disguised as a document classification header on line 1:

CLASSIFIED

It is easy to skip over CLASSIFIED as boilerplate, but it is actually half 2 of the flag.

The decoy (kept separate)

The blob also carries:

KERNEL_MAGIC_COUNT: 19269
Decimal: 19269
Note: Required for MISC-01

19269 is a decoy for this flag — it is kept separate because ModuleZero (a later challenge) depends on it. Combining it directly (…_19269) is incorrect.

Red herring

.git/config contains:

[secrets]
	engine = AES-ECB
	key = <REDACTED>

This looks like a cryptographic key, but no ciphertext present in the repository decrypts with it. It is misdirection.

Reassembly

Half 1 + half 2 + }:

FLAG{REDACTED}  =>  FLAG{REDACTED}

Flag

`FLAG{REDACTED}

Lessons / Takeaways

  • git fsck --unreachable surfaces objects orphaned by history rewrites (rebase, filter-branch, amend). Git retains dangling objects until git prune/gc runs.
  • Secrets can be split across multiple hiding mechanisms within the same recovered object; classify each recovered value (flag part vs. decoy vs. key for a later stage) before assembling.
  • Suspicious config entries (e.g. an AES key) can be red herrings — verify they actually decrypt something present in the repo before investing effort.

Techniques

  • Git fsck
  • Dangling objects
  • History rewrite recovery