Lion Cipher Lab

Decode the PE Rich header for build-toolchain attribution (and spot a false flag)

Why it matters

When a threat-intel analyst wants to know WHO built a Windows binary, one of the strongest cheap signals is not in the code at all -- it is in the Rich header, an undocumented blob the Microsoft linker (link.exe) stamps between the DOS stub and the PE header. For every object file that goes into a binary, link.exe records a comp.id (the exact build tool plus its build/version number) and a COUNT of how many objects of that toolchain were linked. That is a fingerprint of the precise build environment: which Visual Studio, which service pack, which mix of C/C++/assembler/resource objects. Two…

What you'll learn

Steps in this lab

  1. What the Rich header is, and where it hides
  2. The byte layout, and why it is XOR-encoded
  3. Set up a benign, self-contained scratch folder
  4. Create the generator: make_pe_with_rich.py
  5. Create the decoder: decode_rich.py, and decode synthetic_rich.bin
  6. Cluster by Rich hash -- and see the no-header case
  7. OPTIONAL: cross-check with pefile
  8. The judgment: a lead, not proof (Olympic Destroyer)

Open the full interactive lab →