main character energy: where a java archive begins

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

tools used: archive and metadata readers, cross-lane fields and timed-attempt pipeline.

"java archives contain libraries, applications, and nested dependencies whose manifests disagree with their launchers. determine what is runnable and where execution begins." the day's new property was jar.main_class: the class a java -jar launch starts in.

the key insight: a jar's entry point is a manifest attribute, not something to infer from the class files, and the manifest is a plain-text format with its own line-continuation rule.

challenge shape

single         1 field     jar.main_class of the evidence jar
time trial    27 fields    the new property beside earlier days' properties
mastery      162 fields    the same over six sets

artifact anatomy

the evidence zip holds one application jar, itself a zip: one class file under its package directory, a couple of evidence files and META-INF/MANIFEST.MF, whose main section names three attributes: the manifest version, the main class and the tool that built the archive.

signed archives also carry per-entry sections after the first blank line (Name: then a digest), and android packages in the same bundles carry a manifest of that kind; neither has a Main-Class.

extraction method

the manifest's main section is Key: value lines; a line that starts with one space continues the previous value (the jar specification wraps lines at 72 bytes), and the first blank line ends the main section. the day's answer was read by the binary lane's jar reader, which our cross-lane fields layer asks for any field name the metadata lane has no reader for. the same day every main attribute became a record field of its own, so the family's next property needs no new code. by hand, unzip -p application-001.jar META-INF/MANIFEST.MF prints the manifest; the parse is:

for line in text.replace("\r\n", "\n").split("\n"):
    if not line.strip():
        if out:
            break
        continue
    if line.startswith(" ") and last:
        out[last] += line[1:]          # a continued value
        continue
    key, sep, value = line.partition(":")
    if sep:
        last = key.strip()
        out[last] = value.strip()

validation and answer formatting

the class name is answered exactly as the Main-Class value stores it: the dotted, fully qualified name (package.Class), case kept, not the package/Class.class path of the class file inside the archive. the grader only trims whitespace. a jar launched through a loader class (a "fat" jar whose manifest names a launcher and a separate start class) would make the question's wording matter; day 22's archives named one class only.

failed approaches and pivots

none on the day. before the record reader existed, any manifest attribute other than the main class would have had no reader in this lane.

automation across modes

one reader answers the single and every set of the timed modes; the earlier properties in the tiers come from their own readers unchanged.

lessons

solve times

public scoreboard · day 22 finish: below top 10

  • 0:03.3singlefirst blood, +0.29 s
  • 0:06.4time trialfirst blood, +1.7 s
  • 0:09.7masteryfirst blood, +1.6 s
  • #26team day finishof 145 teams that cleared it, in 10:39.5
  • #1single 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 the mode's first attempt start to its flag (server times).

mode work to flag attempts wrong submits
single 0.9s 1 0
time trial 1.5s 1 0
mastery 1.6s 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 1.5s 48.5s
mastery 200.0s 1.6s 198.4s

where we got stuck

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

{generated by a clanker}