telemetry.acgcap

Deflated Socket Web • 350 points (Dynamic Decay) • Insane

DYNAMIC SCORING Current: 350 pts Range: 600 pts → 350 pts • Solves: 39 The live feed was compressed, and the server never forgot what it had already said. Target: https://cyber-arena-2026.s3.ap-south-1.amazonaws.com/scs/web/chall4/telemetry.acgcap Launch Target Submit Flag* CTF{...}

Dr.Binary
run_sandbox
run_sandbox
run_sandbox
run_sandbox

The capture is a custom format (ACGCAP1) containing a WebSocket handshake plus frames. Let me parse it properly:

run_sandbox

Parse works (232 records). My counter had a bug — let me dump the frame structure properly:

run_sandbox

The structure is now clear: these are write-event chunks per direction, not logical frames — frames get split across records (e.g. record 4+5 = 33+19 = 52 bytes = the 0xc1 0x34 frame's payload). Let me reassemble the byte streams and parse WebSocket frames:

run_sandbox

The handshake records are polluting the streams. Let me skip the HTTP handshake and re-parse:

run_sandbox

Clean parse now: 38 server frames (32 compressed text), 5 client frames. Now the key move — the server negotiated permessage-deflate with context takeover, so I must inflate all server messages through one shared decompressor (that's "the server never forgot what it had already said"):

run_sandbox
run_sandbox

The feed decompressed — 135KB of telemetry JSON, but no flag yet. Let me examine the client messages and hunt for anomalies in the feed:

run_sandbox
run_sandbox
run_sandbox

The client's own message contains a draft flag CACTF{3v3ry_m3ss4g3_1nfl4t3s_0n_1ts_0wn} — but server messages 34/35 blew up with invalid distance too far back and garbage. That's the real puzzle. Let me diagnose per-message:

run_sandbox

Everything decompresses cleanly now — 30 telemetry lines, a 300-byte binary blob, a 306KB "custody-ledger", and a "custody-seal". Let me inspect those final messages closely:

run_sandbox

The trap: the server sends a ping mid-message (mid-1!) between fragments of the big ledger message — control frames must not split a fragmented data message. Let me fix that and pull the final messages:

run_sandbox

Now the real puzzle is revealed. The final message says the 300-byte blob is masked with keystream sha256(K || ctr32be) where K = sha256(previous server text message, UTF-8) — and that "previous message" is only recoverable via the shared deflate context. Let me decrypt:

run_sandbox

Not printable — the "previous server text message" is ambiguous (the ledger between the blob and seal is also text!). Let me brute-force all candidates and keystream layouts:

run_sandbox

Let me try decrypting the seal too (it's ~45 bytes — flag-sized), not just the blob:

run_sandbox

Let me verify the ledger integrity and then brute-force the counter space for the mask scheme:

run_sandbox

Ledger is intact. Let me scan it for anomalies and simultaneously brute-force the keystream counter:

run_sandbox

HIT! The seal decrypts with K = sha256(ledger) — first block gives CACTF{sl1d1ng_w1nd0ws_r3m3mb3r_3 but the second block's counter is off. Let me recover the tail:

run_sandbox

The counter is the byte offset (32-bit BE) — block 2 uses ctr=32. Full flag recovered. Let me write the clean end-to-end solve to confirm:

run_sandbox

Flag: CACTF{sl1d1ng_w1nd0ws_r3m3mb3r_3v3ry_m3ss4g3}

How it works

telemetry.acgcap is a custom capture (ACGCAP1 magic) of a WebSocket session to grid-live.aranya.example — records of [u8 dir][u32 BE len][chunk] holding raw socket write fragments per direction (a frame's header and payload land in separate records).

Chain of tricks:

  1. Reassembly, not records — each record is a write fragment, so I concatenated per-direction streams and parsed real WS frames from them (client frames masked, server unmasked). The server negotiated permessage-deflate; client_no_context_takeover; server_max_window_bits=10.

  2. Shared deflate window — "the server never forgot what it had already said": server context is taken over, so every server message must be inflated through one zlib.decompressobj(-15), feeding payload + 00 00 FF FF per message. That yields 30 telemetry lines, a 300-byte binary blob, a 306,133-byte custody-ledger (3200 rows), and a custody-seal.

  3. The mid-1 ping trap — the server pings between the ledger's continuation frames. Control frames must never split a fragmented data message; handling it wrong desyncs the shared window (classic invalid distance too far back + garbage).

  4. The payoff — the final custody-seal message declares:

    "mask": "keystream sha256(K || ctr32be), K = sha256(previous server text message, UTF-8)"
    

    The "previous server text message" is the big ledger — reconstructable only because of the shared sliding window. K = sha256(ledger) = 29b9b560..., keystream blocks = sha256(K || byte_offset_be32) (offsets 0, 32), XOR over the 45-byte seal → the flag.

The decoy: the client's own message contains "draft":"CACTF{3v3ry_m3ss4g3_1nfl4t3s_0n_1ts_0wn}" — "every message inflates on its own", precisely the wrong lesson, planted for naive per-message decompression.

Full solve script: solve.py (decompressed feed saved to server_feed.txt).