Tactical LogHuntress CTF 2026 // team archive

Days / Day 07 / Script Analysis / Node by Node

DAY 07//LANE: SCRIPT ANALYSIS//STATUS: CORRECT x3

Node by Node

Script Analysis SSTTMM Modes reported CORRECT in this write-up

Node by Node - Day 07 (script-analysis)

Challenge id: script-analysis-day-07-node-operation-graphs Family: script_inventory (cumulative static-triage inventory) + NEW Node.js .mjs layer

Flags

ModeFlag
Single SolveTokena57ead56a18638af990739dfc113a286
Time TrialToken5eb0ded75fca34b6930f4b54b0ba177f
MasteryToken20ea7d17b65f2578f17b1cb4d1446eb9

What it was

AES zip (pw infected) of 61 inert fixtures across 7 languages: PowerShell .ps1, JScript .js, Batch .cmd/.bat, VBScript .vbs, Python carriers .py, Bash .sh, and the NEW Node.js .mjs. 469 per-field questions (938 in Mastery = 2 sets). Nothing is ever executed - every fixture is decoded statically. Each file carries an encoded descriptor that decodes to a v=1|key=value|... string; the answers (role, MITRE technique, adapter, campaign id, url/path/mutex/..., steps, stage count, syntax style, control/expansion form, etc.) are read from those bytes.

New this day

  1. Node.js .mjs (nodejs-* ids, 8 files x 7 fields): each defines Material_<id> (encoded blob) and Codec_<id> = "<representation>|<transform>|<key>", plus pure load/decode/recover/inspect functions. Representations seen: base64_chunks, base64_literal, hex_buffer, hex_array (JSON array of hex strings), escaped_octets (\xHH text), unicode_escapes (\uXXXX), reversed_base64. Transforms: identity, reverse_bytes, single_byte_xor, rolling_xor, add/subtract_modulo_256, repeating_key_xor. Decoded to the same v=1|... descriptor as Bash.
  2. Advanced Bash syntax fixtures (indirect-expansion.sh, token-fragmentation.sh, bash-advanced-* ids): role advanced_syntax, extra kv feature + primitive, steps recognize_syntax,reconstruct_intent, attack = Bash interpreter technique T1059.004.
  3. New roles: persistence_descriptor (node-schedule-descriptor, /etc/cron.d -> T1053.003) and relay as its own enum value (previously folded into staged_chain).

Key insight (role disambiguation)

relay-handoff.* and staged-handoff.* share the identical 4-step behavior graph acquire_remote,write_file,dispatch_process,handoff_script, so role cannot come from steps alone for those. GM-confirmed: both grade staged_chain. The relay enum value is reserved for the 3-step decode_configuration,locate_interpreter,dispatch_next_stage signature (the Python embedded-runtime and zipapp relay carriers).

MITRE model (all GM-confirmed)

benign none; stager/downloader T1105; dropper T1140; uploader T1041; impact T1486; launcher/relay/staged_chain/advanced_syntax = interpreter technique of the language (js/mjs T1059.007, bat T1059.003, vbs T1059.005, py T1059.006, sh T1059.004); persistence_descriptor T1053.003. PowerShell samples: resource T1496, collection T1555.003, impact T1486.

Solver

scripts/solve_node_by_node.py (reusable copy in _lib/) + new _lib/decode_node.py.

  • Extends the Day06 unified solver (ps1/js/bat/vbs/py/sh) with an .mjs branch and advanced-bash feature/primitive handling.
  • decode_node.robust_decode() is content-driven: it builds every plausible byte interpretation of the material (raw string, string-reversed, JSON array as hex AND decimal, \xHH, \uXXXX, base64, hex, decimal list) and runs the declared transform + a full brute (xor/add/sub/rolling/repeating/reverse) against each, validating that the result starts v=1|. This absorbs per-attempt codec mutations with no hand-derivation.
  • Mastery delivers ONE outer zip containing inner AES zips evidence-01.zip (challenge artifact, not published)/evidence-02.zip (challenge artifact, not published) (one per set); run_gm detects nested .zip members and maps them to set1/set2.

GM submission mechanics (learned here)

A batch submit is all-or-nothing (returns incorrect and banks nothing if any field is wrong). But individual submits BANK cumulatively within an attempt (remaining counts down, accepted_ids accumulate). The timed solver therefore tries the full batch first and, if not CORRECT, falls back to a grouped submit (confident byte-derived fields, then each model-label class) dropping to per-field only where a class isn't wholly accepted - so one wrong label never sinks the attempt.

Run

# from framework root (WSL)
python3 "challenges/Day 07/Node by Node/scripts/solve_node_by_node.py" local        # offline 469/469
python3 "challenges/Day 07/Node by Node/scripts/solve_node_by_node.py" single|time_trial|mastery