2026-10-04

Day 4: Go Fish

Lane: Binary reverse engineering. Modes: Single Solve, Time Trial, Mastery. Result: all CORRECT.

The challenge

What we were given

What was asked

How it was solved, start to finish

  1. Ran the driver run_tm.py. It starts the attempt, downloads the zip, runs solve_tm.py on it, and submits.
  2. Routine fields: solve_tm.py reads everything straight from the bytes:
  1. d04 (the new part): the question said to scan the Go file for the literal text HCFG and accept only a record whose bounds, CRC32 and JSON all check out. The record layout is the same as Day 2:

Re-checked on the saved sample:

HCFG offset=1813088 version=1 xor_key=0x51 len=367 crc32=0x2b747600
section of match: .noptrdata
JSON: {"campaign":"BR04-000","domain":"node-000.day04.example.invalid","ipv4":"198.51.100.80","url":"https://node-000.day04.example.invalid/api/BR04-000","mutex":"Global\\HuntressBR04_000", ...}

So the Go program keeps the record in its .noptrdata section. Answers: format ELF64, architecture x86-64, CRC32 0x2b747600, campaign BR04-000.

  1. Submitted all 32 answers (answers.json). Result: CORRECT.
  2. Time Trial: a fresh variant, same steps. Result: CORRECT.
  3. Mastery: two deliveries (64 answers), same steps per delivery. Result: CORRECT.

Results

ModeResultFlag
Single SolveCORRECTbd078697c2e833f2133fee7165659618
Time TrialCORRECTe3d4e5cf19d63a8993d003585ab5f811
MasteryCORRECT91dfb9065a8b11ec2f1127d61cc5c441

Each mode folder has the raw start-response.json, answers.json, submit-response.json and final-status-response.json.

Notes on the saved files:

Reproduce

Offline, from this folder (no Game Master needed):

mkdir -p /tmp/d04/deliveries && cp single-solve/evidence.zip /tmp/d04/deliveries/delivery-1.zip
python3 -I ~/.config/huntress/solvers/solve_tm.py single-solve/start-response.json /tmp/d04/deliveries /tmp/d04/answers.json

Checked on 2026-11-01: this gives the same 32 answers as answers.json. It only parses the samples and never runs them.

Live driver:

python3 -I ~/.config/huntress/solvers/run_tm.py binary-reverse-engineering-day-04-go-runtime-fingerprints single_solve /tmp/d04

This needs a Game Master token in ~/.config/huntress/gm-token.

Day 4: Picture This

Lane: Metadata forensics. Modes: Single Solve, Time Trial, Mastery. Result: all CORRECT.

The challenge

What we were given

What was asked

How it was solved, start to finish

The method: ignore the file name and size. Read the pixel size from the JPEG Start-Of-Frame (SOF0/SOF2) marker in the bytes.

  1. Single Solve. Downloaded the zip, extracted camera-001.jpg and parsed its SOF marker. Result: 257x146. Submitted it as d04-jpeg-001-jpeg-sof-dimensions-pixels. CORRECT.
  2. How the SOF parse works. Walk the JPEG segments from offset 2. Each segment starts with FF xx and a 2-byte big-endian length. Stop at the first SOF marker. Height is at +5, width at +7, both big-endian:
def jpeg_sof(b):
    i = 2
    while i < len(b) - 1:
        if b[i] != 0xFF: i += 1; continue
        m = b[i+1]
        if m in (0xC0,0xC1,0xC2,0xC3,0xC5,0xC6,0xC7,0xC9,0xCA,0xCB,0xCD,0xCE,0xCF):
            H = struct.unpack('>H', b[i+5:i+7])[0]
            W = struct.unpack('>H', b[i+7:i+9])[0]
            return '%dx%d' % (W, H)
        if m == 0xD8 or 0xD0 <= m <= 0xD7: i += 2
        else: i += 2 + struct.unpack('>H', b[i+2:i+4])[0]
  1. Built a small driver for one-answer challenges: run_mode.py <challenge> <mode> jpeg_sof <workdir>. It starts the attempt, downloads the artifact, finds the named file and runs the solver.
  2. Time Trial. run_mode.py metadata-forensics-day-04-picture-this time_trial jpeg_sof ... answered d04-jpeg-002-jpeg-sof-dimensions-pixels for camera-002.jpg. CORRECT.
  3. Mastery. The first driver run crashed. The bundle was nested: outer zip → evidence-0N.zip → camera-XXX.jpg. It was solved directly with nested extraction:

