Hatch Careful (Day 05, script-analysis) - WRITEUP
Lane: script-analysis | Family: script_inventory | Agent: agent-5 GM id: script-analysis-day-05-python-carrier-lab
Flags
- single_solve:
<REDACTED_TOKEN> - time_trial:
<REDACTED_TOKEN> - mastery:
<REDACTED_TOKEN>
What it is
Same multi-field static-triage inventory as Day01/02/03 (script_inventory) plus the Day04 VBScript layer, with a NEW Python-carrier layer. One AES zip (pw infected) of 45 inert fixtures across 6 languages: 4 .ps1, 9 .js, 5 .cmd, 4 .bat, 9 .vbs, 14 .py. 357 per-field questions (single/time_trial); mastery = 2 re-randomized sets (set1./set2., evidence-01.zip (challenge artifact, not published)/evidence-02.zip (challenge artifact, not published)) = 714 fields. One .ps1 (invoke-python-stage.ps1) is a helper with no questions - skip it.
Per-file question shapes:
- ps1 (3 scored): scenario(enum) / attack / url / wallet|file|user-agent / mutex|note|extension
- js (9): role(enum) / attack / adapter / campaign / indicator / function-style / invocation-style / property-style
- cmd+bat (9): role / attack / adapter / campaign / indicator / expansion / control / graph
- vbs (9): role / attack / adapter / campaign / indicator / representation / transform / control
- py (14, 9 fields each): role / attack / adapter / campaign / indicator / syntax / obfuscation / carrier / windows-chain
Peeling the carriers (the new layer)
Each *-recovered.py / source-context.py is INERT: imports only base64/io/os, has no sinks (the "reflective_name_plan"/"import" tokens are string literals in data tuples, not calls), and its only module-level code is a HUNTRESS_INSPECT_ONLY-guarded print. It carries:
MATERIAL_<h>: encoded descriptor bytesCODEC_<h>:"representation|transform|key"recipe (documentation)- pure
load/decode/recover/inspect_<h>(): decode descriptor textv=2|k=v|... surface_<h>(): 4-tuple(syntax, obfuscation, carrier, windows_chain)obfuscation_<h>(),plan_<h>(): operation-plan tuple (first elt = behavior verb)
The carrier "disguise" only varies HOW surface/obfuscation are computed (literal tuple, chr() join, format_map, reversed slice, string table, match/case) and HOW MATERIAL is encoded - the decoded descriptor always has the same keys. So the safe move is to exec the module in a throwaway namespace (guard never fires) and call only the pure inspect_<h>(), giving the descriptor kv directly. Every answer is then a dict lookup: adapter, campaign_id, syntax, obfuscation, carrier, windows_chain, and the indicator (host_id/file_path/url/upload_url/next_stage/extension/handoff_id).
role / attack for Python
role from the steps signature (extends the family map):
decode_configuration,return_configuration-> benign_utilitylocate_local,dispatch_process-> launcherdecode_embedded,write_file-> dropperacquire_remote,dispatch_memory-> stageracquire_remote,write_file-> downloadercollect_local,encode_archive,transmit_remote-> uploaderselect_fixture_files,transform_copy,write_recovery_note-> impactdecode_configuration,locate_interpreter,dispatch_next_stage-> relayprofile_host,acquire_remote,decode_embedded,write_file,dispatch_process-> staged_chain
NOTE: the py question enum includes BOTH relay and staged_chain, so they are distinct roles here. For js/bat/vbs the enum stops at staged_chain, so their relay-handoff.* fixtures still classify as staged_chain (unchanged from Day03/04).
attack: benign->none, stager/downloader->T1105, dropper->T1140, uploader->T1041, impact->T1486; launcher/relay/staged_chain fall to the language interpreter technique = T1059.006 (Python) (js=T1059.007, bat=T1059.003, vbs=T1059.005, per earlier days).
Other languages
Reused _lib/solve_script_inventory.py (ps1 base64->JSON keys a-h; js inspect_() run in node with eval->JSON.parse + ActiveX blocked; cmd/bat MATERIAL/fragment decode + bctl control + expform expansion) and _lib/decode_vbs.py + solve_dim_dimmer.vbs_ctl (representation/transform/control). All label forms were confirmed on the untimed single.
Solver
scripts/solve_hatch.py - one automated run per mode: start -> download -> extract -> analyze (6 languages) -> build 357/714 answers -> single batch submit. Handles mastery's multi-set layout (one zip per setN, strip setN. prefix for field parsing). Includes a coverage guard that refuses to submit unless 100% of fields resolve (avoids burning a timed attempt on a flaky/empty download).
Single Solve was the lab: full batch returned CORRECT first try (357/357), confirming the entire taxonomy (roles, attack ids, all form labels) before any timed shot. time_trial and mastery each solved in one automated batch.