by any other name: typescript as one more carrier for the analysis header

huntress ctf 2026, day 11 · script analysis · all three modes

tools used: script-analysis toolkit and timed-attempt pipeline.

the prompt: "these scripts reach for native apis by name, but a name isn't a behavior. map each reference to the receipt-backed action it models, and flag the call whose claimed purpose the evidence doesn't support." the bundle grew by two specimen families: four typescript polyglots and two more advanced bash samples, on top of every family from days 1 to 10.

the key insight: no new field kind arrived. the typescript files carry the same HUNTRESS_ANALYSIS_V1 comment header as day 8's php, wsf and hta specimens, over the same descriptor format, and the new bash samples use the material and descriptor shape of the earlier bash days. the generic descriptor finder read both without a line of language-specific code. no specimen named a native api, and no field asked about one.

challenge shape

the single asked 811 fields over one bundle, 58 more than day 10 and none removed; the time trial asked the same 811 of a fresh bundle, the mastery 1622 over two. the new fields:

polyglot-typescript-<tag>-*     tags: benign-utility, downloader, launcher,
                                staged-chain
  adapter  attack  campaign  host-profile  next-language  obfuscation
  role  stage-count  stage-profile  steps
  url (file-path for benign-utility)

bash-advanced-<tag>-*           tags: nameref-dispatch, dynamic-file-descriptor
  attack  campaign  feature  primitive  role  stage-count  steps

attack fields are att&ck ids (T#### or T####.###, or none where the question permits it); role is an enum of day 8's eleven labels; steps are ordered_tokens joined by > "with no surrounding spaces"; stage count is a base-10 integer; adapter, campaign, url, file path, the two profiles, next language, obfuscation, feature and primitive are exact text.

artifact anatomy

a typescript specimen carries its descriptor twice. once as the analysis header in a comment, HUNTRESS_ANALYSIS_V1:<CODEC>-<payload>, with the payload in one of day 8's codecs (FRAG dotted hex, HEX, B64, or HB64, hex of base64), and once as a typed string constant that a builder function returns frozen:

line 1   a line comment with the analysis header and its payload
line 2   descriptor_<id>: a constant of type string holding the same payload
line 3   buildPlan_<id>: a function returning a frozen object around it
line 4   a void reference to buildPlan_<id>

both decode to the same version-3 descriptor: key=value pairs separated by |, with the role, attack, steps (comma-separated), profiles, campaign, url or file path and the next stage's language stated directly.

a bash specimen keeps its material in a readonly Material_<id> variable next to a Codec_<id> variable naming the material's encoding (both new samples in our single's bundle used decimal_csv|: comma-separated decimal byte values, so bytes(int(x) for x in material.split(",")) reads them), and a one-line Feature_<id> that shows the syntax the sample is about (local -n for a nameref, exec {fd}<<< for a dynamically allocated file descriptor). its descriptor is version 1: feature, primitive, campaign, stage count and steps, with no role and no attack.

extraction method

the descriptor finder tries the analysis header first, because the header is the artifact's own statement and needs no carrier syntax:

ANALYSIS_HEADER = re.compile(r"HUNTRESS_ANALYSIS_V1:([A-Za-z0-9_]+)-(\S+)")
COMMENT_TAIL = "*/'\";>)"  # a header glued to its comment's closer


def header_descriptor(src: str) -> Found | None:
    m = ANALYSIS_HEADER.search(src)
    if m is None:
        return None
    kind, raw = m.group(1).upper(), m.group(2)
    payloads = list(dict.fromkeys((raw, raw.rstrip(COMMENT_TAIL))))
    if kind not in HEADER_CODECS:
        payloads += [p[::-1] for p in payloads]
    names = [kind] if kind in HEADER_CODECS else list(HEADER_CODECS)
    for name, text in [(k, p) for p in payloads for k in names]:
        with contextlib.suppress(ValueError, binascii.Error):
            desc = parse(HEADER_CODECS[name](text).decode("latin-1"))
            if desc is not None:
                return Found(desc, name.lower(), "identity")
    return None

an unknown codec name tries every decoder, payload reversed too; a payload with a comment closer glued to its end is tried with and without it. only when no header decodes does the finder fall back: first the Material_ / Codec_ reader that began with vbscript and also reads the bash samples, then a plaintext descriptor, then the generic search over every literal.

the new language changed nothing because the header regex does not care what surrounds it. the field family polyglot-typescript-<tag> locates the member by its own stem first, and the descriptor answers every field it states.

validation and answer formatting

stated descriptor values are used verbatim. for the typescript specimens the attack is the version-3 value as written (T1059 for the launcher and the staged chain, T1105 for the downloader, none for the benign utility), and the obfuscation field names the header's codec: FRAG is fragmented_hex, HEX plain_hex, B64 base64 and HB64 hex_base64. steps are the descriptor's comma list re-joined with >.

the bash version-1 descriptor states no role and no attack. those two fields take the values graded for every earlier advanced-bash specimen, advanced_syntax and T1059.004, as ranked candidates rather than certainties; both were accepted. feature and primitive are the descriptor's values as written.

automation across modes

the same finder answered all 811 fields of the single and the time trial and 1622 of the mastery's two bundles. the new specimens were placed by file stem, decoded by header, and mapped to fields by the descriptor's keys, the path every carrier since day 8 takes.

lessons

solve times

public scoreboard · day 11 finish: 1st

  • 0:02.9single#3 of 183 solvers
  • 0:05.2time trial#2 of 169 solvers
  • 0:07.9mastery#2 of 167 solvers
  • #1team day finishof 164 teams that cleared it, in 0:10.1
  • #5single 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.5s 1 0
time trial 2.3s 1 0
mastery 2.7s 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 9.0s 1.0s 8.0s
mastery 11.0s 1.4s 9.6s

where we got stuck

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

{generated by a clanker}