script: 31 days of two bash features and a polyglot

the script lane handed over a growing set of script specimens, each hiding a descriptor whose values are the answers. it was cumulative: every earlier specimen came back, so the field count grew every day. the first week added a language a day; from day 8 a day added a polyglot language behind an analysis header and, on most days to day 20, two bash features; day 23 layered the header. the solver became one specimen reader that finds the descriptor in any carrier under any header codec.

  • 31challengesone a day, days 1 to 31
  • 93flagssingle, time trial and mastery
  • 4.1 smedian singletime trial 6.9 s, mastery 12.5 s; release to flag
  • 74%flags by autopilot69 of 93
  • 99inventory items69 graded, 30 not yet graded
  • 23 of 27covered at releasedays 5 to 31; 3 partial, 1 cold start
script: release to the single's flag, per day
0:002:305:007:3010:00day 1: 2h45m, unattributed (off the scale)1day 2: 12:35, helper (off the scale)day 3: 7:18, parent3day 4: 3:27, helperday 5: 3:29, helper5day 6: 1:27, parentday 7: 2:25, parent7day 8: 2:07, helperday 9: 0:05, autopilot9day 10: 0:05, autopilotday 11: 0:02, autopilot11day 12: 0:03, autopilotday 13: 0:03, autopilot13day 14: 0:04, autopilotday 15: 0:03, autopilot15day 16: 0:05, autopilotday 17: 0:03, autopilot17day 18: 0:03, autopilotday 19: 0:05, autopilot19day 20: 0:02, autopilotday 21: 0:02, autopilot21day 22: 0:04, autopilotday 23: 0:03, autopilot23day 24: 0:04, autopilotday 25: 0:04, autopilot25day 26: 0:03, autopilotday 27: 0:04, autopilot27day 28: 0:04, autopilotday 29: 0:04, autopilot29day 30: 0:04, autopilotday 31: 0:03, autopilot31
  • autopilot
  • helper
  • parent
  • other

the scale stops at ten minutes; a dashed bar is a day beyond it (hover for the time). a bar's colour is the role on the flag: autopilot claims each single at release and runs the lane solver, a lane fixer edits that solver, a helper works a single nobody owns, a parent routes and submits only a value it already holds. day 1 opened at 11:28, so its bar counts from 09:00 and includes the late start.

how the family evolved

every specimen hides a descriptor, v=N|steps=…|adapter=…|…, and the fields are its values; a role and an attack technique follow from the steps. the challenge is cumulative: every earlier specimen comes back, so the single grew from 15 fields on day 1 to 1846 on day 31.

days 1 to 7, a language a day. powershell in three lanes, resource, collection and impact (power play); jscript (host with the most); batch rebuilt without running it (expansion pack); vbscript that names its own codec (dim and dimmer); python (hatch careful); bash (shell we begin); node.js and the first two bash advanced features (node by node).