CORRECT. (On Day 5 the driver learned to search nested zips by itself.)

  1. Saved files. The JSON files in mastery/ come from a later re-run to capture the artifacts (attempt 08254812-4f46-4f23-918a-345bf37ef15b). That variant asked for camera-006.jpg = 342x201 and camera-007.jpg = 359x212. It also returned CORRECT.

Results

ModeResultFlag
Single SolveCORRECT7e89be3a036cd174cde99a1bde1178a7
Time TrialCORRECT3c6b625fde6f4a926fe08d3eb3adc665
MasteryCORRECTd8d8d88757bc1860b8071bedce14fb36

Reproduce

python3 -I ~/.config/huntress/solvers/run_mode.py metadata-forensics-day-04-picture-this single_solve jpeg_sof /tmp/d04

This needs a Game Master token in ~/.config/huntress/gm-token. For time_trial and mastery the driver calls op=retry first, which spends one of the unique attempts. It only parses the image bytes.

Day 4: Pending Intent Relay

Lane: Mobile (Android). Modes: Single Solve, Time Trial, Mastery. Result: all CORRECT.

The challenge

What we were given

What was asked

How it was solved, start to finish

The app was never installed or run.

  1. Started the Single Solve and downloaded the APK.
  2. Read the puzzle asset. New codec today: xor.
{"schema":"huntress.mobile.puzzle.v1","day":4,"codec":"xor","data":"XFNOMCstXCxeXCVYJSQkKiUpKy8=","key":29}
  1. Decoded it by hand: Base64-decode data, then XOR every byte with key (29).
import json, base64
p = json.load(open('single-solve/huntress_puzzle.json'))
print(bytes(b ^ p['key'] for b in base64.b64decode(p['data'])).decode())

Output: ANS-60A1CA8E89978462.

  1. Submitted it under answer. The Game Master replied CORRECT.
  2. Built a reusable driver, run_mode.py. Its header says it was made for one-answer-per-set lanes, including "pending-intent-relay". For the mobile lane it calls mobile_puzzle():
  1. Time Trial and Mastery: ran the driver on both. Both came back CORRECT.

Results

ModeResultFlag
Single SolveCORRECTbc6f49c30d6db023e69a88f2a1a8e16c
Time TrialCORRECT5cf5baf62b4f5a6b3df3b2ecba3e8905
MasteryCORRECT4c46c51c45e1f39a179ca20a52e1d95e

Each mode folder has answers.json, start-response.json, submit-response.json and final-status-response.json. The Single Solve submit-response.json says already_solved because it is a resubmit. Its final-status-response.json holds the CORRECT result and flag. No screenshots were taken.

Reproduce

Offline: run the Python snippet above from this folder.

A fresh run with the driver:

python3 -I ~/.config/huntress/solvers/run_mode.py mobile-android-day-04-pending-intent-relay single_solve mobile_puzzle /tmp/d04

This needs a Game Master token in ~/.config/huntress/gm-token. It only unzips the APK and reads the asset. It never installs or runs the app.

Day 4: Dim and Dimmer

Lane: Script analysis. Modes: Single Solve, Time Trial, Mastery. Result: all CORRECT.

The challenge

What we were given

decimal_pipe|subtract_modulo_256|0a
hex_compact|repeating_key_xor|c9,70,63,0e,67
hex_colon|single_byte_xor|27
reversed_decimal|reverse_bytes|

What was asked

How it was solved, start to finish

  1. Started the untimed Single Solve and downloaded the archive.
  2. Reused the Day 3 solver for PowerShell, JScript and Batch (solve_expansion.py).
  3. Wrote a VBScript decoder (vbsdec.py):
  4. Read Material_ and Codec_ with a regex.
  5. Turn the material into bytes using the representation (hex, decimal or Base64; reversed if the name says so).
  6. Try every transform on the bytes, forwards and reversed: plus/minus key, XOR key, repeating-key XOR, rolling XOR.
  7. Keep the result that reads as text starting with v=1|steps=. That prefix is the "oracle" that says the decode worked.
