one more thing: base32 inside gzip inside base64

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

tools used: decoding search engine and timed-attempt pipeline.

"thirty-two, a little pressure, then sixty-four. unpack that thought." the prompt is a recipe, read in the order it was cooked: the message was base32-encoded, the base32 text was gzip-compressed, and the gzip member was base64-encoded. the single and the time trial were one such blob each; the mastery was a zip of a hundred and fifty-three blobs of thirty-one numbered lines whose last line was a chunk under the same three layers.

the key insight is that the recipe runs backward and that the middle layer looks finished. base64 gives binary, which no reader mistakes for text, but gunzip gives clean printable ascii, JZUWGZJAO5XXE2ZA..., upper-case letters and digits from 2 to 7 with = padding. a decoder that stops at the first printable layer hands back base32; only one more decode gives the sentence.

challenge shape

single         1 field    the slug one blob's decoded text instructs
time trial     1 field    the same, a fresh blob
mastery      153 fields   one slug per blob, 153 blobs of 31 numbered lines

the field is message (setK.message in mastery): "decode the assigned blob completely. what exact answer slug does its final non-empty decoded line instruct you to submit?", answer kind pattern, three lowercase words and a two-digit number joined by hyphens.

artifact anatomy

the single's blob is 196 characters on one line, all of the base64 alphabet, ending in one =. it opens H4sI, which is the base64 of gzip's magic bytes 1f 8b and its method byte 08. from the outside in:

layer      size   what it holds
base64      196   H4sIAAAAAAACA0XLQRKDIAxA0TuJdNcFAglBAkWL...AAAA=
gzip        146   1f8b0800000000000203, one deflate block, crc32, isize 176
base32      176   JZUWGZJAO5XXE2ZAMRSWG33ENFXGOIDU...4LJXGY======
text        106   Nice work decoding this warmup! ... quick-piano-fern-76

the gzip header is the fixed ten bytes: magic, method 8 (deflate), no flags and so no stored file name, a modification time of zero, extra flags 2 (maximum compression) and os 3 (unix). one final deflate block with dynamic huffman tables follows (128 bytes), then the crc32 of the base32 text and its length, 176. because the header never changes, every blob of the day opens with the same thirteen characters, H4sIAAAAAAACA.

the sizes tell the layers apart. base32 spends eight characters on five bytes, so the 106-byte sentence becomes 176 characters: 22 groups, the last holding one byte and six =. deflate wins most of that back, since a base32 character carries five bits in eight, and packs the 176 characters into 128 bytes. base64 adds a third again: 146 bytes become 196 characters. the finished blob is 1.85 times the length of the sentence. the time trial's blob ran 111, 184, 149 and 200 the same way.

in the mastery each blob is NN<tab>chunk lines. line k is encoded by day k's encoding, from base64 on line 1 through url twice on line 30; line 31 is the message's last four characters under today's three layers. line 21, day 21's gzip in base64, opens with the same thirteen characters as line 31, so the two look alike until they are opened. set 1:

21  H4sIAAAAAAACAyvJSAUA5m1FPAMAAAA=          -> the
31  H4sIAAAAAAACA/P3DA9x9g20BQCCpz+SCAAAAA==  -> OIWTCMQ= -> r-12

read by day 21's codec, line 31 stops at OIWTCMQ=, base32 for r-12. on a chunk this short the compression costs instead of saving: eight base32 characters become a 28-byte gzip member, 18 of them header and trailer, and 40 base64 characters.

extraction method

by hand it is three calls of the standard library, in the reverse of the prompt's order:

import base64
import gzip


def decode(blob: str) -> str:
    return base64.b32decode(gzip.decompress(base64.b64decode(blob))).decode()

the decoding engine found the same chain without being told it. its compressed-base64 step, b64inflate, decodes base64 and then tries each decompressor in turn (zlib, gzip, bzip2, xz, zstd, lz4, raw deflate, brotli) until one opens the bytes, so "base64 then gunzip" is one unit and the whole recipe is two units deep: b64inflate>b32. no transform alone reads the blob, so the chain search ran next, breadth first over the day table's steps with the units the prompt names first. the prompt names all three layers in words the engine already knew:

HINT_FAMILIES = {
    "b64inflate": ("compress", "inflate", "deflate", "zlib", "pressure", ...),
    "b32": ("32", "thirty"),
    "b64": ("sixty-four", "sixty four", "base64", "base 64", "usual base"),
}

"pressure" has named the compressed-base64 step since day 21's "under pressure". the search's first level read b64inflate alone and got the base32 text, which it does not accept; its second level read b64inflate>b32 and got the sentence. with the prompt's ranking the search took 3.9 milliseconds in a rerun; with no prompt at all it found the same chain in 30 milliseconds.

validation and answer formatting

a reading counts when its text is printable, reads as english, and its last non-empty line holds a slug of the asked shape whose words are all dictionary words. each layer before the last fails a different part of that: the base64 decode is binary and fails the printable check; the gunzip output is printable but holds only A-Z2-7= and no words. gzip also checks itself: the decompressor verifies the trailer's crc32 and length against the base32 text, so a misread base64 layer raises instead of passing garbage on. the search stops at the shallowest accepted level, so no deeper chain is tried. the single's blob decoded to one sentence:

Nice work decoding this warmup! To solve, submit this exact answer to the Game Master: quick-piano-fern-76

the slug alone went to the grader, quick-piano-fern-76, and was accepted. the time trial's blob gave daring-blanket-butter-29; the mastery's 153 blobs gave 153 slugs, the first three dapper-storm-copper-12 (set 1), perky-daisy-ripple-19 (set 2) and dapper-island-tiger-25 (set 3), all accepted.

failed approaches and pivots

none on day 31: the first run of every mode found the reading.

automation across modes

the same chain answered every mode. the single's decode step took 0.07 seconds. the time trial's took half a millisecond: the single's chain was kept, and a kept chain reads a fresh blob before any search. in the mastery the line reader decoded lines 1 to 30 by their schedule rows; line 31, past the schedule, is simply the next row once the single's chain is kept. without it the line search still finds the chain per blob: a cold rerun read line 31 of all 153 blobs as b64inflate>b32, every slug confident, in 0.06 seconds. the mastery's 153 blobs took 0.10 seconds on the day.

lessons

solve times

public scoreboard · day 31 finish: below top 10

  • 0:02.7single#4 of 129 solvers
  • 0:05.6time trial#5 of 123 solvers
  • 0:07.5mastery#4 of 120 solvers
  • #14team day finishof 90 teams that cleared it, in 10:51.3
  • #1single orderof the day's 7, 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 the mode's first attempt start to its flag (server times). attempts counts our solver runs.

mode work to flag attempts wrong submits
single 1.0s 1 0
time trial 1.5s 1 0
mastery 0.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 30.0s 1.5s 28.5s
mastery 170.0s 0.6s 169.4s

where we got stuck

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

{generated by a clanker}