sqlite assumptions: a hex puzzle codec, and a database that was only a story
huntress ctf 2026, day 12 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
the prompt: "reconstruct authorization from a synthetic sqlite cache and prove server-side impact." every delivery was an apk with one question: the backend code, an ANS- value.
the key insight: the apk carried no sqlite database. as on every day before, the code sat in assets/huntress_puzzle.json, and the puzzle's codec was hex, day 6's codec again.
challenge shape
single 1 field one apk
time trial 1 field one apk
mastery 3 fields three apks
the field is answer (set1.answer to set3.answer in mastery), and the syntax text reads "ans- followed by exactly 16 uppercase hexadecimal characters; no spaces or explanatory text".
artifact anatomy
the apk held a binary AndroidManifest.xml, classes.dex, the signature files under META-INF/, and the puzzle:
{"schema": "huntress.mobile.puzzle.v1", "day": 12, "codec": "hex", "data": "…"}
no .db, no databases/ path and no sqlite header anywhere in the archive: the authorization cache was the story, not an artifact.
extraction method
the solver opens the apk as a zip, reads the puzzle, and decodes data by its codec. codec names resolve through aliases first, then through every transform of the decoding engine, so hex is the same reading the warmups use. the decoded text must match the answer's pattern before it is submitted. the stored hex is lowercase, forty digits for the twenty characters of a code:
answer = bytes.fromhex(puzzle["data"]).decode("ascii")
validation and answer formatting
the decoded value must match ANS-[0-9A-F]{16} exactly. when the declared codec yields no such reading, the decoder tries the keyed search and then the generic peel with the answer shape as the goal, and raises if nothing matches instead of submitting a guess.
failed approaches and pivots
none. the day 12 preparation had listed the codecs that had not come back yet (plain, hex, caesar) and the warmups' newer encodings; hex was the repeat.
automation across modes
one call per apk answered all three modes: the single, the time trial and each of mastery's three apks.
lessons
- in this lane the prompt's story has never changed the question. read the puzzle first.
- five of twelve days (8 to 12) repeated an earlier codec, in no fixed order. keep every seen codec in the tests.
solve times
public scoreboard · day 12 finish: 1st
- 0:02.3singlefirst blood, +0.34 s
- 0:03.7time trialfirst blood, +1.4 s
- 0:05.6masteryfirst blood, +1.2 s
- #1team day finishof 166 teams that cleared it, in 1:06.5
- #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 | 1.7s | 1 | 0 |
| time trial | 1.3s | 1 | 0 |
| mastery | 2.2s | 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 | 0.6s | 29.4s |
| mastery | 30.0s | 1.3s | 28.7s |
where we got stuck
- nowhere. the codec was a repeat and each mode took one attempt.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}