trust the process: an msbuild project as one more carrier

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

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

the prompt: "an msbuild project looks like routine build plumbing until you follow its properties into its targets. recover the property and target flow, compare it with earlier execution chains, and find where a trusted toolchain is doing untrusted work." the delivery was the cumulative specimen bundle (111 members in one flat zip, password infected): every language from earlier days plus four msbuild project files and two more advanced-syntax bash specimens.

the key insight: like every specimen before it, each project carried its analysis descriptor inside the file, here twice: in an xml comment and in a custom property. the descriptor reader looks for that header in any carrier and under any encoding, so a new language was a new carrier, not a new problem.

challenge shape

single        971 fields   one bundle: powershell, jscript, batch, vbscript,
                           python, bash, node.js, host profiles, polyglots
time trial    971 fields   the same bundle, other values
mastery      1942 fields   two bundles

the new families are polyglot-msbuild_xml-<sample>-<field> for four samples (a benign utility, a downloader, a launcher and a staged chain) and eleven fields each: role, attack, adapter, campaign, url or file-path, stage-count, steps, host-profile, obfuscation, stage-profile and next-language. the other 14 new fields belong to two bash specimens, getopts-state.sh and brace-expansion.sh, seven fields each (role, attack, feature, primitive, campaign, stage-count, steps), asked exactly as day 13's advanced-syntax pair.

campaign ids read MSBUILD_XML-<8 hex> (lower-case hex) and BASHX-<8 HEX> (upper case). role is the eleven-value enum from earlier days, attack an att&ck id or none chosen by the precedence the question spells out, stage-count a base-10 integer, steps tokens joined by > with no spaces, and everything else exact text from the file.

artifact anatomy

an msbuild project is xml in the msbuild/2003 namespace. properties are declared in a PropertyGroup, and targets run tasks that read them, so the flow the prompt asks about is property -> target -> task. the specimens put the descriptor at the top; a whole .proj is three lines:

<?xml version="1.0" encoding="utf-8"?>
<!-- HUNTRESS_ANALYSIS_V1:<CODEC>-<payload> -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><HuntressDescriptor><payload></HuntressDescriptor></PropertyGroup><Target Name="Analyze"><Message Text="Inert analysis fixture" Importance="low" /></Target></Project>

the one target, Analyze, prints a low-importance message and never reads the property: there is no inline task and no property-to-target flow to recover. the HuntressDescriptor property holds the comment's payload byte for byte. the codec is one of the four analysis-header codecs, a different one per project: B64 (base64), HEX (hex of the text), HB64 (hex of the base64 text) and FRAG (hex cut into dot-separated fragments). the decoded text is the v=3 descriptor, a |-separated list of key=value pairs (v=3|language=msbuild_xml|role=…|verdict=…|attack=…|…), and its obfuscation_profile names the codec (base64, plain_hex, hex_base64, fragmented_hex).

the bash pair keeps day 13's form, readonly Material_<id>='…' beside readonly Codec_<id>='…', here xor_hex|<key> (hex bytes xored with one key byte) and reversed_base64| (base64 written backwards), each with a Decode() function that spells out the inverse.

extraction method

the reader scans every member for the analysis marker, decodes the payload with the codec the header names (our table is specimen.HEADER_CODECS; only an unknown codec name makes it try every decoder, the payload reversed too) and keeps the result only if it parses as a descriptor:

import base64
import re

HEADER = re.compile(r"HUNTRESS_ANALYSIS_V1:([A-Za-z0-9_]+)-(\S+)")


def hb64(payload: str) -> bytes:
    return base64.b64decode(bytes.fromhex(payload))


def frag(payload: str) -> bytes:
    return bytes.fromhex(payload.replace(".", ""))


CODECS = {"B64": base64.b64decode, "HEX": bytes.fromhex, "HB64": hb64, "FRAG": frag}


def descriptor(text: str) -> dict[str, str]:
    codec, payload = HEADER.search(text).groups()
    plain = CODECS[codec](payload).decode()
    return dict(kv.split("=", 1) for kv in plain.split("|"))

each field reads one descriptor key: the suffix with - for _ (host-profile reads host_profile), obfuscation reads obfuscation_profile, campaign reads campaign_id, and steps turns the descriptor's commas into >. the bash xor_hex|<key> member decoded through the known-prefix search, as on day 13, because our material reader did not yet split that two-part header; it does now (vbscript.short_header).

validation and answer formatting

the property repeats the comment's payload, so either copy alone is enough, and the descriptor's own language key names the carrier. a label is matched to the question's enum when the question gives one.

the descriptor states attack, and the stated value was graded correct: none (benign utility), T1105 (downloader) and the parent T1059 (launcher, staged chain), which the question accepts "when a language-specific sub-technique is canonical". as on day 13, the steps and profiles in each record do not follow its role (the benign utility carries a decode-write-launch graph), so the stated attack is the answer, not one re-derived from the steps. the bash pair states no role or attack: the question names the bash interpreter sub-technique (T1059.004) and the advanced-syntax role.

failed approaches and pivots

none on the day. the msbuild files needed no msbuild semantics: the property feeds no target, and the descriptor was readable as text.

automation across modes

the same bundle reader answered all 971 fields of each bundle, earlier languages included; the mastery's two bundles were read independently.

lessons

solve times

public scoreboard · day 14 finish: below top 10

  • 0:04.2single#3 of 178 solvers
  • 0:06.7time trial#2 of 171 solvers
  • 0:10.5mastery#3 of 170 solvers
  • #18team day finishof 165 teams that cleared it, in 4:36.7
  • #3single 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 1.8s 1 0
time trial 0.9s 1 0
mastery 2.1s 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 30.0s 0.9s 29.1s
mastery 30.0s 2.1s 27.9s

where we got stuck

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

{generated by a clanker}