trust issues: anti-analysis predicates, static answers, and a two-digit key

huntress ctf 2026, day 23 · binary · all three modes

tools used: binary-analysis toolkit and timed-attempt pipeline.

"this binary doesn't trust you. it checks the clock, sniffs the environment, and takes different branches when it thinks it's being watched. spot every predicate and force the truth out." the day's new member was a managed .net assembly written in visual basic, whose code checks for a debugger, times itself and reads the environment before it prints a trace line.

the key insight: the story is dynamic, the questions are not. every graded field of the new tag is a header, metadata or configuration value read from the file's bytes, so the predicates never have to run. the one field we lost was a formatting rule the question stated in its own words.

challenge shape

single        276 fields   23 tags (d01..d23); the new d23 tag: two member
                           hashes, format, machine, metadata version and
                           the hcfg configuration record
time trial    276 fields   the same over a fresh bundle
mastery      1932 fields   the same over seven bundles

artifact anatomy

the d23 members are a dll and its .runtimeconfig.json (a .net 8 framework reference). the dll is a pe with a cli header and a metadata root; its strings and member references show the predicates: the Debugger class, a Stopwatch read through its elapsed ticks, an environment variable lookup and the processor count, feeding an analysis_detected flag in a trace record of schema, branch, event count, campaign, family, effects and network. another string marks the predicates as inert: they are a model to recognize, not a payload.

the configuration is the event's hcfg record, found by scanning for its magic and accepted only when every check passes:

offset  size  field
0       4     "HCFG"
4       1     version
5       1     xor key
6       2     payload length, little-endian
8       4     crc-32 of the decoded payload, little-endian
12      n     payload: json, each byte xored with the key

extraction method

nothing new: the binary toolkit classifies the member as a pe with a valid cli header and metadata root (the format enum's managed token, pe_cli), reads the machine field (graded i386), reads the metadata version string at the metadata root plus 16 using its declared length (graded v4.0.30319, the same as day 22's module), and decodes the hcfg record (bounds, crc-32 over the xor-decoded payload, json). every question names the member as day 22's did: "the unique d23-- primary managed assembly whose basename starts d23-- and ends .dll". the anti-analysis code is never executed or emulated.

validation and answer formatting

the xor key question said: "render header byte 5 as 0x plus exactly two lowercase hexadecimal digits." (the crc-32 question, likewise: "0x plus exactly eight lowercase hexadecimal digits".) its answer syntax said only "lowercase hexadecimal with a 0x prefix; preserve the field's required zero padding", the same syntax the crc-32 field carries. our formatter read the syntax, which names no width, and wrote the key without zero padding: it went out as 0x plus the bare digits and was rejected. the width was in the question text. the formatter (answerfmt.for_question) now reads a stated digit count from the syntax, and from the question when the syntax is about hex but names none, and the runner zero-pads to it, never truncating:

WIDTH = re.compile(                            # answerfmt.WIDTH
    rf"\b(?:exactly|exact|followed\s+by|plus)\s+{_NUM}\s+{_CASE}{_HEX}\s+{_UNIT}\b"
    rf"|\b(?:zero[\s-]?)?padded\s+to\s+{_NUM}\s+(?:{_HEX}\s+)?{_UNIT}\b"
    rf"|\b{_NUM}\s+{_HEX}\s+{_UNIT}\b"
    rf"|\b{_NUM}-(?:digit|character|char)\s+{_CASE}{_HEX}\b"
)

def _hex_padded(v, width):                     # runner._hex_padded
    cut = 2 if v.lower().startswith("0x") else 0
    return v[:cut] + v[cut:].rjust(width, "0")

a count that only describes a value ("16 uppercase hexadecimal characters" with a case word between) is not a width; two different stated widths make the field uncertain, and each form is tried.

failed approaches and pivots

none in the analysis. the time trial's one rejected field was the formatting above.

automation across modes

the compound producers answer all 23 tags in every bundle; the mastery's seven bundles of the same field families were solved in under 0.2 seconds once downloaded.

lessons

solve times

public scoreboard · day 23 finish: 1st

  • 0:05.0singlefirst blood, +1.5 s
  • 1:18.2time trial#20 of 157 solvers
  • 1:25.6mastery#11 of 155 solvers
  • #1team day finishof 140 teams that cleared it, in 8:58.5
  • #4single orderof the day's 8, 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 the mode's first start on the game master to its correct submit.

mode work to flag attempts wrong submits
single 3.7s 1 0
time trial 71.6s 1 11
mastery 5.8s 1 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 80.0s 71.6s 8.4s
mastery 465.0s 5.8s 459.2s

the time trial's corrected answer went in on the same attempt as the rejected one (our solver re-solved the attempt's saved bytes and sent only the missing field), so its clock started with the first run and the game master counts one attempt. the 11 wrong submits are that attempt's rejected submits while our runner narrowed the failure down to the one field.

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}