Boot Chain Lab
BOOT CHAIN LAB
Undercover Blueteamer · pre-OS integrity

The five seconds
before the OS.

Everything that runs before your operating system does — firmware, boot sector, loader — is where the quietest attacks live. This is a lab that measures that ground instead of weaponizing it: snapshot a VM, boot it, hash what happened, roll back. Plus a 512-byte Forth OS, to show the whole chain from the first instruction up.

x86 real modeUEFI / Secure BootQEMU + OVMF SHA-256 evidenceNASMC++17Forth
// SIGNAL 01 — 04:04
It was 2:00 AM and now 3:00 AM, but I’ve been diving deeper into Assembly and the kernel, now it feels like it was 4:00 AM an hour ago, but it’s only 4:04 AM now. The depth of the SHELL has me… Welcome to assembly, the building blocks of technology and architecture today :) where you are only allowed to learn past 1 AM. — 3XC
00 — know the other side

Threat actors

Detection starts with motive: who is on the other end, and what they are after, shapes how they move — and how you catch them. The blue team's first map is the cast.

black hat

Criminal

In it for money. Ransomware and extortion (encrypt the disk, sell the key), fraud, access brokering — increasingly organized, mafia-style crews with affiliates and payrolls.

Defense read: financially motivated and opportunistic → fast and after leverage. Watch encryption spikes, shadow-copy deletion, exfil-before-lock.
grey hat

Unsanctioned

Operates between legal and illegal with no clear authorization — vigilantes who “fix” things uninvited, data brokers trading what they scrape, researchers who cross the line to make a point.

Defense read: intent is ambiguous, so judge by action, not story. Unauthorized is unauthorized.
white hat

Authorized

Ethical and in-scope: blue teamers, SOC analysts, pentesters and red teams under rules of engagement. CEH, OSCP, INFOSEC. This chair.

Defense read: your own red team is a sensor — their findings are detections you build before the real thing arrives.
hacktivist

Cause-driven

Motivated by ideology or politics, not profit: defacements, leaks and DDoS to make a statement (the Anonymous mold). Where it shades into election and influence operations, it often overlaps with — or fronts for — nation-state info-ops.

Defense read: timing tracks current events; expect bursts around the news cycle, and watch for leak-and-amplify.
nation-state · APT

State-sponsored

Advanced Persistent Threats: funded, patient, strategic — espionage and pre-positioning, long dwell times, custom tooling. E.g. Salt Typhoon / RedMike and Mustang Panda (PRC telecom & government espionage); Mandiant's UNC#### / APT## clusters.

Defense read: quiet, legitimate-looking, living-off-the-land. Where every lab here converges — persistence, cross-view, C2, memory, the timeline.
Reading the zoo. The same adversary gets a different name from every vendor — usually keyed to nation. CrowdStrike assigns an animal to each country or category:
BEAR Russia PANDA China (PRC) KITTEN Iran CHOLLIMA North Korea TIGER India LEOPARD Pakistan BUFFALO Vietnam CRANE South Korea LYNX Georgia WOLF Turkey OCELOT Colombia SPIDER eCrime JACKAL hacktivist
Microsoft uses weather — Typhoon China, Blizzard Russia, Sleet North Korea, Sandstorm Iran, Tempest financially-motivated, Storm-#### emerging / unattributed.
Mandiant numbers them — APT## (attributed nation-state), FIN## (financially motivated), UNC#### (uncategorized). Same adversary, three names — threat-intel is half translation.
BlueChain · proposed — VULPUS (Vulpes, the fox): the AI-era nexus. Model providers now publish actor-misuse reporting (PRC APTs included), yet no vendor assigns an animal to AI-enabled operations — so the lab coins one. The fox: clever, adaptive, hunts at the edge of the treeline. A 3XC coinage, offered to the zoo.
01 — the terrain

How a machine wakes up

Power hits the CPU and it runs firmware, which hands off stage by stage until an OS is in control. Each handoff is a place code can be swapped. Pick a path and tap a stage.

02 — the instrument

ChainLoader / BootKitStudio

A defensive simulator. It never writes a boot sector or firmware — it models each stage as a marker, runs a VM under hard guardrails, and emits JSON evidence a SOC can read. The core loop is four steps, and it fails closed if any safety gate is missing.

Guardrails (fail-closed)

  • BKS_LAB_MODE=1 required
  • VM image under lab/vms only
  • reject /dev/* physical disks
  • snapshot · rollback · evidence preconditions
  • base image never written (overlay only)

Evidence bundle

// run a scenario to capture evidence
03 — the first instruction

10biForthOS — a Forth in 512 bytes

The smallest honest version of the whole chain: one boot sector that is a working Forth. It fits in the 512 bytes BIOS loads, ending in the 0x55AA signature. It speaks a two-byte protocol over the serial line — 0x01 <byte> compiles one byte; 0x00 runs what you compiled.

The sector — 512 bytes

134 bytes of code (incl. boot splash) zero padding 0x55 0xAA signature

Byte inspector

Pick a program. See how a few lines of assembly become the raw bytes the OS compiles over serial — and what lands on screen.

1 · assembly

        
2 · machine code

      
3 · serial stream (01=compile · 00=execute)

        
4 · the console
// about — 3XC

Raised in the glow of the Dead Cow

I measure the ground. I never become it.

3XC is a defender who thinks in red. Raised from a child in the glow of old-school hacker culture — the cDc era, when the modem was a doorway and curiosity was the only credential — I learned the machine from the first instruction up, not the manual down.

It usually starts around 2 AM. The house goes quiet, the shell gets deep, and somewhere past 4 the assembly stops looking like syntax and starts looking like terrain — ground you can measure, map, and defend. That is where this lab was written, one hash-chained page at a time. The work is blue; the imagination is red. You cannot defend an attack you cannot picture — so I picture all of them, refuse to swing the blade, and write the detection instead.

Somewhere in the treeline a fox keeps watch. VULPUS vigil — the AI-era nexus, named before the vendors got around to it. The lantern passes; the vigil holds.

04 — the whole lab

One thesis, four pieces

Learn the offense cold, then build the thing that catches it — not the thing that does it.

ChainLoader / BootKitStudio

Boot-chain integrity simulator: snapshot → boot → evidence → rollback, marker-only, guardrailed. The subject of this page.

C++17 · NASM · QEMU/OVMF

Detection Lab + Vertical

Local telemetry → explainable SQL detections → hand-traced evidence notebook with a hash-chained journal. The SOC side.

Zeek · osquery · DuckDB · C++

10biForthOS

A 512-byte Forth OS booted over serial — the boot chain from its very first instruction, nothing hidden.

x86 real mode · NASM

idtscan

Read-only IDT/GDT integrity checks — spot a planted ring-0 gate, never plant one. Detection, by design.

Linux · Windows (kd) · macOS notes