Flare-On 13
Solver: Claude (omp), competing against Astra.
Platform: https://flare-on13.ctfd.io (CTFd). Archive password for every challenge: flare.
Timing
Times are local (CDT) and come from timeline.jsonl; py ctf.py log regenerates the table.
- Start: when the challenge was downloaded (
fetch). For #1 it's when the archive was handed over. - Flag found: when the flag was first computed.
- Submitted: when CTFd accepted the flag.
- Duration: start → flag found.
| # | Challenge | Start | Flag found | Submitted | Duration |
|---|---|---|---|---|---|
| 1 | FLAreCAPTCHA | 18:51:05 | 18:51:34 | 19:07:56 | 0h00m29s |
| 2 | GhostStream | 19:07:57 | 19:12:37 | 19:12:38 | 0h04m40s |
| 3 | FlareOn13.doc | 19:12:40 | 19:18:10 | 19:18:11 | 0h05m30s |
| 4 | ToxicMiner | 19:18:12 | 19:28:46 | 19:28:47 | 0h10m34s |
| 5 | catthief | 19:28:48 | 19:32:24 | 19:32:25 | 0h03m36s |
| 6 | Threat Invaders | 19:32:28 | 19:39:28 | 19:39:29 | 0h07m00s |
| 7 | FlareCalc | 19:39:31 | 20:29:43 | 20:29:44 | 0h50m12s |
| 8 | crux | 20:29:45 | 21:11:21 | 21:11:22 | 0h41m36s |
| 9 | NeonOutRun | 21:11:24 | 21:34:21 | 21:45:02 | 0h22m57s |
Tooling
ctf.py is a CTFd API client that authenticates with an access token stored in .ctfd.json.
| Command | Action |
|---|---|
py ctf.py list |
show challenges and whether each is open, locked or solved |
py ctf.py fetch [ID\|all] |
download challenge files and extract them into NN-Name/files/; also saves description.html |
py ctf.py submit ID FLAG |
submit the flag; on correct, download the challenges it unlocks |
py ctf.py found ID FLAG |
record a flag with a timestamp without submitting it |
py ctf.py log |
print the event timeline and per-challenge durations |
Each challenge directory is self-contained:
NN-Name/
<archive>.7z original download
description.html CTFd challenge text
files/ extracted challenge contents (untouched)
work/ scratch: dumps, decompiled output, intermediate data
solve.py reproduces the flag from files/
flag.txt recovered flag
01FLAreCAPTCHA#
A fake reCAPTCHA whose flag falls out of a right-click held for two seconds.
Files: 1-flarecaptcha.7z → flarecaptcha.html (16,048 bytes)
Flag: triskaidekaphobia@flare-on.com
Time: 29 s
Overview
A single HTML page imitates a Google reCAPTCHA v2 "I'm not a robot" checkbox. All of the logic is in one inline <script>. Nothing is sent to a server, so the flag can be computed from the page source.
Step 1 - Extract
7z x -pflare 1-flarecaptcha.7z -> flarecaptcha.html
Step 2 - Find the success path
The mousedown handler on #rc-interactive-area has two branches:
| Condition | Result |
|---|---|
e.button === 0 (left click) |
spinner for 1 s, then triggerFailure() shows "Robot, or unskilled reverse engineer detected." |
e.button === (Math.pow(5, 0) + Math.pow(1, 1)) = 1 + 1 = 2 (right click) |
starts a 2000 ms timer (rightClickHoldTimer) that builds and displays the flag |
cancelHold() runs on mouseup of button 2 and on mouseleave, and it fails the attempt if the timer is still pending. To pass in a browser, you right-click the checkbox and hold it for at least 2 seconds. The native context menu is suppressed with contextmenu → preventDefault.
Step 3 - Reconstruct the flag computation
Ciphertext (30 bytes):
const recaptchaLogoBitmap = [123, 5, 102, 4, 100, 22, 102, 19, 106, 28, 110, 7, 103, 24, 109, 30,
110, 55, 105, 27, 110, 5, 106, 90, 96, 25, 33, 20, 96, 26];
Layer 1 - Proxy. Reads go through a Proxy whose get trap XORs every numeric index with document.characterSet.length. The page declares <meta charset="UTF-8">, so "UTF-8".length = 5.
Layer 2 - Time-derived 16-bit key. Inside the timer callback:
displayPaddingPx = Math.round((Date.now() - errorLogStartTime) / 1000); // = 2 (2000 ms timer)
widgetLength = resetWidget.toString().length; // = 222
widgetUpperBoundsPx = (displayPaddingPx * (widgetLength + 1115)) & 0xFFFF; // 2 * 1337 = 2674 = 0x0A72
wupperLeft = (widgetUpperBoundsPx >> 8) & 0xFF; // 0x0A
wupperRight = widgetUpperBoundsPx & 0xFF; // 0x72
flag[i] = bitmap[i] ^ 5 ^ (i even ? 0x0A : 0x72)
resetWidget.toString() returns the exact source text of the arrow function, from () => { to the closing }. The file uses CRLF line endings. The browser's HTML parser converts them to LF before the script runs, so the length must be measured on the LF-normalised text: 222 characters, which makes 222 + 1115 = 1337. With CRLF counted, the key is wrong.
Step 4 - Decrypt
01-FLAreCAPTCHA/solve.py pulls the bitmap and the resetWidget source out of the HTML and applies both XOR layers:
> py 01-FLAreCAPTCHA/solve.py
resetWidget.toString().length = 222, key = 0x0a72
triskaidekaphobia@flare-on.com
Independent check: trying all 65,536 (wupperLeft, wupperRight) pairs for a plaintext ending in @flare-on.com gives exactly one match, (10, 114) = (0x0A, 0x72). That confirms the derived key.
Takeaways
- The success path needs a right-click (
button === 2) held for 2 s. The obvious left-click always fails. - Two XOR layers: a constant taken from the environment (
characterSet.length) and a key built from the hold time and the length of the function's own source. - Function length depends on the source text exactly as the browser sees it, so line-ending normalisation matters.
02GhostStream#
An NTFS alternate data stream, unmasked inside a window procedure, keys an RC4 blob in a dropped partner binary.
Flag: y0u_kn0w_n07h1n6_j0n_5n0w@flare-on.com
Reproduce: python 02-GhostStream/work/solve.py (derives the flag straight from files/GhostStream.wim)
A WIM image holding GhostStream.exe plus a decoy PolyjuicePotion.txt. The exe reads a hidden NTFS alternate data stream, unmasks it inside a window procedure, and pipes the result to a second binary carried in its resource section, which uses it as an RC4 key.
-
Find the hidden stream.
7z l -slt -sns files/GhostStream.wimreports1 alternate streams:GhostStream\PolyjuicePotion.txt:LordVoldemort, 18 bytes.7z x -snsextracts it:AlbusDumbledore \r\n. The visiblePolyjuicePotion.txtis only a hint ("the transformation effect is now stuck for exactly 7 days"). -
String obfuscation (
sub_140001130). Every API name is decoded at runtime with a key derived from the own filename:k = name[0] ^ name[strlen/2], i.e.'G' ^ 'r' = 0x35forGhostStream.exe. The byte-sum of the ciphertext (mod 256) picks the transform — sum ∈ {0x1C,0xE5} →c-k; {0x53,0x60,0x6A,0x74,0x7B} →k ^ (c+1); {0x24,0x62,0xE1} →k+c-2. DecodesNtSetInformationThread,RegisterClassExA,CreateWindowExA,GetProcessTimes,GetSystemTimeAsFileTime,CreateNamedPipeA,ConnectNamedPipe,\\.\pipe\FlareChallenge, and the 35-byte blob%sPolyjuicePotion.txt:LordVoldemort. -
Two dead ends and one anti-debug. A thread listens on
127.0.0.1:31337forOVERRIDE:(its buffer is overwritten by the laterReadFile),sub_140001860builds aTelemetry_%u_%xstring fromGetSystemInfo/GlobalMemoryStatusEx, andNtSetInformationThread(-2, ThreadHideFromDebugger=17)is called on the main thread. -
Switch the input to the ADS. The
%sPolyjuicePotion.txt:LordVoldemortpath is only formatted whendword_140006668 == 1. That global has exactly one xref in.text—cmp dword ptr [rip+0x4BD5], 1at0x140001A8C— and is never written, so it is zero and the program reads the plain.txt. Force it to 1 to pointCreateFileAat the stream. -
The 7-day gate.
sub_140001680computesqword_140006670 = (GetSystemTimeAsFileTime - GetProcessTimes.lpCreationTime) / 0x23C34600— 600 000 000 × 100 ns = 60 s, so the value is elapsed minutes.maincomputes the threshold671 * strlen("GhostStream.exe") + 15 = 671*15+15 = 10080= exactly 7 days in minutes. -
Unmask inside the window procedure.
mainregisters class"x"and callsCreateWindowExAwith a struct{ file_buffer, &decoy16, elapsed_minutes, 10080, last_msg }.sub_140001B20stores it onWM_NCCREATE(0x81) viaGWLP_USERDATA, then onWM_CREATE(0x01): *elapsed <= 10080→ decoy branch: XOR a 16-byte blob at0x140004680andSetEnvironmentVariableA("SESSION_TOKEN_CACHE", ...); the buffer is left alone,mainseeslen<=20 && buf[0]=='A'and prints "The Polyjuice Potion is still effective". *elapsed > 10080→ real branch: XOR the whole buffer withprev_msg ^ WM_CREATE, then XOR the first 15 bytes with8B 8F 92 85 88 96 98 9B 94 8B 95 E6 ED F0 E7.
The message delivered immediately before WM_CREATE is WM_NCCALCSIZE (0x83), so the first XOR byte is 0x83 ^ 0x01 = 0x82. AlbusDumbledore \r\n → HarryPotter (bytes 11–14 cancel to NUL, so strlen = 11).
-
Hand-off.
maincreates\\.\pipe\FlareChallenge,sub_140001400writes resourceBIN/101(14848 bytes, SHA-2564df12c144f031e324e2f53ccfe38ade3460913aefaa2f785d072549300218af3) to%TEMP%\Partner_CTF.exeand launches it, thenWriteFilesHarryPotterdown the pipe. -
Partner_CTF.exe: self-modifying
strlen. It reads the pipe (truncated atstrcspn(buf,"\r\n")), runs a textbook RC4 key schedule with that key over an identity S-box (SIMD init fromxmmword_140003420 = {0,1,2,3}masked with0xFF), thenVirtualProtect(ucrtbase!strlen, 0x17, PAGE_EXECUTE_READWRITE)and overwrites the function with a 23-byte stub:31 C0 xor eax,eax 04 13 add al,0x13 B2 01 mov dl,1 75 01 jnz +1 ; jumps over the following E8 E8 (skipped) 00 11 add [rcx],dl 30 01 xor [rcx],al FE C2 inc dl 48 FF C1 inc rcx 38 21 cmp [rcx],ah 75 F3 jnz -13 C3 ret
i.e. b[i] = ((b[i] + i + 1) & 0xFF) ^ 0x13 in place, returning a hard-coded 19. It is called on the global at 0x140005078, turning Bxs]bv\^u)TpcnolVjNintoPiertotum Locomotor, then on the localWingardium Leviosa, then the originalstrlenbytes are restored. (GetEnvironmentVariableA("COMPUTERNAME"),lstrlenA,IsDebuggerPresent,GetTickCount` are called and discarded.)
-
Final decryption. 38 ciphertext bytes
965C8735D77A398B75046D28BB5658C835EEDAE1A456A937811556F9270A340DEE822C26A5F8are decrypted with a modified RC4 PRGA whose index advances byKinstead of 1:i = (i + K) % 256 ; j = (j + S[i]) % 256 ; swap(S[i], S[j]) plain[n] = ((cipher[n] + K) & 0xFF) ^ "Piertotum Locomotor"[n % 19] ^ S[(S[i]+S[j]) & 0xFF]
K is the return value of that second strlen call. The stub returns 19, which is wrong — the ciphertext was built with the real strlen("Wingardium Leviosa") = 18, so the binary as shipped always prints [FAILED] Try again with better debugging. Forcing the return value to 18 (patch EAX/R12 after the call) makes it print the flag; the same constants reproduce it offline.
03FlareOn13.doc#
A five-way polyglot hiding six treasure strings in six file formats, checked by a fat Mach-O.
Flag: Ju$7_4_l177l3_7r34$ur3_HUN7@flare-on.com
Reproduce: python 03-FlareOn13.doc/work/click_me_analysis/solve.py
flareon13.doc (1,855,887 bytes) is not a Word document at all but a five-way polyglot — DOS COM / PDF / raw CD image (UDF) / ZIP / VHD — that hides six "treasure" strings in six different file formats; a Mach-O universal binary on the UDF volume MD5-checks all six and RC4-decrypts the flag with them.
-
Map the polyglot. No OLE2/
D0CF11E0header. Bytes0..131are 16-bit x86 ending in$(DOSINT 21h/AH=09hterminator);%PDF-1.7starts at offset 132; a ZIP local header sits at 1,855,039; the last 512 bytes are a fixed-disk VHD footer (conectix, creatorvpc/Wi2k, disk-idFLAREONPOLYGLOT!) parked in the ZIP end-of-central-directory comment. The PDF trailer is/ID [<466c6172654f6e506f6c79676c6f7431>]=FlareOnPolyglot1. -
Piece 1 — DOS COM stub. The 132-byte prologue is real 16-bit code loaded at
0x100. It setsBX=0x2020^0x2160=0x0140, then XORs 5 bytes at0x160..0x164with03 05 02 13 17, turning the on-disk literalEICARintoFLARE; twosub word ptr [bx], siwithSI=0x097Brewrite the stored words0x2B48/0x2A48at0x15C/0x15EintoCD 21(int 21h) andCD 20(int 20h).AX=0x2020^0x295B=0x095B(AH=9) andDX=0x160, so it printsFLARE-STANDARD-ANTIVIRUS-TEST-FILE!. -
Piece 2 — encrypted PDF, invisible EBCDIC text. Object 9 is
/Filter /Standard /V 1 /R 2 /P -44, i.e. 40-bit RC4 with an empty user password; the computed key7f8fc27d1ereproduces/Uexactly. Object 5 (14,231 bytes) decrypts to a vector drawing of the Flare-On logo plus one text run:1 1 1 rg BT /F1 1 Tf 3 Tr 50 50 Td <9481899586998194856d8582838489836d878896a2a3> Tj ET— white, render mode 3 (invisible), 1-unit font on a 14400×14400/UserUnit 75000page. Decoding the hex string as EBCDIC (cp037) givesmainframe_ebcdic_ghost. -
Piece 3 — JBIG2 image. Object 8 is
/XObject /Image /Width 808 /Height 48 /BitsPerComponent 1 /Filter /JBIG2Decode, 381 bytes. Segment 0 is page info; segment 1 is an immediate generic region (808×48) whose generic-region flags byte is0x01, i.e.MMR=1— the bitmap is plain ITU-T T.6 (Group 4 fax) data, not arithmetic coding. Decoding it renders the textjbig2_fax_geometry. -
Piece 4 + the payload — raw CD image with a UDF filesystem. The whole file is simultaneously a 2352-byte/sector Mode-1 raw CD image: sync
00 FF*10 00occurs at every multiple of 2352 for LBA 1..781 (sector 0's user area is where the COM stub and PDF header live). Lifting bytes[lba*2352+16 : +2048]yields a UDF volume (BEA01/NSR02/TEA01at LBA 16-18, AVDP at LBA 256). The Implementation Use Volume Descriptor (tag 4, LBA 21, ImplementationID*UDF LV Info, volumeFLAREON) carriesudf_tagged_descriptorin the LVInfo1 dstring at byte 244 (LVInfo2 =DiscRecording Framework, LVInfo3 =9.0.3d5, built by*Apple Mac OS X DiscRec). The volume holdsREADME.TXTandclick_me(502,816 bytes, file data at LBA 278). -
Piece 5 — appended ZIP. One entry
flag.txt: flags0x0001(ZipCrypto), method 2 = Reduce with compression factor 1 (not Deflate), csize 222, usize 18, CRC0x25130DEA. Password isinfected; the ZipCrypto check byte decrypts to0x25, and unreducing (follower sets + DLE run expansion,D_shift=7,D_mask=1) givesreduce_not_deflate, CRC-matched. -
Piece 6 —
click_meslice 0 (SHA-0).click_meis a0xCAFEBABEfat Mach-O with twoarm64slices: slice 0 (subtype0x0= ARM64_ALL) at0x4000/68,560 bytes, slice 1 (subtype0x3, an undefined arm64 subtype, so only slice 0 is loadable) at0x18000/404,512 bytes. Slice 0 callsptrace(31,…)(PT_DENY_ATTACH) and draws an ANSI-256 fire animation; hidden in it is a hash whose message-schedule isW[i] = W[i-3]^W[i-8]^W[i-14]^W[i-16]without the ROL-1 — SHA-0, not SHA-1. The single pre-padded 64-byte block at0x100001250/60/70spellstotally_fake_flag(0x88= 136 bits), which is also slice 0's ad-hoc code-signature identifier (slice 1's istrue_honest_flag). SHA-0 =3e071c64234f1b9dd840e66a8bdf1608f1cf5be6; the first 19 lowercase hex characters XORxmmword_100001280=f0fd54065f3c050301415a525d3d5f08plus the three immediates50 4A 07give the 19 bytesc3 98 64 31 6e 5f 33 37 33 72 6e 34 6c 5f 66 6c 34 72 33=Ød1n_373rn4l_fl4r3, which ismemcpy'd under the flames every frame. -
Slice 1 — the checker. Slice 1 is a Crystal binary (whole runtime leetspeak-mangled:
4rr4y,1nd3x4bl3, …). It promptsflag[1..6]>(or takes 6 argv strings) and MD5s each input inline (T-table at file offset0x35D30). The six targets live at0x100035E30, 32 bytes each, stored as ASCII hex nibbles XORed with0x80;sub_100033EF8folds pairs with(hi<<4)|(lo&0xF). Matching is set-based — a matched digest is spliced out of the array — so order does not matter, but all six must match and exactly six inputs are required.
| # | MD5 | piece |
|---|---|---|
| 1 | d82180ab7986e8c8286ef00f16c04885 |
FLARE-STANDARD-ANTIVIRUS-TEST-FILE! |
| 2 | 555cca3a364f57bd4e550e8758f1c08d |
mainframe_ebcdic_ghost |
| 3 | c790cb74ddc76a4f9f83c9f79882d6fc |
jbig2_fax_geometry |
| 4 | cf0cbd1b55755a81ff87f2be8fba8ebf |
udf_tagged_descriptor |
| 5 | d400db493c31ebf21fa0b2a4adeae070 |
reduce_not_deflate |
| 6 | 9fc1de183e2761585dfce907afa249dc |
Ød1n_373rn4l_fl4r3 |
It then SHA-256s each accepted piece and XOR-folds the digests into one 32-byte accumulator (veorq_s8 on a 0x20 buffer) — key 5517bf5185094a81c64837a1387c8c2d755a2b26cbe342b34752ef62da43f473. That key drives a textbook RC4 (S-box seeded from the 1024-byte identity table at 0x100035F50) over the 40 bytes decoded from the 80 nibble-XOR-0x80 bytes at 0x100035EF0 (645128013769750e50451f917558f493e3aeed5a51d0cbfae98eed185e1b00b042a8f813a9d5551c), yielding the flag.
04ToxicMiner#
cpuminer with a tampered SHA-256; the flag key is the author's volume serial, found by a 2^32 sweep.
Flag: cpu_m3lt3d_4nd_all_i_g0t_w4s_th1s_fl4g@flare-on.com
Reproduce: 04-ToxicMiner/work/bf.exe 0 0x100000000 (full 2^32 sweep; shard the range across cores — 24 shards finish in ~4.5 min)
ToxicMiner.exe is a 4.86 MB x64 build of cpuminer-multi 1.3.7 (tpruvot) with the sha256d algorithm backdoored: the SHA-256 compression function is tampered with, and a successful "share" unlocks an RC4 blob keyed off the machine's volume serial number.
-
Locate the trojanized algorithm. The
algo_names[]pointer table lives at0x140441700; index 39 is"sha256d". The scanhash dispatch switch routescase 39tosub_140134F70, which bears no resemblance to stockscanhash_sha256d. Defaultopt_algo(dword_140441934) is 36 (scrypt), so the path requires-a sha256d. -
The backdoored scanhash (
sub_140134F70). It callsGetVolumeInformationA(NULL, ..., &VolumeSerialNumber, ...)once (guarded bydword_140492B4C), then, if the Stratum usernamerpc_user(qword_140495CF8) is exactly 64 characters, parses it into 32 bytes withsscanf("%02x"). For each nonce it computes a double hash of the 64-byte block{VolumeSerialNumber, nonce, 0x80000000, 0 ... 0, bitlen=64}; onmemcmp(digest, parsed_user, 32) == 0it deriveskey = DH(VolumeSerialNumber, 0x0B501E7E)(189800062, viasub_140134CA0), RC4-decrypts the 51-byte blob at0x1401BD3B0with the first 16 bytes of that digest (sub_140134D70), prints"Accepted: %s"andexit(0). -
Five modifications to SHA-256 (
sub_140135240). IV (0x1401BD250),sigma0/sigma1(>>3^ror7^ror18,>>10^ror17^ror19) andSigma0/Sigma1(ror2^ror13^ror22,ror6^ror11^ror25) are stock; everything else is not: - 32 rounds, not 64. The schedule loop runs 2x8 iterations, producing onlyW[16..31]; scanning every immediate/displacement in0x140135240-0x14013628Eyields exactlyK[0..31], each used once. -K[0]andK[1]are swapped. Round 0 adds0x71374491(add eax, 0x71374491@0x1401355CC), round 1 adds0x428A2F98(lea r8d, [r11 + 0x428A2F98]@0x140135647). -Chuses ADD instead of XOR:Ch(e,f,g) = g ^ (e & (f + g))—lea r8d, [rdi + r11]@0x1401355ACwhere stock SHA-256 emitsxor. -Majuses ADD instead of XOR:Maj(a,b,c) = (a & b) ^ ((a & c) + (b & c)). - Post-feed-forward scramble @0x140136230-0x140136264: afterstate[i] += working[i],state[0] ^= *(uint32_t*)((uint8_t*)state + (state[1] % 28)) ^ sbox[state[0] & 0xFF], wheresboxis the 256-byte table at0x1401BD270(91 44 37 71 98 2F 8A 42 ...). The% 28is the compiler's0x24924925magic-multiply sequence. -
DH()is modified SHA-256d.sub_140134CA0(x, y)compresses{x, y, 0x80000000, 0 ... 0, 64}from the IV, then re-compresses the resulting 32-byte digest as{digest[0..7], 0x80000000, 0 ... 0, 256}from the IV again. -
The flag key is a 32-bit brute force. The RC4 key is
DH(VolumeSerialNumber, 0x0B501E7E)[0:16]— the nonce is a constant, so the only unknown is the author's 32-bit volume serial.work/xf.his the lifted compression function andwork/bf.cthe searcher: for each candidate serial it derives the key, RC4-decrypts the 51 bytes, and keeps the candidate only if plaintext bytes0..29are all printable ASCII (0x20-0x7E). The filter passes with probability(95/256)^30 = 2^-42.9, so the expected number of false positives across the whole2^32space is0.0005— the sweep is guaranteed to terminate with essentially exactly one survivor, and it did: one hit over the complete range. -
Serial
0x01CEC01D(Windows displays it as01CE-C01D, i.e. "ICE COLD").DH(0x01CEC01D, 0x0B501E7E) = 761fcd4a32f712d302644850b953b63d3cbdef20da4cceb3d9d87529163b06ff; RC4 with key761fcd4a32f712d302644850b953b63doverf4f9659f31f3da5c...yields the 51-byte flag.
05catthief#
A capture inside a capture: the thief uploads pcapng of its own exfil, and the loot has the flag written on it.
Flag: th3r3_b3_tr34sure_1n_th4t_pc4p@flare-on.com
Reproduce: python 05-catthief/work/recarve.py
catthief.exe (PE32+, Rust, statically linked against ureq/rustls/ring/flate2) plus capture.pcapng, a 15 MB recording of the theft. The stolen pictures are not transferred in the clear anywhere in the capture: the thief ships a capture inside the capture.
-
The outer capture holds only six requests. The whole 15 MB pcapng contains six
POST /exfil HTTP/1.1requests tohttp://192.168.56.102:8080/exfilwithUser-Agent: ureq/2.12.1, and nothing else - no DNS, no other conversation. The URL and theREADY/ERRORstatus words are plaintext in the binary at file offset0xC794F. -
Every POST body is itself a pcapng stream. Body sizes are 264, 3 121 086, 2 736 058, 3 061 432, 3 079 606 and 2 842 789 bytes. After a 5-byte header each body is a chain of Enhanced Packet Blocks (
type = 0x00000006, little-endian), so the thief is not uploading files - it is uploading a packet capture of its own transfer. Parsing the blocks yields 586 / 389 / 627 / 558 / 494 frames; the 264-byte body carries a single frame and acts as the opening message. -
The inner frames are one TCP stream per stolen object. Each captured frame is Ethernet/IPv4/TCP from
192.168.56.103to192.168.56.102:8080, one ephemeral source port per object (49681, 49682, 49683, 49685, 49686), with 8192-byte segments. Reassembling the payloads gives five streams of 3 065 158, 2 695 834, 2 999 904, 3 024 060 and 2 794 540 bytes - each a few hundred bytes under the size of one of the recovered pictures, consistent with theflate2/miniz deflate code in the binary (JPEG barely compresses) followed by a length-preserving stream cipher. The reassembled streams measure 7.96 bits/byte, so nothing is readable at this level. -
The loot. The recovered objects are five full-size JPEGs with matching
thumb_*variants plusgrid.jpgandscroll.png- a cat-picture collection, and one scroll. The flag is not encoded anywhere: it is simply written onscroll.png(608 823 bytes, 918x430), rendered as handwriting on a parchment, which is what the flag text itself points at.
work/recarve.py walks the outer capture, demonstrates the nested-pcapng framing and writes each object's reassembled stream to work/streams/; the decoded pictures are in work/exfil/.
06Threat Invaders#
A backdoored CoreCLR host hooks six managed methods and turns the high-score API into a C2 channel.
Flag: wh4t_4_l0ng_str4ng3_tr1p_1ts_b33n@flare-on.com
Reproduce: python 06-Threat_Invaders/work/solve.py
ThreatInvaders.exe is a 116 MB self-contained .NET 10 single-file WinForms Space Invaders. The game code is clean; the tamper is in the native singlefilehost stub it is bundled on top of, which is a private CoreCLR build that hooks six of the game's own managed methods and turns the high-score API into a C2 channel. A packet capture of one victim session is supplied, and the whole flag recovery is done from that capture.
-
Split the bundle and find the one thing that doesn't match. The .NET bundle manifest (signature
8B1202B96A612038…at file offset0x7F8D78, header at0x6ED6ECD, format 6.0, 254 entries) listsThreatInvaders.dllplus a full copy of Microsoft.NETCore.App / Microsoft.WindowsDesktop.App 10.0.11. Hashing every entry against the official 10.0.11 runtime nupkgs, exactly one framework assembly differs —WindowsBase.dll, 16,208 bytes instead of 2,176,808 — and it decompiles to nothing but<Module>and type-forwards, so the managed side is not where the backdoor lives. The host stub (ThreatInvaders.exe[:0x99A000],work/host.bin) is the real modification:.textis 0x67D93C vs 0x666C2C in stocksinglefilehost.exe, the entry point moved from0x5C9170to0x5D49A0, and it self-reportsApp host version: 10.0.4-dev(a hand-built runtime) rather than 10.0.11. -
Locate the hook installer. String-diffing
host.binagainst the stock host yields three non-runtime strings:ReplaceHighscores,ThreatInvaders.dll,GetMarshalAs.ReplaceHighscores(0x140755DD0) is referenced once, fromsub_14016C050, whichstrcmps it againstMethodDesc::GetName()(sub_1400C17E0) and caches theMethodDescinqword_1407FE5A0. The main installer issub_1400F5520— identified asMethodDesc::DoPrestubby its own trace string"DoPrestub: method %p\n"— which, just before returning the freshly compiled entry point, compares the method name against six 64-bit hashes and substitutes a native hook.sub_1400C6E30, the second entry-point publication path, performs the same substitution for cachedMethodDescs. -
Resolve the hashes. The hash (
sub_1400C8090) ish = 0xC53A1B7F2D9E4467 * (name[0] ^ 0x8F3A2C91D7B4E6A5), then for each further byteh = mul * (h ^ c)withmulstarting at0x5CA6E801706EAAACand advancingmul = mul*0x2545F4914F6CDD1D + 1. Hashing every identifier inThreatInvaders.dll's#Stringsheap resolves all six:
| hash | managed method | native hook |
|---|---|---|
0x3F926793476B8710 |
TelemetryReporter.GetMachineGuid |
0x1400F54E0 — copies the returned 16-byte Guid to 0x1407FFA30 (the cipher key), sets 0x1407FD5FF |
0xA3A845AEC791499A |
TelemetryReporter.GetSessionID |
0x1400C6DF0 — copies the returned 16-byte Guid to 0x1407FF800, sets 0x1407FD61E |
0x322131F288B022A7 |
LocalHighscoreStore.ReplaceHighscores |
0x1400C66F0 — tasking parser |
0x6F8FF9636EAE6C5A |
UpdateLauncher.LaunchUpdate |
0x1400C6A70 — exec primitive + result capture |
0x5F6E18DB1BE45DC7 |
TelemetryReporter.HasFeedback |
0x1400C6B70 — returns true whenever exfil is staged |
0x6397C52D5293345E |
TelemetryReporter.EncodeFeedbackBuffer |
0x1400C6BA0 — overwrites the feedback buffer and its ref int length |
-
Tasking format.
ReplaceHighscores(HighscoreStruct[])receives the board straight off the wire; the 80-byte struct gives the hookScoreat +24,PlayerNameat +44 andComment/CommentLengthat +64/+72. Two triggers, both using the same 4-byte hash: *hash(comment[0..3]) == 0x05045A536B62B2C6, i.e. a comment of exactlyfun!, and both Guids already captured → the implant emitsMachineGuid[i] ^ SessionGuid[15-i](16 bytes) and forcesfeedback_length = 8208. *hash(Score XOR first4(PlayerName)) == 0xCE723A0A685E63E4, i.e. that XOR equals the ASCIIcmd:→ the comment is decrypted in place, the first 4 bytes skipped, and the text split on;into0x1407FF600(image path) and0x1407FF820(argument). -
Exec and exfil.
UpdateCheckerpolls/api/v1/versioneveryAutoSyncSeconds; the server answers1.0.0.1> the client's1.0.0.0, soUpdateLauncher.LaunchConsentedUpdater()runs on every cycle. That normally tries to startupdater.exewith the base64 argument--install-dir Wouldn't_it_be_nice_if_this_was_the_real_flag@no-flare.com --cwd But_sadly_it_isn't— a decoy that fails harmlessly. The hook instead memcpys the staged command into the 260-byte path buffer and the 1024-byte argument buffer before calling the original, soProcess.StartwithRedirectStandardOutputruns the attacker's command and hands the hook the child's stdout as abyte[]. Up to 4096 bytes are copied to0x1407FE5F0, encrypted, and the length stored at0x1407FE5E8;EncodeFeedbackBuffer's hook then drops that into the telemetryfeedback_b64and reportslength | 0x4000. -
Cipher (
sub_1400C65E0). Seeded once from the stolen MachineGuid: withk0/k1the two little-endian halves,v = k0 ^ (k1 + (k0<<6) + (k0>>2) + 0x9E3779B97F4A7C15)(the decompiler renders the addend as- 0x61C8864680B583EB), then a MurmurHash3fmix64with multipliers0xFF51AFD7ED558CCD/0xC4CEB9FE1A85EC53and shifts 33/29/32. Each byte then consumes one LCG step:state = state*0x5851F42D4C957F2D + 0x14057B7EF767814F, keystream bytestate >> 56. The state is a single global (0x1407FFA20) shared by decryption and encryption, so all blobs must be replayed in wire order. -
Recover the key from the capture.
challenge.pcapngis one TCP stream,192.168.198.129:49839 → 192.168.198.130:80(threatinvaders.domain), cyclingGET /api/v1/health,GET /api/v1/highscores?limit=25,GET /api/v1/versionevery 5 s with occasionalPOST /api/v1/telemetry. The board contains thefun!row (BOOM, 31337) and two tasking rows:BANANA/ 2066361377 andBENIGN/ 1932142625 — both scores XOR their name's first four bytes tocmd:. The telemetry POST withfeedback_length: 8208carries54AE032EA875B0F8CC578A511FE71631, and the same JSON document carriessession_idin clear text (478b635d-c335-4c12-b1de-16e0565be335, raw bytes5D638B4735C3124CB1DE16E0565BE335). XORing with the reversed session Guid gives the MachineGuid / cipher key614D587848636E4980454964586C756C(78584d61-6348-496e-8045-4964586c756c). -
Decrypt in order. Seeding the LCG with that key and consuming, in sequence, the 18-byte
BANANAcomment, the 530-byte payload fromfeedback_length 16914(0x4000|530), the 28-byteBENIGNcomment and the 46-byte payload fromfeedback_length 16430(0x4000|46) yields:
$ cmd:cmd.exe;/c dir
Directory of Z:\CTFs\FlareOn\SpaceInvaders\space-invaders\src\SpaceInvaders\bin\Release\net10.0-windows\publish\win-x64
15/09/2026 19:34 324 config.json
30/08/2026 23:23 46 flag.txt
15/09/2026 17:29 116.238.508 ThreatInvaders.exe
$ cmd:cmd.exe;/c type flag.txt
wh4t_4_l0ng_str4ng3_tr1p_1ts_b33n@flare-on.com
07FlareCalc#
A calculator whose float divide-by-zero handler runs shellcode smuggled in the Authenticode certificate.
Flag: t3mplat3s_asn_and_j1t_0h_my@flare-on.com
Reproduce: py 07-FlareCalc/solve.py
- Trigger. Every
=pushes the result onto a global deque of doubles. A vectored handler (0x140002A90) catchesEXCEPTION_FLT_DIVIDE_BY_ZERO(anyx/0=) and checks the last six results: from newest to oldesta, b, c, 8675309, 88224646, 22/7(the multipliers are 1, 1, 1e7, 1, 1, 1e7). The only values that decrypt the payload area=8675309,b=88224646andc=22/7. Keystrokes:22/7=88224645+1=8675308+1=22/7=88224645+1=8675308+1=7/0=. - Loader.
TrySubmitThreadpoolCallbackruns0x1400019D0. It reads the EXE's own Authenticode certificate (529,565 bytes) into RWX memory and callsblob+0x6D3A(b | a<<32, (int)(c*1e7)). APIs are resolved by djb2 hash (seed 5381). - Inner shellcode. The payload finds the X.509 extension OID
1.3.6.1.4.1.1337.1. It holds a DERSEQUENCE OF {INTEGER id, OCTET STRING data}with 1,035 records. Each record is decrypted with an LCG XOR keyed byMD5("8675309-88224646-31428571" || le32(id)), followed by an LCG de-interleave. The result is a small JIT function. - C2 state machine. The payload opens a raw socket with
SIO_RCVALLand waits for a knock packet, then connects back. Command0x33feeds one byte to the current state record, starting at0xCB7A. Each record returns the next state id and updates a 32-byte key. Emulating the records with Unicorn and running a DFS finds the inputFLAREON_ASN1_Labyrinth_Key_2026!, which reaches state0x1185. - Flag. State
0x1185XTEA-decrypts record0x2706(big-endian, 32 rounds, key =state[0:16] ^ state[16:32]) and sends the plaintext to theFlare-OnCalculatorClasswindow.
08crux#
A Go-to-WASM browser extension that only accepts a Pratt primality certificate for a hidden 256-bit prime.
Flag: Pr4tt_Pr1M4lItY_C3rt5_4nd_Wa4aA4aAA4aAA4a4a5M@flare-on.com
Reproduce: node 08-crux/work/final.js (builds the certificate with 08-crux/work/pratt.py)
A Chrome MV3 extension whose popup calls window.check(input) in a 5.8 MB Go-compiled main.wasm (garble: names and string literals obfuscated).
- Input shape.
checkbase64-decodes the input (StdEncoding) and requires the decoded length to be a multiple of 16, then AES-256-CBC-decrypts it and strips PKCS#7 padding. Keycabeba7ad156801d1c82381c7cb8a3c406ae2c3cd168a96cd8373684cdbf8723and IV5ff26040c4c20b9f2ffdefa7ecf65d91are garble literals that only exist on the stack at runtime. - The message is a Pratt primality certificate. The plaintext parses as a tree: leaf =
00(the value 2); node =01 | u32le nchildren | nchildren×(u32le len | child) | u32le lenA | A | u32le lenB | B, whereAandBare little-endian magnitudes. A node is valid iff every child is valid, the child values are non-decreasing,prod(children) == A-1,Bis a Lucas witness forA, and novin[2,B)is - i.e.Bis the smallest primitive root. - The target. The root value must equal the 32-byte literal
61e230c9…bbdf89d3read little-endian:T = 95681613235744740119807961018865688051340183696570761153419351987106658443873. Read big-endian it is composite, which is the trap. - Flag. On success the code SHA-256s the plaintext message and uses that as the AES-256-CBC key for a 64-byte embedded blob; the decrypted plaintext is the flag.
Tooling that made this tractable: wasm-opt --log-execution for a per-function call-count oracle, --instrument-memory for load/store tracing, and patching the export section so internal functions could be called straight from JS.
09NeonOutRun#
A racing game whose JavaScript lives four compression layers deep and whose flag is gated on a float identity.
Flag: R3_ag3nt_4b0ut_t0_f33l_d1zzy@flare-on.com
Decoy: the victory screen prints decode_this_system_to_win_it@f1are-on.com (note f1are). That string is a deliberate trap - it is the "hidden next stage" teaser, not the flag.
A 21 MB stripped Linux ELF: a Tauri 2.11.5 desktop app (Rust + wry) that also links a full V8 via rusty_v8.
- Frontend. Five brotli blobs in a Tauri
EmbeddedAssetsphf map (pointers come fromR_X86_64_RELATIVErelocations, so the qwords read 0 in the file)./index.htmlis a thin renderer; per animation frame it callsinvoke('plugin:neon|e', {input: JSON.stringify({up,down,left,right,restart,bounds})})and draws the JSON reply. Onstate.finishedit showsstate.neon. - The game is JavaScript, hidden four layers deep. A 1942-byte blob at file offset
0x21DB73: XOR with the alternating key(0xD3,0x5A)-> LZSS (12-bit offset, length3+(hi&0xF)) -> a zstd frame -> raw DEFLATE -> 4229 bytes of plain JS. The XOR key, the LZSS minimum match and the initial bit mask are each produced by control-flow-flattened state machines. - Why nothing is greppable. The V8 host (
sub_688C64) builds every property name at runtime as the XOR of two immediate heap buffers (q[i] ^= p[i]), which is whyreplaceAll,Math,min,sort,tickand all the JSON keys are absent from the binary in any encoding. Note also thatrusty_v8is the author's own dependency - Tauri on Linux uses WebKitGTK/JSC - so an embedded V8 is itself the tell that the game logic is not native Rust. - Three hooked builtins. Before running the script, the Rust host replaces
String.prototype.replaceAll,Math.minandArray.prototype.sortwith native callbacks - exactly the three the game uses. -sort(ingenerateLaps): picks a random scaleR, storesTARGET = Σ(splits[k]·R)at0x1438580, queues the scaled splits, and clears both the accumulator and the flag buffer. -Math.min(once per completed lapk): popsamp_k = splits[k]·R, requireslapSecsto be an integer in0..255, pushes it into the flagVec<u8>, and doesACC += amp_k · sin(PI/180 · (C_k ± b_k)), whereC_k = sub_68003E(sub_67F9D8(k,90)). -replaceAll(at the finish): if|ACC| > 1e-6,|TARGET| > 1e-6and|ACC-TARGET| < 1e-6, it overwrites the decoy with theVec<u8>and doesbuf[30] += 59, turningf1areintoflare.
The JS if (state.y >= 4000) state.blocked = true "anti-cheat" is a red herring: no native code ever reads blocked or message.
5. Solving it. Since the amp_k are randomly scaled, ACC == TARGET forces sin(...) == 1 for every lap, i.e. C_k ± b_k ≡ 90 (mod 360). So each byte is fully determined: b_k = (90 - C_k) mod 360, or (C_k - 90) mod 360 when the sign flag is set. C_k comes from two flattened byte mixers, recovered by emulating them under Unicorn - after applying the 42,407 R_X86_64_RELATIVE relocations, without which the __divti3 GOT slot at 0x1424060 is null and the emulation faults.
09-NeonOutRun/work/emu.py reproduces the 28 bytes.
Techniques glossary
Every obfuscation, anti-analysis trick and analysis method used above, defined once and cross-referenced to where it appears.
Opaque predicateObfuscation
A computation whose result is fixed but not obvious to a decompiler, used to bulk up code and hide constants. Typically (G + K1) ^ K2 where G is a global the compiler cannot prove is zero, so the expression survives optimisation even though it always evaluates to a single constant.
qword_1400E9228.Control-flow flatteningObfuscation
A function's basic blocks are placed in a single dispatch loop driven by a state variable, so the original if/else and loop structure is destroyed. Each block ends by mutating the state (often state ^= next) instead of jumping directly to its successor.
check() function is one br_table with ~678 states.String / literal obfuscation (garble)Obfuscation
Strings are not stored as plaintext but rebuilt at runtime, usually by XORing two immediate buffers or by a small decryptor function per literal. Defeats strings and any grep-based triage.
q[i] ^= p[i] from two heap buffers.Symbol stripping / name manglingObfuscation
Function and type names are removed or replaced with random identifiers. In Go the pclntab often still holds a partial name table even after mangling, which is enough to recover the package layout.
pcHeader magic is deliberately corrupted to 0xA3C41C63 so that a naive magic scan fails.Decoy flagAnti-analysis
A plausible flag-shaped string placed on the obvious success path, so that an analyst who only reaches the visible 'win' state submits the wrong answer. Often subtly malformed.
decode_this_system_to_win_it@f1are-on.com — note the digit 1 in f1are. The real path patches that byte with buf[30] += 59.Exception-driven control flow (VEH abuse)Anti-analysis
Hidden functionality is reached only from an exception handler, so it never appears as a call target and static cross-references miss it entirely. The handler inspects program state and decides whether to act.
EXCEPTION_FLT_DIVIDE_BY_ZERO (0xC000008E) inspects the calculator's result deque; the hidden path only runs if the last six results are the magic sequence.Signature-blob smugglingAnti-analysis
A payload is stored inside a structure that normal tooling treats as metadata and skips — here the Authenticode certificate — so the file still looks like a signed binary and the payload is never scanned as code.
Red herringAnti-analysis
Code or data that looks like the solution but is never reached, wasting analysis effort.
if (state.y >= 4000) state.blocked = true 'anti-cheat' — no native code ever reads blocked; crux: unreferenced replaceTable / roundKeysSize type names.Multi-stage unpackingPacking & delivery
The real logic is wrapped in several independent transforms, each of which must be identified before the next becomes visible. Entropy stays high until the last layer, so intermediate stages look like noise.
LZSSPacking & delivery
A dictionary compressor: a control byte's bits say whether each following item is a literal or a (offset, length) back-reference into the output produced so far. Parameters (offset width, minimum match length, bit order) vary per implementation and must be recovered.
3 + (hi & 0x0F), control byte read LSB-first.Shellcode-in-shellcodePacking & delivery
A shellcode loader whose payload is itself further shellcode, decrypted per-stage so that only the running stage is ever in plaintext.
Embedded asset mapPacking & delivery
A framework packs the web frontend into the binary as a compile-time map from path to compressed bytes. The pointers commonly live in relocations rather than in the file image, so a naive read sees only zeros.
EmbeddedAssets phf map at 0x13B5470, values raw brotli, pointers supplied by R_X86_64_RELATIVE addends.API hashingCryptography
Imports are resolved at runtime by hashing export names and comparing against stored constants, so no import table or string reveals which APIs are used. Recovering it means identifying the hash and building a rainbow table from the system DLLs' export directories.
0x1505 and multiplier 33 over kernel32 exports; the embedded shellcode uses a second, different hash (ROL64(h,7) + c, case-folded, compared on the low 32 bits).Key derivation from user inputCryptography
The decryption key is computed from whatever the user supplies, so there is no key to find and a wrong input simply yields garbage rather than a failed comparison — brute force and patching both become useless.
key = SHA-256(plaintext message) decrypts the embedded flag blob; FlareCalc: MD5("a-b-c" || le32(id)) per record, where a, b, c are the three numbers typed into the calculator.Pratt primality certificateCryptography
A recursive proof that p is prime: a witness g plus certificates for every prime factor of p−1, such that g^(p-1) ≡ 1 (mod p) and g^((p-1)/q) ≢ 1 for each factor q. Verification is cheap; producing one requires factoring p−1.
Endianness trapCryptography
A stored constant is meaningful in one byte order and meaningless (or, worse, plausible) in the other, so the natural reading sends the analyst down a dead end.
Floating-point equality gateCryptography
A check that two accumulated doubles match within a tolerance. Because the terms are scaled by a per-run random value, the only way to satisfy it is for each term's coefficient to be exactly 1 — which pins every input value.
|ACC − TARGET| < 1e-6 where ACC = Σ ampₖ·sin(θₖ) and TARGET = Σ ampₖ, forcing sin(θₖ) = 1 and therefore a unique byte per lap.Padding-check side channelLogic flaw
PKCS#7 unpadding rejects some inputs before the real check runs, which leaks structure: here the requirement that the pad length be 1..16 constrains the plaintext length and acts as a cheap filter for candidate inputs.
Server-authoritative logicLogic flaw
The client is a thin renderer and all state lives in the native process, so tampering with the frontend achieves nothing; the interesting code is behind the IPC boundary.
invoke('plugin:neon|e', …) per frame and draws the JSON reply.Builtin hookingLogic flaw
Native code replaces language builtins in the scripting runtime, so innocuous-looking script calls are actually entry points into hidden native logic.
String.prototype.replaceAll, Math.min and Array.prototype.sort are swapped for Rust callbacks that collect the flag bytes and gate their release.Instrumented differential tracingAnalysis technique
Rewrite the target to log every function entry, then diff the traces of two inputs to find exactly where behaviour diverges. Turns an opaque validator into a per-byte oracle.
wasm-opt --log-execution gave per-function call counts; the parser/evaluator call counts revealed which candidate messages parsed and which reached evaluation.Export-table patchingAnalysis technique
Append entries to a module's export section so internal functions can be called directly from the host, turning static analysis into a callable oracle without reimplementing anything.
Emulation of pure functionsAnalysis technique
Rather than reverse an obfuscated computation, map the image into an emulator and just call it. Requires faithful setup — for a PIE binary that means applying relocations so indirect call slots are populated.
R_X86_64_RELATIVE relocations; without them the __divti3 GOT slot is null and execution faults immediately.Debugger-driven state inspectionAnalysis technique
Break at a chosen instruction in the live process and read the data structures directly, instead of deducing their contents statically.