rep, transform, key = codec.split('|')     # "hex_compact|repeating_key_xor|c9,70,63,0e,67"
data = bytes_from_material(material, rep)  # hex / decimal / base64 -> list of ints
for cand in candidates(data, keys):        # every transform, forward and reversed
    try:
        text = bytes(x % 256 for x in cand).decode('utf-8')
    except UnicodeDecodeError:
        continue
    if text.startswith('v=1|steps='):
        break

Example: memory-stage.vbs is hex_compact + repeating_key_xor and decodes to:

v=1|steps=acquire_remote,dispatch_memory|adapter=MSXML2.XMLHTTP.6.0|stage_count=2|campaign_id=campaign-ab11f625dc|url=https://ab11f625dc.example.invalid/69b70dc3.dat|user_agent=HuntressLab/ab11f625dc
  1. Representation and transform were copied straight from the Codec_ string.
  2. Control was read from the source text, in this order: On Error → error_guard, Select Case → select_case, Do…Loop → do_once, While…Wend → while_once, For x = n To 0 → for_once, else direct.
  3. Role and ATT&CK used the Day 3 rules. VBScript's Command and Scripting Interpreter ID is T1059.005.
  4. Checked the answers with the partial-submit oracle (see Day 3). Single Solve is untimed, so each group of answers was sent on its own. All 231 were accepted on the first pass, and the last group turned the attempt CORRECT. Real answers from single-solve/answers.json:
{"vbscript-stager-role": "stager", "vbscript-stager-attack": "T1105",
 "vbscript-stager-adapter": "MSXML2.XMLHTTP.6.0", "vbscript-stager-campaign": "campaign-ab11f625dc",
 "vbscript-stager-representation": "hex_compact", "vbscript-stager-transform": "repeating_key_xor",
 "vbscript-stager-control": "direct"}
  1. Wrote the mode driver run_expansion.py. It does start → download → extract → solve → submit → status for any mode, and it splits Mastery into sets.
  2. Time Trial (50-second deadline): the new variant used representations not seen in Single Solve (Base64-style and hex with dashes) and the reverse_then_xor transform. The material parser was made format-agnostic and the transform search was made exhaustive. Single Solve still scored 231/231, and the Time Trial then passed.
  3. Mastery (80-second deadline): 462 questions in two sets, with one evidence.zip per set. run_expansion.py solved each set and merged the answers under set1. / set2.. It ran right after the Time Trial, and both came back CORRECT.

Results

ModeResultFlag
Single SolveCORRECT97a82c207f1f4f0dbe5bc146f613a43e
Time TrialCORRECTbb1896cf6329ac0dadc911791fa2dd82
MasteryCORRECTbdcc819b872e06373d6c9503755b7634

Each mode folder has answers.json and the Game Master JSON (start-, submit-, final-status-response.json). The Single Solve folder also keeps evidence.zip. No screenshots were taken.

Reproduce

Offline, from the repo root:

mkdir -p /tmp/d04/ex
7z x -pinfected -o/tmp/d04/ex repos/day-04-script-analysis-dim-and-dimmer/single-solve/evidence.zip
python3 -I tools/solve_expansion.py /tmp/d04/ex \
  repos/day-04-script-analysis-dim-and-dimmer/single-solve/start-response.json /tmp/d04/answers.json

This rebuilds all 231 saved answers (re-checked on 2026-11-01) and only reads the files as text.

Live, as run on the day (needs a Game Master token in ~/.config/huntress/gm-token):

python3 -I ~/.config/huntress/solvers/run_expansion.py script-analysis-day-04-shell-contrast time_trial /tmp/d04tt

Note: the ~/.config/huntress/solvers/ copy decodes JScript with jsdec.js, which runs each fixture in a Node vm sandbox. The tools/ copy uses the pure-Python jsdec_py_emu.py instead.

Day 4: Two of a Kind

Lane: Warmups. Modes: Single Solve, Time Trial, Mastery. Result: all CORRECT.

The challenge

What we were given

How it was solved

  1. Decode the blob. From Day 4 onward, blobs have numbered lines (NN<TAB>fragment). Each line uses a different encoding. Decode each line separately and concatenate the results.
  2. Mastery blobs use multiple encodings from Days 1-4. The solver (warmup_decode.py) tries every known decoder on each line and picks the one producing printable text.
  3. Concatenate all decoded lines. The text contains a message ending in the answer slug.
  4. Submit the slug to the Game Master.

Results