local secrets: day 4's xor codec again, and stores that were only strings
huntress ctf 2026, day 11 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
the prompt: "separate active credentials from decoys across generated local stores." the apk shape was the lane's usual one: a manifest, classes.dex, the signature files and one json puzzle, with a single answer field per set.
the key insight: the puzzle's codec was xor, the codec of day 4, and the "local stores" existed only as strings inside the dex. there was no shared-preferences xml and no sqlite database in any apk, so the story had no files behind it, and the answer came from the puzzle alone.
challenge shape
single 1 apk answer
time trial 1 apk answer
mastery 3 apks answer per set
the answer is a pattern the question states: ANS- followed by exactly 16 uppercase hexadecimal characters.
the codec history so far: reverse on days 2 and 8, base64 on days 3 and 9, split on days 5 and 10, xor on days 4 and 11. no fixed cycle explains that sequence (day 10's split broke the obvious one), so every codec we have seen stays tested, and so do the warmups encodings that have not appeared as a codec yet.
artifact anatomy
the puzzle is a small json object; besides the constant schema (huntress.mobile.puzzle.v1) and day it holds three keys:
codec the operation, by name (xor)
data base64 text, 28 characters
key a json integer below 256, different in every apk
by hand, as on day 4:
raw = base64.b64decode(puzzle["data"])
answer = bytes(b ^ puzzle["key"] % 256 for b in raw).decode()
the dex holds the story: a string that labels a locally stored synthetic credential and a decoy client secret. no question asked about either, and the apk contained no file of the kinds those strings describe.
extraction method
the apk reader finds the puzzle json among the members, then decodes data by the codec name. a keyed step first turns data into bytes under each reading the toolkit supports (base64, url-safe base64, hex, and the raw text last), then applies the key byte by byte:
def _xor(raw: bytes, key: bytes) -> str:
return bytes(b ^ key[i % len(key)] for i, b in enumerate(raw)).decode("latin-1")
# a keyed step on undecoded data reads it as each of these first
BYTE_READINGS = (_b64, _b64url, bytes.fromhex)
a decimal key becomes one byte, and a longer key would cycle; the same step serves add and sub. the first reading whose result matches the answer pattern wins.
validation and answer formatting
the decoded text must match the question's pattern exactly: the ANS- prefix and 16 uppercase hex digits. a reading that yields anything else is discarded, which is what makes trying several byte readings safe. the answer is submitted as decoded.
automation across modes
the day 10 solver answered all five apks unchanged: one in the single, one in the time trial and three in the mastery, each with its own key.
lessons
- when a codec sequence breaks its pattern once, stop predicting it. keep every seen codec in the test grid.
- a keyed byte operation needs the data's byte reading first. trying a few readings is cheap when the answer has a strict pattern.
- check whether the stores a story names exist as files before parsing for them.
solve times
public scoreboard · day 11 finish: 1st
- 0:02.2single#2 of 195 solvers
- 0:03.6time trial#2 of 185 solvers
- 0:05.3masteryfirst blood, +0.11 s
- #1team day finishof 164 teams that cleared it, in 0:10.1
- #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.8s | 1 | 0 |
| time trial | 1.6s | 1 | 0 |
| mastery | 1.4s | 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 | 7.0s | 0.6s | 6.4s |
| mastery | 8.0s | 0.6s | 7.4s |
where we got stuck
- nowhere. a returning codec was already in the test grid, so each mode took one attempt.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}