loaded later: the code lives in a second dex
huntress ctf 2026, day 20 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
the app's puzzle file names a codec nobody had seen, dynamic, and its data is not data at all: it is the path of a second dex inside the apk, one the app loads at runtime. the code is a string constant in that dex.
the key insight: when data looks like a member path, read the member. one ANS- string in it is the answer; everything else about the puzzle is a distraction.
challenge shape
single 1 field the ANS- code of one apk
time trial 1 field the same, a fresh apk
mastery 5 fields five apks, one per set
artifact anatomy
assets/huntress_puzzle.json:
{"schema": "huntress.mobile.puzzle.v1", "day": 20,
"codec": "dynamic", "data": "assets/payload.dex"}
assets/payload.dex is a small dex (magic dex\n035\0) whose string table holds the code in clear. the mastery's five sets are a tour of the category: an xor puzzle (day 4), a caesar one (day 7), a split one (day 10), a native one with the code in the json (day 15), and today's.
extraction method
the apk toolkit reads the puzzle json, and from day 20 checks data against a member-path shape before decoding it: a string with a dot and no base64 shape that names a member of the apk (by path or base name) is read from the package, and the one ANS- match in it is the code.
MEMBER_PATH = re.compile(r"[A-Za-z0-9_][A-Za-z0-9_./-]*\.[A-Za-z0-9]{1,8}")
def member_code(puzzle, read):
data = puzzle.get("data")
if not isinstance(data, str) or not MEMBER_PATH.fullmatch(data):
return None
body = read(data)
found = sorted(set(ANSWER.findall(body.decode("latin-1"))))
if len(found) == 1:
return found[0]
if found:
raise ValueError(f"member {data} holds {len(found)} codes")
return None # no code: the member's text goes through the codec chain
by hand, with the standard library (the code sits in the member's string table in clear, and classes.dex holds none):
import json, re, zipfile
apk = zipfile.ZipFile("loaded_later.apk")
puzzle = json.loads(apk.read("assets/huntress_puzzle.json"))
member = apk.read(puzzle["data"]) # assets/payload.dex
print(set(re.findall(rb"ANS-[0-9A-F]{16}", member))) # exactly one code
on the day the puzzle was unreadable to the codec chain ("no decoding path found"), and the fallback that scans a package for a stored code of the answer's shape found the string in the dex: the single and the time trial were answered that way.
validation and answer formatting
the code's shape (ANS- and sixteen uppercase hex digits) is the only check a stored string can pass; two distinct matches in the member are an error, not a choice.
failed approaches and pivots
- the stored-code fallback, once it had answered the single, answered every mastery set the same way, and the three older-codec sets store no such string: the first submit carried only sets 4 and 5 (both accepted) and left sets 1-3 unanswered, while the codec chain would have read them. the fallback now runs only for a set the codec chain cannot read.
automation across modes
the member-path check sits in front of the codec chain, so dynamic and any later codec that points at a member read the same way; the older codecs read as before.
lessons
- a
datafield is not always data: test it for a member path before decoding it. - a fallback that answers a field must not take the field away from the reader that normally answers it; run the normal reader first, per set.
solve times
public scoreboard · day 20 finish: below top 10
- 0:02.9single#2 of 171 solvers
- 0:04.8time trial#2 of 166 solvers
- 1:07.9mastery#20 of 166 solvers
- #25team day finishof 150 teams that cleared it, in 12:50.9
- #2single 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 when we started working on the mode to its flag.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 1.1s | 1 | 0 |
| time trial | 0.5s | 1 | 0 |
| mastery | 61.8s | 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 | 50.0s | 0.5s | 49.5s |
| mastery | 170.0s | 61.8s | 108.2s |
where we got stuck
- the mastery: sets 1-3 (xor, caesar, split) went to the stored-code scan and found nothing. the attempt stayed open with sets 4 and 5 graded; 60s later a reader that handles
dynamicand lets the codec chain read the rest was in place, and a second submit inside the same attempt sent the three missing sets: correct at 61.8s of its 170.0s clock.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}