Tactical LogHuntress CTF 2026 // team archive

Days / Day 29 / Binary RE / Fraternal Twins

DAY 29//LANE: BINARY RE//STATUS: CORRECT x3

Fraternal Twins

Binary RE SSTTMM Modes reported CORRECT in this write-up

Day 29 — Fraternal Twins (binary-reverse-engineering)

Challenge

  • Prompt: "Two binaries, same source, different compiler moods. Diff the variants, account for every optimization, and prove they're semantically the same program."
  • Lane: binary-reverse-engineering
  • Agent: agent-2
  • Modes: Single Solve, Time Trial, Mastery (5 sets of 1055 ids = 5278 ids)

Flags

  • Single Solve: Token7a8254060bb77aa886fcfe2980c66f8d
  • Time Trial: Tokenc487352b2f81962622fffdee387a7823
  • Mastery: Tokenf5d915fdfa38b9ced711ab6b681d3bd8

Artifact

  • Path: challenges/Day 29/⚙️ Fraternal Twins/artifacts/single_0.bin
  • Format: AES-encrypted evidence.zip (password: infected), 41 cumulative dNN members d01..d29
  • Day-29 payload: a PAIR of ELF x86-64 binaries built from the same source at different optimization levels
    • d29--sample-O0.elf (challenge artifact, not published) 43931 bytes (unoptimized build)
    • d29--sample-O3.elf (challenge artifact, not published) 43931 bytes (optimized build)
  • Both members are ELF64, little-endian, e_machine=62 (x86-64), carry one CRC-valid HCFG record at file offset 43544 (xor key 0xE1, version 1). Decoded config is identical in both:
    • campaign: BR29-000
    • domain: variant-000.day29.example.invalid
    • ipv4: 198.51.100.90
    • url: https://variant-000.day29.example.invalid/v/BR29-000
    • mutex: Global\HuntressBR29-000_000
    • (plus windows_path, linux_path, service, host_model fields)

What was new

The pair is a NEW member-tag family the shared autosolve_binary.py had not seen: the two binaries carry compiler-optimization-level tags in their filenames (-O0 / -O3), while the GM asks the pair-selector questions under the SEMANTIC member tags unoptimized / optimized. The existing _variant_tags() helper derived the tags straight from the filename (o0 / o3), so every d29_analysis_optimized_* and d29_analysis_unoptimized_* id went unresolved.

Residue (SS first touch, 398/406 accepted):

d29_analysis_optimized_config_campaign
d29_analysis_optimized_config_domain
d29_analysis_optimized_config_mutex
d29_analysis_optimized_config_url
d29_analysis_optimized_format
d29_analysis_optimized_machine
d29_analysis_unoptimized_format
d29_analysis_unoptimized_machine

Fix in the per-CID solver clone

Only this challenge's own solver copy was patched; shared lane kits were left untouched. challenges/Day 29/⚙️ Fraternal Twins/scripts/binary_wip.py

  1. _variant_tags() now additionally emits the semantic aliases "unoptimized" for a member whose filename matches [-_]O0(?:[-_.]|$) and "optimized" for a member whose filename matches [-_]O([123s]|fast)(?:[-_.]|$). Both are registered only when the dNN actually contains such a named member, so no other day picks them up by accident. The existing o0 / o3 tags from the normalised filename are kept, so questions that happened to ask under those names still work.
  2. The clone registers itself under sys.modules["autosolve_binary"] at load time. The runner's own _load_adapter already loads the clone as solver_copy_binary_reverse_engineering, but prebrief's release_scan imports autosolve_binary by name, so without the sys.modules binding the clone's new aliases are invisible to the prebrief gate and the gate HELDs on fields the clone itself can answer. The binding is additive and scoped to the runner's own process; nothing else is modified.

Mode prediction journal

After the clone patch, filled binary-reverse-engineering-day-29-variant-diffing.mode_prediction.json:

  • covered_answer_ids: all 406 TT ids and all 5278 MM ids
  • predicted_transform: cumulative evidence.zip with a new dNN member each day; every answer_id of the form [setN.]dNN_<suffix>, routed by binary_wip.answer through typed facts and HCFG decoders; d29 pair fields pick the member by the new optimization-level aliases.
  • predicted_item_shape: enumerated per suffix family (artifact_sha256_K, analysis_*, config_* under the decoded HCFG, pair tag routing).
  • evidence: SS artifact sha256, solver copy sha256, dry-run coverage check (406/406 TT + 5278/5278 MM), decoded d29 HCFG config facts.
  • Dry run before any timed start proved both compute(start, [single_bytes]) calls returned without Unknown/Hold for every expected id.

Timeline

  • 09:00 SS first touch — HELD, 398 accepted, 8-id residue above
  • 09:02 Clone _variant_tags patched; SS CORRECT in 6.8 s (flag above)
  • 09:22 Prediction journal filled with full coverage, rerun
  • 09:32 TT prebrief HELD because prebrief/release_scan imported the shared autosolve_binary (not the clone)
  • Clone registers itself under sys.modules["autosolve_binary"], rerun
  • TT CORRECT in 183.1 s (ranked), MM CORRECT in 228.4 s on real timed bytes (5278/5278 sure, 0 probe)

Reuseable lesson

A per-CID solver clone's patches are only visible to code that goes through the runner's _load_adapter path. Prebrief, release_scan and anything else that calls importlib.import_module("autosolve_binary") sees the shared adapter unless the clone pins itself under that name in sys.modules at load time. For additive patches that need the prebrief gate to pass, the one-line sys.modules["autosolve_binary"] = sys.modules[__name__] at the top of the clone (after its own imports) is enough; it is scoped to the runner's process and leaves the shared file untouched.

For the pair-member tag family: future day-pairs that carry structural tags in their filenames (gcc/tcc, family-a/family-b, symbolized/stripped, direct/compact, O0/O3) can keep working the same way as long as _variant_tags() can derive the tag the GM asks under. When the GM asks under a SEMANTIC tag the filename does not literally spell (optimized/unoptimized vs -O3/-O0), add a bounded alias in _variant_tags() keyed to the actual filename substring; keep both the raw and the semantic tag so a future question in either naming still routes.