node by node: node.js specimens, roles taken from the question, and codec labels read both ways
huntress ctf 2026, day 7 · script analysis · all three modes
tools used: script-analysis toolkit and timed-attempt pipeline.
the evidence zip carried the cumulative script set (powershell, jscript, batch, vbscript, python and bash from days 1-6), eight new node.js modules and two "advanced syntax" bash specimens: 469 fields per set. the prompt asked to sort each node graph into its role, "benign, staging, dropping, downloading, uploading, launching, scheduled, or multi-stage".
the key insight: every new field was readable by the language-agnostic descriptor finder from day 5. what broke was everything around it: a file the solver could not place, two step graphs whose role it guessed wrong although the question listed the right role, and on the mastery a codec label that meant "reverse the text" where earlier days had meant "reverse the bytes".
challenge shape
new ids follow nodejs-<tag>-<field> and bash-advanced-<tag>-<field>:
- node:
node-context.mjs,node-memory-stage.mjs,node-embedded-write.mjs,node-remote-write.mjs,node-outbound-transfer.mjs,node-local-dispatch.mjs,node-schedule-descriptor.mjsandnode-staged-chain.mjs; seven fields each: role, att&ck id, adapter, campaign, stage count, steps, and one indicator (host id, url, file path, schedule path or service name). - bash:
indirect-expansion.sh(bash-advanced-indirect-*) andtoken-fragmentation.sh(bash-advanced-tokens-*); seven fields each: role, att&ck id, feature, primitive, campaign, stage count and steps.
the role question's answer format is an enum: benign_utility, downloader, dropper, impact, launcher, persistence_descriptor, relay, staged_chain, stager, uploader, advanced_syntax. the question text narrows it per specimen, and for the two advanced bash files it gives the answer away: "classify indirect-expansion.sh as advanced_syntax." the node questions list persistence_descriptor among their choices, and the bash attack question says "recover the bash interpreter att&ck technique". feature and primitive are verbatim exact_text, stage count an integer, steps ordered_tokens joined by >.
artifact anatomy
each node module is an es module that never runs its payload:
const Material_<id> = "[\"..\",\"..\", ...]"; // json array of hex bytes
const Codec_<id> = "<representation>|<transform>|<key hex>";
function load_<id>() { return JSON.parse(Material_<id>).map(v => Number.parseInt(v, 16)); }
function decode_<id>(b) { return b.map(v => v ^ KEY); }
async function inspect_<id>() { return (await recover_<id>()).split("|").join("|"); }
if (process.env.HUNTRESS_INSPECT_ONLY === "1") console.log(await inspect_<id>());
that shape is the hex_array codec. the single's node modules also used hex_buffer, escaped_octets (\x.. text), base64_literal and base64_chunks, with identity, reverse_bytes, single_byte_xor and rolling_xor; the keys are hex in the header and decimal in the code (a rolling_xor seed of <key hex> appears as its decimal value), and the variable names inside the decoders (imagePixels, colorTable) are noise.
the decoded descriptor is the usual v=1|steps=...|adapter=...|campaign_id=... with node-specific indicators. the advanced bash specimens carry a descriptor that starts with a feature instead of the steps: v=1|feature=...|primitive=...|campaign_id=...|stage_count=1|steps=....
extraction method
decoding needed nothing new: the finder reads the Codec_ header, decodes the Material_ literal with it, and accepts the result only if it parses as a descriptor; values are copied verbatim. three things around it changed.
placement. the solver placed a field by a table of known tags (chain -> staged-handoff, ...). persistence was in no table, so every nodejs-persistence-* field crashed. a field is now placed by the file its question names (evidence.zip -> node-schedule-descriptor.mjs) whenever the question names one; the tag tables remain for older questions.
roles. three step graphs were new:
| steps | role | att&ck |
|---|---|---|
build_schedule, register_descriptor |
persistence_descriptor |
T1053.003 |
recognize_syntax, reconstruct_intent |
advanced_syntax |
the interpreter's: bash T1059.004 |
read_file, transmit_remote |
uploader |
T1041 |
the verb-based guess from day 5 called the first two benign_utility (no remote, write or dispatch verb). the question's own enum had the right answers. an unseen graph now takes the one enum value that shares a word with its steps (register_descriptor / persistence_descriptor, recognize_syntax / advanced_syntax), and the att&ck id is recomputed from that role:
def role_from_choices(steps, choices):
for graded in ROLE_HISTORY.get(tuple(steps), []): # newest first
if graded in choices:
return graded
words = {w for s in steps for w in s.split("_")}
hits = [c for c in choices if words & set(c.split("_"))]
return hits[0] if len(hits) == 1 else None # never guess a tie
a role learned on an earlier day is only a default: if the question's enum no longer offers it, the word match decides.
interpreter. the multi-stage node graph takes the interpreter's sub-technique, and node is javascript: T1059.007. the parent T1059 is wrong.
validation and answer formatting
steps is an ordered_tokens field joined by > (the convention from day 6); role is checked against the enum; att&ck ids are checked against T####[.###]. an answer outside its question's enum is never submitted as the only candidate: the enum itself becomes the fallback list.
failed approaches and pivots
the mastery crashed with "no descriptor found" on one bash specimen. its header said reversed_base64| with an empty transform, and the material was base64 written backwards. on day 4, reversed_decimal and reversed_hex had meant "the decoded bytes are in reverse order"; here reversed_ meant "the text is reversed". the decoder knew only the first meaning, treated an empty transform as unknown, and the fallback search, which anchors on the v=1|steps= prefix, could not see a descriptor that starts with feature=.
the fix reads every reversed_* label both ways, accepts an empty transform as identity, and searches for a bare v=N| prefix as well. we then enumerated the whole label space instead of waiting for the next surprise: every base (decimal, hex, octal, binary, base64, percent, \u escapes, octal escapes) times every layout (colon, comma, dash, pipe, space, csv, array, compact, literal, chunks) times no/byte/text reversal times all eight transforms, 1008 specimens. 348 decoded. the gaps were the two reversal meanings, missing loaders for percent and escape representations, fixed-width digits with no separator, and one real bug in the literal reader: string concatenation ("a" & "b", "a" + "b", "a" .. "b") was joined with a regex that also ran inside the strings, so a base64 chunk ending in + lost it. literals are now joined only when the text between them is operators and whitespace. all 1008 decode.
the advanced bash headers on the mastery used other representations with the same empty transform (percent_hex|, decimal_csv|, hex_compact|), so reversed_base64| was one draw from a rotating set, not a one-off.
automation across modes
the single and the time trial ran the same function; the mastery's two sets of 469 fields each ran in about 0.2 seconds once the decoder handled the reversed text. a slice of the codec grid (every base and layout under all three reversal readings, transforms rotated across them) stays in the test suite, so a label the organizers rotate into a timed tier has already been decoded offline.
lessons
- place fields by what the question names, not by tables of past names.
- the question's enum is the role vocabulary. use it before guessing from verbs.
- a label prefix can change meaning between days; read ambiguous labels every plausible way and keep the reading that yields a valid descriptor.
- enumerate a compositional label space once and test all of it.
- never parse inside string literals when joining them.
solve times
public scoreboard · day 7 finish: top 3
- 2:25.5single#6 of 195 solvers
- 2:28.5time trialfirst blood, +4.3 s
- 4:44.3mastery#3 of 182 solvers
- #3team day finishof 179 teams that cleared it, in 4:44.3
- #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 | 2m22s | 1 | 35 |
| time trial | 3s | 1 | 0 |
| mastery | 2m16s | 2 | 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 | 11.0s | 1.6s | 9.4s |
| mastery | 13.0s | 2.3s | 10.7s |
where we got stuck
- single: the
nodejs-persistence-*fields crashed on placement, and both advanced bash specimens (the newrecognize_syntax, reconstruct_intentgraph) went out asbenign_utilitywith attacknone, both rejected. the node chain's att&ck went out as the parentT1059(rejected); nine more technique guesses followed (T1543.002,T1105,T1543,T1059.004,T1569.002,T1543.003,T1053.003,T1574,T1204, all rejected) afterT1059.007was wrongly believed rejected, while the solver's ownT1059.007was right. - mastery: the reversed-text base64 crashed the first attempt. decoding the specimen by hand and fixing the reader took about a minute and a half; the second attempt won.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}