PINK CTFMisc
Cluck Cluck
Everything you can hear is a decoy. The two least significant bits of each sample hide a CHKN blob containing a program in the Chicken esolang.
- Competition
PINK CTF
- Category
- MiscHard · estimated
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition2 min read
TL;DR
Everything you can hear is a decoy. The two least significant bits of each sample hide a CHKN blob containing a program in the Chicken esolang. Running it prints a harmless "self-test" banner. The flag is pushed character by character inside code blocks that execution always jumps over.
WAV 2-bit LSBs → "CHKN" + length + Chicken source → never-executed pushes → flag01
The audible decoys
The file is 60 s of 16-bit stereo audio at 44.1 kHz. It contains three things, none of which carries data:
a constant A-major chord (220, 277.18, 329.63 and 440 Hz) whose volume slowly swells up and down
flat white noise
22 short "clucks", chirps every 2.75 s whose pitch climbs by about 4950 Hz each time and folds back at the Nyquist frequency


02
The low bits
The low 2 bits of the samples are far from random. The left channel's LSB averages 0.31 for the first ~52 s and 0.50 afterwards, and the low bits repeat a short 16-sample pattern. That's what sequential LSB embedding of repetitive data looks like (WavSteg / stego-lsb with 2 LSBs).
Reading 2 bits from every sample (L and R interleaved), with the first sample supplying the lowest bit pair of each byte:
b'CHKN' 33 c1 11 00 chicken chicken chicken chicken ...That's the magic CHKN, then a little-endian length of 1,163,571 bytes, then a Chicken program of 2276 lines.
03
Chicken
In Chicken, the number of chicken words on a line is the opcode: 0 axe, 1 chicken, 2 add, 3 fox, 4 rooster, 5 compare, 6 pick, 7 peck, 8 fr (conditional relative jump), 9 BBQ (number to char), and n ≥ 10 pushes n − 10. Code and stack share one memory array, and the program's output is the top of the stack when it exits.
With a small interpreter (chicken.py), the program prints:
POULTRY COMPUTATION ENGINE v3.1...[01] triangular(20) ........ OK...Nothing suspicious detected.04
Dead code
Tracing which addresses actually run shows 321 instructions that are never executed. Every push 1; push N; fr (an always-taken jump) skips one of two kinds of block:
FAIL\nbuilders, which would run if a self-test failedjunk blocks of random opcodes with printable pushes mixed in
Reading the printable pushes in the junk blocks in order:
PINK{Cl | uck_Clu | c k _you_ | are_a_d | uck!}One k is hidden as the word right after a pick. Since that code never runs, the word 117 is really its own instruction, push 107 (k). Scanning the dead code word by word, without pairing pick with its operand, and dropping the FAIL paths gives the flag.
Solve script
solve.py extracts the program, runs it, traces execution and prints the hidden characters:
hidden: PINK{ClFAILuck_CluFAILck_you_FAILare_a_dFAILFAILuck!}flag : PINK{Cluck_Cluck_you_are_a_duck!}Flag
Flag
PINK{Cluck_Cluck_you_are_a_duck!}
Source-documented · not platform-verified
