Tactical LogHuntress CTF 2026 // team archive

Days / Day 02 / Script Analysis / Host With the Most

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

Host With the Most

Script Analysis SSTTMM Modes reported CORRECT in this write-up

Challenge

  • Event: Huntress CTF 2026 - Day 02
  • Category: Malware / Script triage (Windows Script Host JScript + PowerShell)
  • Artifact: host_with_the_most.zip (challenge artifact, not published) (AES-256 encrypted)
  • Answer model: 2026 AI Arena - dynamic per attempt. The downloadable file is the static method-prep task; answers are submitted to the Game Master (inside the Homebase VM), which returns the completion hash and auto-completes the CourseStack question.
  • Actual scored task (confirmed live in-VM): extract ~87 artifact-derived field answers by applying each sample's own declared transformation to its PowerShell Base64 records and JScript data (static analysis only, no execution). The Game Master gives partial credit per field. This superseded the initial "host with the most stages" reading of the title - a reminder to decode everything and submit per the GM's field schema rather than a single guess.

Artifacts

filenotes
host_with_the_most.zip (challenge artifact, not published)AES-256 Deflate, 12 entries. sha256 7743a1af7c51d0950e7620561cf392791a9537e044a8ca11d344b11540ade516
extracted/*.js (9)WSH/JScript "inert static-analysis fixtures"
extracted/*.ps1 (3)PowerShell "composite-analysis fixtures" (Resource Dev / Collection / Impact)

Triage

  • file / 7z l -slt -> AES-256 encrypted zip. unzip (Info-ZIP) cannot do AES; used 7z.
  • Theme "Host With the Most" + malware-sample packaging -> tried the malware-zip convention password infected first. Hit immediately (7z t -pinfected -> Everything is Ok).
  • 12 fixtures: filenames map to ATT&CK tactics/host behaviors (resource/collection/impact samples; host-context, memory-stage, embedded/remote-write, local-dispatch, staged/relay- handoff, outbound-transfer). Each .js is lightly obfuscated; each decodes to a JSON config with steps, an adapter (COM object or LOLBIN), values.campaign_id, and stageCount.

Investigation

  1. Crack the archive. AES-256; password infected: 7z x -pinfected host_with_the_most.zip -oextracted.
  2. Deobfuscate without executing the droppers. Each .js has a pure recover_*() data transform feeding an inspect_*() that eval()s the resulting JSON. local-dispatch.js also defines huntress_lab_*() which uses ActiveXObject("Scripting.FileSystemObject") / WScript.Shell.Run - a real exec sink that was never called. Five distinct obfuscation families were recovered:
    • single-byte XOR (embedded-write key 0x9E, outbound-transfer key 0x2B over :-hex)
    • XOR with a 5-byte key (host-context [30,242,44,59,191], staged-handoff [230,133,19,195,108] over base64)
    • array reverse (remote-write over --decimal; memory-stage base64 -> reverse -> XOR 0x63)
    • base64 identity (relay-handoff)
    • %xx URL-encode identity (impact-plan); raw char-codes (local-dispatch)
  3. Decoded stage map (all hosts are *.example.invalid placeholders):
    filestageCountadaptercampaign_id
    staged-handoff.js4Microsoft.XMLHTTPcampaign-b2e9046e6f
    relay-handoff.js4WinHttp.WinHttpRequest.5.1campaign-169b97ec9a
    outbound-transfer.js3CertReq.execampaign-30b8616db1
    impact-plan.js3ADODB.Streamcampaign-ee4a70e428
    remote-write.js2MSXML2.XMLHTTP.6.0campaign-99e39528bf
    memory-stage.js2MSXML2.XMLHTTP.6.0campaign-a3a04f5ced
    embedded-write.js2ADODB.Streamcampaign-e0aa64e87e
    local-dispatch.js2regsvr32.execampaign-3f8e0c467a
    host-context.js2Scripting.Dictionarycampaign-e8c441b095
    resource-sample.ps1-wallet / HKCU..Run keya=1c94fc0eeae4
    collection-sample.ps1-Login Data/Cookies -> zipa=a593e561fb02
    impact-sample.ps1-.locked ext + RECOVERY notea=bd68883e3dd4
  4. No baked answer. Scanned all decoded output: no flag{} and no word-word-word-NN token (contrast the sibling warmup "Half a Turn", whose ROT13 output literally contained its GM answer). The real GM task (seen in-VM) is to return the decoded value of every field across all 12 fixtures - the per-fixture configs above plus each .ps1's a..h record - which is why the solver dumps all fields rather than selecting one. Scored on the assigned per-attempt bytes, matching the Day-02 derived+dynamic family.

Flag Recovery

The field answers are computed live in the Homebase VM from the attempt's own artifact:

  1. 7z x -pinfected <assigned>.zip -oextracted
  2. node scripts/solve_host.js extracted - sandboxes ActiveXObject/WScript (throw), calls only each fixture's inspect_*, base64-decodes each .ps1 FromBase64String() literal, and prints every decoded field.
  3. Map each decoded field to the GM answer_id schema and submit; the GM scores partial credit per field and returns per-field feedback to correct any misses, then re-submit.

Verification (offline, this public copy): the Node solver independently reproduces the hand-decode of all 12 fixtures (a second engine cross-checking the Python decode). Status: method EVIDENCE_VALIDATED; submitted in-VM via Luna. See LUNA_HANDOFF.md and ../Day 02/VM_RunSheet.md.

Flag

Per-mode completion hashes are returned by the Game Master on acceptance (one per mode). Live status (GPT-6 Luna in Homebase VM):

  • Single Solve: first 87-field submit flagged 6 bad values via GM per-field feedback; corrected -> CORRECT / SUBMITTED_ACCEPTED (CourseStack 1/3).
  • Time Trial: 30s deadline; first run expired on 2 newly-randomized encodings; parser fixed + GM retry -> CORRECT / SUBMITTED_ACCEPTED (CourseStack 2/3).
  • Mastery: CORRECT / SUBMITTED_ACCEPTED (CourseStack 3/3) - completed 2026-10-02 as part of the day's 15/15.
All 3 modes accepted (Host With the Most = 3/3, 10 pts). Individual per-mode completion hashes
were not separately captured here, but the modes are CORRECT on CourseStack.

Minimal Reproduction

7z x -pinfected host_with_the_most.zip -oextracted
node scripts/solve_host.js extracted      # prints every decoded field across all 12 fixtures
# submit the decoded fields under the GM answer_id schema (partial credit per field); in-VM

Lessons Learned

  • infected is the first password to try on any AES/ZIP malware-sample challenge - instant hit.
  • Deobfuscate, don't detonate: JScript "fixtures" split a pure recover_*() transform from an inspect_*()/huntress_lab_*() exec sink. Running the config recovery in a vm context with ActiveXObject/WScript stubbed to throw gives the data with zero risk of the FSO/Shell.Run sink.
  • Decode everything; don't over-read the title. "Host With the Most" looked like "pick the host with the most stages," but the GM actually scored ~87 decoded fields with partial credit. Dumping every field (not selecting one property) was the correct hedge and matched the real task directly.
  • Day-02 Arena answers are derived + dynamic. A static file with no embedded flag{}/token is a method-prep sample; the real answers are a function of the per-attempt bytes read in-VM - never hard-code (Time Trial re-randomizes encodings, which expired the first timed run until the parser was generalized).
  • A second engine is cheap verification: decoding by hand (Python) and again via the Node solver cross-checks the method before the timed in-VM run.