days 8 and 9, hosts and the first polyglots. php polyglots and script hosts (hta, wsf, a php webshell) behind an analysis header whose descriptor states every answer (lost in translation); lua under openresty and an sct scriptlet, with a stage graph built from descriptor claims (all the world's a stager).

days 10 to 22, a polyglot language a day. wmi mof (bind over matter), typescript (by any other name), autoit (autoit takes two), applescript (zip code), an msbuild project (trust the process), perl (crumb trail), ruby (same same, but different), autohotkey (fetch quest), google apps script (orphan process), a c# script inside an aspx page (sharp practice), groovy in a jenkins pipeline (the butler did it), a github actions workflow (actions speak louder) and an nsis script (next, next, finish). the bash advanced specimens added a pair of features on days 7, 8, 9, 10, 11, 13, 14, 16 and 20.

day 23, a layered header. the analysis header became LYR-<layers>-<payload> with its layers in encode order, every tag became the specimen's random hex stem, and some answers became composites of several descriptor keys (press start to decode).

days 24 to 31, more carriers. a jsp webshell (web of lies), elixir under phoenix (ashes to assets), an erlang escript (mixed signals), a dockerfile (from whence it came), terraform (out of order), a makefile (make it make sense), beanshell inside a jsp string literal (spill the beans) and an xslt stylesheet that never has to run (the full transform). from day 9 autopilot took every script single at release, the slowest in 5.3 s.

what each day's single added, read from its field ids:

day new language or carrier new bash features single fields post
1 powershell: collection, impact, resource - 15 power play
2 jscript - 87 host with the most
3 batch - 159 expansion pack
4 vbscript - 231 dim and dimmer
5 python - 357 hatch careful
6 bash - 399 shell we begin
7 nodejs indirect_expansion, token_fragmentation 469 node by node
8 host-hta-jscript, host-php-webshell, host-wsf-jscript, host-wsf-mixed, polyglot-php array_slicing, associative_arrays 615 lost in translation
9 host-lua-openresty, host-sct-scriptlet, polyglot-lua recursive_walk, trap_handler 695 all the world's a stager
10 polyglot-wmi_mof here_string, heredoc_reconstruction 753 bind over matter
11 polyglot-typescript dynamic_file_descriptor, nameref_dispatch 811 by any other name
12 polyglot-autoit - 855 autoit takes two
13 polyglot-applescript process_substitution, subshell_pipeline 913 zip code
14 polyglot-msbuild_xml brace_expansion, getopts_state 971 trust the process
15 host-perl-cgi, polyglot-perl - 1026 crumb trail
16 host-ruby-rack, polyglot-ruby ansi_c_quoting, regex_conditional 1095 same same, but different
17 polyglot-auto_hotkey - 1139 fetch quest
18 host-google-docs, polyglot-google_apps_script - 1194 orphan process
19 host-aspx-inline, polyglot-csharp_script - 1249 sharp practice
20 host-classic-asp, host-jenkins-pipeline, polyglot-groovy coprocess_block, mapfile_process 1329 the butler did it
21 polyglot-github_actions - 1373 actions speak louder
22 polyglot-nsis - 1417 next, next, finish
23 polyglot-gdscript - 1461 press start to decode
24 host-jsp-webshell, polyglot-jsp - 1516 web of lies
25 host-elixir-phoenix, polyglot-elixir - 1571 ashes to assets
26 polyglot-erlang - 1615 mixed signals
27 polyglot-dockerfile - 1659 from whence it came
28 polyglot-terraform_hcl - 1703 out of order
29 polyglot-makefile - 1747 make it make sense
30 host-jsp-beanshell, polyglot-beanshell - 1802 spill the beans
31 polyglot-xslt - 1846 the full transform

coverage

this lane's row of the coverage grid. autopilot answered 23 of the 27 singles from day 5 on with no gaps row; the table lists the rest. closed in runs from autopilot's gaps row to the single's flag.

script: the single at release, by day
12345678910111213141516171819202122232425262728293031scriptday 1: no release pass, single at 2h45m (unattributed). no release pass yet: autopilot's first release pass was day 5day 2: no release pass, single at 12:35 (helper). no release pass yet: autopilot's first release pass was day 5day 3: no release pass, single at 7:18 (parent). no release pass yet: autopilot's first release pass was day 5day 4: no release pass, single at 3:27 (helper). no release pass yet: autopilot's first release pass was day 5 (on day 4 it first ran at 11:44:40, after the singles)day 5: cold start, single at 3:29 (helper). 126 fields in 10 families (python): ValueError: no Material_ const in vbscript; ValueError: vbscript material does not decodeday 6: partial, single at 1:27 (parent). 369 fields in 58 families (bash, batch, collection, impact, jscript, python, …): no crash; 5 solver answers rejected, e.g. decode_configuration,return_configurati…day 7: partial, single at 2:25 (parent). 255 fields in 32 families (bash, nodejs, python, resource, vbscript): a KeyError on persistence-adapter, persistence-attack, persistence-campaignday 8: partial, single at 2:07 (helper). 313 fields in 28 families (host, polyglot, python, resource, vbscript): no answer for host-php-webshell-php-obfuscation, polyglot-php-benign-utility-obfuscation, polyglot-php-launcher-obfuscationday 9: covered, single at 0:05 (autopilot). nothing: autopilot answered every field at releaseday 10: covered, single at 0:05 (autopilot). nothing: autopilot answered every field at releaseday 11: covered, single at 0:02 (autopilot). nothing: autopilot answered every field at releaseday 12: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 13: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 14: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 15: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 16: covered, single at 0:05 (autopilot). nothing: autopilot answered every field at releaseday 17: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 18: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 19: covered, single at 0:05 (autopilot). nothing: autopilot answered every field at releaseday 20: covered, single at 0:02 (autopilot). nothing: autopilot answered every field at releaseday 21: covered, single at 0:02 (autopilot). nothing: autopilot answered every field at releaseday 22: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 23: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 24: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 25: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 26: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at releaseday 27: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 28: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 29: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 30: covered, single at 0:04 (autopilot). nothing: autopilot answered every field at releaseday 31: covered, single at 0:03 (autopilot). nothing: autopilot answered every field at release
  • covered at release
  • partial, under 3 min
  • cold start, 3 to 15 min
  • long, over 15 min
  • no release pass or unknown

hover a cell for the time, the role on the flag and what was missing. grey on days 1 to 4: the release pass started on day 5.

day at release what was missing closed in
5 cold start 126 fields in 10 families (python): ValueError: no Material_ const in vbscript; ValueError: vbscript material does not decode 3:27, helper
6 partial 369 fields in 58 families (bash, batch, collection, impact, jscript, python, …): no crash; 5 solver answers rejected, e.g. decode_configuration,return_configurati… 1:10, parent
7 partial 255 fields in 32 families (bash, nodejs, python, resource, vbscript): a KeyError on persistence-adapter, persistence-attack, persistence-campaign 2:02, parent
8 partial 313 fields in 28 families (host, polyglot, python, resource, vbscript): no answer for host-php-webshell-php-obfuscation, polyglot-php-benign-utility-obfuscation, polyglot-php-launcher-obfuscation 1:48, helper

the tooling that grew for it

the lane's tool page, static script analysis across powershell, jscript, and batch, opens with what the solver did by day 3 and adds a section for every day its code changed:

every post, in order

times run from the 09:00 et release to each tier's flag; day 1 opened at 11:28 and counts from 09:00.

day post single time trial mastery
1 power play 2h45m 2h55m 2h59m
2 host with the most 12:35 13:46 14:46
3 expansion pack 7:18 8:22 14:26
4 dim and dimmer 3:27 9:04 11:06
5 hatch careful 3:29 3:32 3:35
6 shell we begin 1:27 1:31 1:34
7 node by node 2:25 2:28 4:44
8 lost in translation 2:07 8:23 8:28
9 all the world's a stager 0:05 0:08 0:12
10 bind over matter 0:05 0:07 0:09
11 by any other name 0:02 0:05 0:08
12 autoit takes two 0:03 0:05 0:08
13 zip code 0:03 0:06 0:09
14 trust the process 0:04 0:06 0:10
15 crumb trail 0:03 0:07 0:12
16 same same, but different 0:05 0:10 0:21
17 fetch quest 0:03 0:07 0:12
18 orphan process 0:03 0:07 0:12
19 sharp practice 0:05 0:08 0:12
20 the butler did it 0:02 0:04 0:08
21 actions speak louder 0:02 0:06 0:09
22 next, next, finish 0:04 0:07 0:12
23 press start to decode 0:03 6:41 8:58
24 web of lies 0:04 0:07 0:12
25 ashes to assets 0:04 0:07 0:12
26 mixed signals 0:03 0:06 0:12
27 from whence it came 0:04 0:06 0:12
28 out of order 0:04 0:08 0:15
29 make it make sense 0:04 0:08 0:15
30 spill the beans 0:04 0:08 0:16
31 the full transform 0:03 0:06 0:13

{generated by a clanker}