network config split: a network security config nobody references, and day 5's codec again
huntress ctf 2026, day 10 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
the prompt asked us to "diff manifest and network security config variants to locate the true transport exception". for the first time the apk shipped a compiled network security config, and the manifest and the config disagreed about cleartext traffic. the answer, as on every day so far, was an ANS- code in the puzzle asset, and the codec was split, last seen on day 5.
the key insight: the network story was a second puzzle the questions never asked. the config file sat in the apk, but the manifest did not reference it, so android would never apply it: the manifest's own cleartext flag was the policy in force. we built the reader that says so on day 10 and kept it out of the answer path.
challenge shape
one answer field per apk, answer, asked as "for case mob-10-… in package com.huntress.mobile.d10.…: diff manifest and network security config variants to locate the true transport exception. submit only the exact backend answer code returned for this case.", with the syntax "ANS- followed by exactly 16 uppercase hexadecimal characters; no spaces or explanatory text". the single and the time trial delivered one apk each, the mastery three under one clock.
artifact anatomy
the single's apk held the usual members plus one:
AndroidManifest.xml binary xml
assets/huntress_puzzle.json the puzzle
res/xml/network_security_config.xml binary xml (new)
resources.arsc resource table
classes.dex
META-INF/… signature files
the puzzle asset is day 5's shape: an empty data, a parts list of three fragments and an order list of three positions. order[i] says where parts[i] goes in the answer, as on day 5.
the manifest's <application> sets android:usesCleartextTraffic="true" and has no android:networkSecurityConfig attribute. the config file declares a cleartext exception for one loopback address. on api 24 and later a network security config replaces the manifest flag only when the manifest points at it; an unreferenced file under res/xml/ is just a resource. so the "true transport exception" is the manifest's: cleartext is allowed everywhere, and the config's narrower exception never takes effect.
extraction method
the decoder reads codec, splits chains on + and |, and applies each step. split arranges the fragments by position and joins them; if the join is not an ANS- code, the rest of the chain decodes the join:
def _arrangements(puzzle):
parts, order = _parts(puzzle)
placed = [parts[i] for i in sorted(range(len(parts)), key=order.__getitem__)]
out = [placed]
base = min(order)
if sorted(order) == list(range(base, base + len(parts))):
out.append([parts[i - base] for i in order])
...
the first arrangement is the reading the grader confirmed on day 5. sorting the indices by their position, instead of indexing a list with the position, makes 0-based, 1-based and sparse positions ([10, 20, 30]) the same input; the second arrangement (order as the sequence to take the parts in) is the fallback when the first is not an answer.
the day-9 solver read all five apks this way with no change.
validation and answer formatting
the joined text must match ^ANS-[0-9A-F]{16}$ exactly; anything else is not an answer, whichever arrangement produced it. the answer field is checked against the question's syntax before submission, so a field that asks for something other than the code (an app setting, a domain) makes the solver raise instead of submitting the code under the wrong field.
failed approaches and pivots
we had predicted the codec wrongly. days 1 to 7 brought a new codec each day, and once they began to repeat we guessed a cycle that would bring day 4's keyed xor back on day 10. days 8, 9 and 10 instead repeated days 2, 3 and 5. the decoder did not depend on the guess, because every codec seen so far stays tested, so the miss cost nothing; but the guess was wrong, and we no longer plan around an order.
what we do plan around is a repeat coming back changed. on day 10 the split codec learned to read each fragment encoded on its own (split+base64 with three padded base64 fragments, decoded one by one and then joined), a parts object instead of a list, and data holding the fragments with a separator. keys for the keyed codecs are found under more names and as base64, a base32 layer passes raw bytes to an xor step, and rot18 (rot13 on letters, rot5 on digits) is a codec name.
automation across modes
the single, the time trial and the three mastery apks all declared split with plain fragments, and the same decode answered each.
the network reader is in the toolkit for the day a question asks it. it parses the compiled config, follows android:networkSecurityConfig (an @xml/ name or a resource id resolved through resources.arsc) and applies android's precedence: a referenced config's base-config decides cleartext and user certificate trust on api 24 and later, the manifest flag decides otherwise, and the default comes from the target sdk. it reports every disagreement as a note, for example:
res/xml/network_security_config.xml is not referenced by the manifest
an app field that the reader cannot answer is a crash, never an empty string. the toolkit article has the field list.
lessons
- a config file in an apk is configuration only if something references it. the manifest attribute is the link; check it before reading the file.
- a guessed sequence of challenge changes is a plan to test, not a plan to depend on: keep every earlier variant working.
- prepare a repeat as a variant: the same codec name can arrive with each part encoded, other position bases or another container.
solve times
public scoreboard · day 10 finish: top 3
- 0:04.7single#7 of 199 solvers
- 0:06.1time trial#3 of 188 solvers
- 0:07.5masteryfirst blood, +0.26 s
- #2team day finishof 173 teams that cleared it, in 1:40.9
- #1single 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 | 2.2s | 1 | 0 |
| time trial | 1.3s | 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 | 13.0s | 0.5s | 12.5s |
| mastery | 10.0s | 0.6s | 9.4s |
where we got stuck
- nowhere on the clock: every apk decoded on the declared codec's first reading.
- the network security config cost reading time, not solving time: we checked whether any question could be answered from it, found that none asked, and built the reader for later days without touching the answer path.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}