Skip to content
Adam Omar Saleh

FlagYard CTF placeholder badge (unofficial)FlagYard CTFForensics

NO SESSION

The dual-homed appliance uses one global IPv4 ID counter for both of its NICs. The inside host changes how fast that counter moves by sending bursts of DAJX requests.

Competition
FlagYard CTF placeholder badge (unofficial)FlagYard CTF
Category
ForensicsHard
Source status
Source-documented · not platform-verified
Document
PDF edition3 min read

Brief

The challenge

Category
Forensics
Difficulty
Hard
Files
inside-management.pcapng, outside-edge.pcapng

The firewall is telling the truth: the isolated analytics host never created a session to the outside monitor, and neither capture contains an end-to-end flow between them. A 12-byte incident token still crossed the boundary. You received an inside management capture and an outside edge capture from a dual-homed appliance. Recover the token.

TL;DR

The dual-homed appliance uses one global IPv4 ID counter for both of its NICs. The inside host changes how fast that counter moves by sending bursts of DAJX requests. The outside monitor reads the counter from the IP IDs on the appliance's replies. The covert data sits under several layers:

Text
burst size (1-2 = 0, 4-5 = 1) -> 228-bit frames (sync beaa052b + 196 bits) -> PN9 descramble -> block deinterleave (28 x 7) -> Hamming(7,4) -> 14-byte fragment with CRC-16/CCITT-FALSE -> 3 fragments x 4 bytes = token

01

Traffic

  • Inside: 10.90.4.23:57150 <-> 10.90.4.1:48620, 2192 DAJX request/response pairs (13 bytes: 6db1 + type + DAJX + 4-byte nonce + 2-byte tag).

  • Outside: 10.90.8.77:40116 <-> 10.90.8.44:33440, 686 probes (one every 150 ms), plus appliance syslog to :5514.

  • The rest (mDNS, statsd, host syslog) is noise. Nonces and tags are random, and the response tag is just the request tag XOR a constant.

02

The side channel: a shared IP ID counter

On both interfaces the appliance's IP IDs come from a single counter. For every outside probe interval:

Text
delta(IP ID between outside replies) = 1 + (syslog packets) + (inside burst size)

This holds for all 684 intervals. The outside monitor can therefore subtract the syslog packets it sees and recover the size of each inside burst without any session crossing the firewall.

03

Burst sizes to bits

Each 150 ms tick has one burst of 1, 2, 4 or 5 requests. Only the high/low split carries information (the 1/2 and 4/5 choice is random):

Text
1 or 2 -> 0      4 or 5 -> 1

That gives 684 bits, which is exactly 3 x 228. Each 228-bit frame starts with the same 32-bit sync word beaa052b.

04

PN9 and the interleaver

The 196 bits after the sync word look random. Here is how I found the layout:

  • If the bits are read as 28 codewords of 7 bits, written row-wise and transmitted column-wise (bit[c*28 + r] belongs to codeword r), and XORed with a PN9 sequence, the codewords fall into a space of GF(2) rank about 4. I found this by brute-forcing seeds and scoring by rank.

  • The keystream is the 9-bit LFSR fb = s0 ^ s4 with seed 0x1FF, started at offset 407.

  • After descrambling, exactly 16 distinct 7-bit words appear, which is the full Hamming(7,4) code.

05

Hamming(7,4) and CRC

The working layout is the classic one, p1 p2 d1 p3 d2 d3 d4. Taking the data bits from positions 2, 4, 5 and 6 and correcting at most one bit per codeword gives 28 nibbles, or 14 bytes per frame. All three frames pass CRC-16/CCITT-FALSE over bytes 0..11:

Text
a7c3 01 00 03 04 0817 a2ba2504 72bb   CRC oka7c3 01 01 03 04 0817 7e8dd4a2 cb40   CRC oka7c3 01 02 03 04 0817 118a813c 7d95   CRC ok
FieldValue
magica7c3
version01
fragment index00 / 01 / 02
fragment count03
chunk length04
id0817
chunk4 bytes
CRCCRC-16/CCITT-FALSE

06

Reassembly

Ordering the fragments by index:

Text
a2ba2504 | 7e8dd4a2 | 118a813c

Solve script

solve.py reproduces everything from the inside capture:

Text
$ python solve.pya7c3010003040817a2ba250472bb CRC oka7c30101030408177e8dd4a2cb40 CRC oka7c3010203040817118a813c7d95 CRC okFlagY{a2ba25047e8dd4a2118a813c}

Flag

Flag

FlagY{a2ba25047e8dd4a2118a813c}

Source-documented · not platform-verified

PDF edition

Writeup PDF

Formatted edition of this walkthrough, built from my source notes · 4 pages.