two of a kind: one more codec for the line decoder

huntress ctf 2026, day 4 · warmups · all three modes

tools used: decoding engine and timed-attempt pipeline.

day 4 kept the warmup format from days 1-3: a text blob whose decoded prose ends in a word-word-word-NN slug. the only change was a new representation. the blob was written as space-separated groups of eight binary digits, one group per byte.

the key insight was that nothing about the solver had to change. the decoder already searches a table of transformations and scores candidates by readable english, so the fix was one new entry in that table.

artifact anatomy

the payload looks like this, one octet per group:

01001110 01101001 01100011 01100101 00100000 01110111 ...

a group is exactly eight characters from {0, 1}. the whole blob is therefore a valid binary string only if every non-space character is 0 or 1 and the bit count is a multiple of eight. those two checks reject almost every other encoding before any decoding work happens. the prompt pointed at it: "there are only two sides to this story."

mastery came as one zip of 18 blob-NN.txt members, one per set, and each blob grew to four numbered lines, line k in day k's codec. each chunk is encoded on its own, so the base64 line ends in its own = padding even though the sentence continues on line 2:

01	TmljZSB3b3JrIGRlY29kaW5nIHRoaXMgd2E=
02	ezhc! Gb fbyir, fhozvg guvf
03	20657861637420616e7377657220746f207468652047616d65204d
04	01100001 01110011 01110100 01100101 01110010 00111010 00100000 ...

extraction method

def binary(text: str) -> str:
    bits = re.sub(r"\s", "", text)
    if not bits or set(bits) - {"0", "1"} or len(bits) % 8:
        raise ValueError("not binary")
    return as_text(int(bits, 2).to_bytes(len(bits) // 8, "big"))

that is the day-4 function; today's decode.binary also splits groups on ,, ;, :, |, _ or - and reads seven-bit groups, both added later. as_text insists on valid utf-8 without control characters, so a lucky parse of something that merely looks binary still fails loudly. the transform went ahead of decimal in the per-line order (decode.LINE_ORDER, where bin still precedes oct and dec): binary groups are also valid decimal digit runs, and trying the stricter reading first avoids a false decimal decode.

validation and answer formatting

the answer is the last bounded match of [a-z]+-[a-z]+-[a-z]+-\d{2} in the decoded text, and the text must read as english. that check is shared with every earlier warmup.

failed approaches and pivots

nothing was submitted wrong. the day-3 solver had no binary reading; adding decode.binary as the bin transform took most of the 36 seconds between download and first answer, and that answer was correct. the same day we added octal and decimal byte lists as guesses at the next codec, which created the overlap above: binary groups are also valid decimal digit runs, so bin was ordered ahead of dec before any blob could be misread.

automation across modes

the day-3 solver solved all three modes once the transform existed; the solver file changed only its challenge id. mastery carried eighteen sets under a seven-second clock.

lessons

solve times

public scoreboard · day 4 finish: 1st

  • 0:58.2single#2 of 291 solvers
  • 1:19.0time trial#2 of 259 solvers
  • 1:28.3mastery#2 of 252 solvers
  • #1team day finishof 192 teams that cleared it, in 11:06.3
  • #2single orderof the day's 5, by our flag time

from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.

from when we started working on the mode to its flag.

mode work to flag attempts wrong submits
single 53s 1 0
time trial 12s 1 0
mastery 6s 1 0

the clock

server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.

mode time available time used time left
time trial 6.0s 0.6s 5.4s
mastery 7.0s 0.4s 6.6s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}