package deal: an android package's identity as file metadata

huntress ctf 2026, day 21 · metadata forensics · all three modes

tools used: archive and file metadata, android package analysis, cross-lane field resolution and timed-attempt pipeline.

"mobile packages have been mirrored under friendly filenames. recover android package identities, distinguish rebuilds from clones, and expose the borrowed product name." the single asked one apk for its apk.package_name; the timed modes asked the same beside one question from every family the category has used so far.

the key insight: an apk's identity is not in its file name or its zip headers but in the binary manifest's package attribute. the metadata solver had a reader for that manifest (the mobile category's), but no path from a metadata property name to it: the day's fix was to make every manifest and signer scalar a named reading, so any category that asks for one by name finds it.

challenge shape

single         1 field    apk.package_name of one apk in the bundle
time trial    26 fields   one of each family (days 4-21) plus roster,
                          evidence-note and a synthesis hash order
mastery      130 fields   five sets of the time trial's mix

the question: "determine apk.package_name for mobile-001.apk", answer kind exact_text (the artifact-derived value only; the literal none when the field is absent).

artifact anatomy

the apk is a zip with a binary AndroidManifest.xml (android's axml: a string pool, a resource-id map, then start/end element chunks whose attributes point into the pool), one dex, and v1 signature files under META-INF/. the root <manifest> element's package attribute is the application id; versionCode and versionName sit beside it, and <uses-sdk>, <uses-permission> and the components follow. "rebuilds versus clones" is what a comparison of package id, version and signing certificate tells apart: a rebuild keeps the id and the signer, a clone keeps neither or only the id.

extraction method

the apk toolkit decodes the axml manifest into a typed record (package, versions, sdk levels, permissions, components with their intent filters), and the signer through openssl pkcs7 on the signature block. on day 21 its table of named values gained every manifest scalar and the first signer, so the same name reaches the value from three directions: the metadata category's record reader (property words against field names), the cross-category name resolver, and the reading inventory that matches a field's words against every reader's keys.

def manifest_fields(m):
    launcher = [c.name for c in m.components
                if c.kind == "activity" and is_main_launcher(c)]
    return {
        "package_name": m.package,
        "version_code": m.version_code,
        "version_name": m.version_name,
        "main_activity": launcher[0] if launcher else "",
        # permission, component, deep-link counts ...
    }

validation and answer formatting

a property's words must name one field, and a leftover word another field owns refuses (apk-package-name is package_name, never version_name). the value goes out as stored in the manifest's string pool: the dotted application id, case and digits as written, with no quotes and no package: prefix. by hand, with apktool decoding the binary manifest:

apktool d -s -o mobile-001 mobile-001.apk      # -s: leave the dex undecoded
grep -o 'package="[^"]*"' mobile-001/AndroidManifest.xml

failed approaches and pivots

automation across modes

the record reader answers any apk-<words> property whose words name one manifest or signer field (version name, signer sha-256, main activity, permissions as a list), so the next apk property the category asks needs no new code. the other 25 families of the timed modes resolve through the same name-to-reader path as on earlier days.

lessons

solve times

public scoreboard · day 21 finish: below top 10

  • 0:30.0single#5 of 176 solvers
  • 0:54.1time trial#6 of 169 solvers
  • 0:56.5mastery#5 of 167 solvers
  • #36team day finishof 146 teams that cleared it, in 27:16.2
  • #5single orderof the day's 8, 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).

mode work to flag attempts wrong submits
single 28.8s 1 0
time trial 0.7s 1 0
mastery 0.9s 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.7s 49.3s
mastery 170.0s 0.9s 169.1s

where we got stuck

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

{generated by a clanker}