Cybersecurity-Mastery

Home › Malware Analysis › Bootkits

Bootkits

MBR/VBR and UEFI implants, Secure Boot bypass and firmware-level persistence.

Expert⌨ ~60 min hands-on📖 ~20 min read

▶ Here to build, not read? Jump to the Hands-On Practice.

Prerequisites: Malware Fundamentals

Overview

MBR/VBR and UEFI implants, Secure Boot bypass and firmware-level persistence. In one line: bootkits decides where trust is placed, and misplaced trust is where the security problem lives. That's the theory you need — the understanding comes from doing it, so the walkthrough below is the heart of this chapter.

How it works

Mechanically, bootkits comes down to three things: what data is trusted, where it crosses a boundary, and what happens on the other side. The diagram traces that path; you'll walk it for real, step by step, in the practice below.

flowchart TD
    A["Bootkits"] --> B["Concepts & terminology"]
    A --> C["Internal mechanics"]
    C --> D["Trust boundaries"]
    D --> E["Attack surface"]
    D --> F["Defensive controls"]
    E --> G["Detection & telemetry"]
    F --> G
    G --> H["Verification in the lab"]
🔑 Key terms
  • Trust boundary — where data or control passes between components of different privilege or trust.
  • Attack surface — the set of points an attacker can interact with.
  • Primary control — the single measure that most reduces this technique's impact.
  • Telemetry — the log or signal a defender uses to detect the technique.

Hands-On Practice

Tip
This is the main event. Bring up the lab, then work the walkthrough — every command has a ▸ Run button (needs the lab runner) and a 📋 Copy button. ~60 min, Kali attacker, fully local.

🧪 Lab setup — Malware Analysis

  • analysis-box — isolated container/VM with static+dynamic tooling
docker-compose.yml
# malware-lab/docker-compose.yml  —  Malware analysis (ISOLATED)
services:
  analysis-box:
    image: remnux/remnux-distro:focal    # REMnux: malware-analysis toolkit
    container_name: analysis-box
    command: sleep infinity
    networks: [airgap]
    # NO published ports. NO internet.

networks:
  airgap:
    driver: bridge
    internal: true         # hard requirement: no route out

Uses the Malware Analysis lab environment.

Guided walkthrough

1Provision & baseline
command
# bring up the part environment, then confirm you can reach `analysis-box` from Kali
Expected output
Target reachable; you have a clean starting point.
Always capture 'normal' before you change anything — it's your reference.
2Reproduce the technique
command
# perform the core bootkits technique step by step against analysis-box
Expected output
You observe the expected effect and can repeat it reliably.
Owning the mechanism by hand beats running a tool you don't understand.
3Observe what happened
command
# inspect logs / responses / process or network activity
Expected output
You can point to exactly where and why it worked.
The evidence here is what a defender would alert on.
4Apply the primary control
command
# implement the single most important fix for this technique
Expected output
Repeating the technique now fails.
Fix the class, not the one payload — then prove it's closed.

Live terminal

kali@bootkit — start the lab runner for a live shelloffline
Start the Lab Runner (see labserver/README.md), then click Connect lab runner and paste the token. Until then, copy commands from the walkthrough and run them in your own Kali terminal.
$

Try it yourself

Note
Try each for real. Open the hint only when stuck, the solution only to check.

Challenge 1. Extend the walkthrough with one variation of the bootkits technique and predict the result before running it.

Hint

Change one variable (payload, target, or control) at a time.

Solution

Answers vary — the goal is a correct prediction confirmed by observation.

Challenge 2. Find and apply a second defensive control for bootkits and show it also blocks the technique.

Hint

Think in layers: prevention, detection, and least privilege.

Solution

Any independent control that breaks the chain counts — name why it works.

Challenge 3. Write a one-paragraph report of your bootkits test mapped to CWE/ATT&CK and the fix.

Hint

Structure: finding → impact → evidence → remediation.

Solution

A defender should be able to act on your report without asking you anything.

Detect & defend (blue-team view)

  • Re-run the technique while watching your telemetry — attack and detection are two views of one event.
  • Turn what you observed into a detection rule (Sigma/YARA) and confirm it fires without flooding.

Skills check

You can move on when you can, without notes:

Check Yourself

Quick self-test — answers hidden. If you can't answer without notes, redo the relevant walkthrough step.

Q1. In one sentence, what security problem does Bootkits address or create?

Show answer

Bootkits matters because its behaviour determines where trust is placed; misplacing that trust is the root of the associated bug class.

Q2. Name one trust boundary involved in Bootkits and what crosses it.

Show answer

Any point where attacker-influenced data meets privileged processing — e.g. user input reaching an interpreter, or a token reaching a verifier.

Q3. Give one attack against Bootkits and the single control that most reduces its impact.

Show answer

State the attack precisely, then the primary control (validation, encoding, isolation, authentication, or least privilege) — not a laundry list.

Interview angles

  • Walk me through how Bootkits works, then tell me where you would attack it.
  • How would you detect Bootkits being abused in an environment you defend?
  • What is the difference between mitigating and eliminating the risk associated with Bootkits?

Pitfalls & Best Practice

Common mistakes

  • Treating bootkits as a checkbox instead of understanding the mechanism — defences copied without comprehension fail silently.
  • Trusting client-side or default controls to enforce a server-side security property.
  • Testing only the happy path and never the abuse cases or malformed input.
  • Fixing the symptom (one payload) instead of the class (the missing control).

Do this instead

  • Push security decisions to a single, well-tested enforcement point rather than scattering checks.
  • Fail closed: when in doubt, deny and log, so misconfiguration reduces access rather than expanding it.
  • Instrument the trust boundaries so the same event is visible to offence (as a target) and defence (as a signal).
  • Validate your understanding of bootkits empirically in the lab before trusting it in production.
  • Prefer safe, high-level APIs and secure defaults over hand-rolled primitives.

Reference

MITRE ATT&CK Mapping

TechniqueID
ATT&CK techniqueT1542.003
ATT&CK techniqueT1542.001

OWASP Mapping

  • See OWASP Top 10 for the relevant category when this applies to web systems.

CWE Mapping

  • No direct weakness ID; when this concept fails in code it usually surfaces as one of the CWE Top 25 entries.

CAPEC Mapping

  • No single attack pattern; see the CAPEC chapter to map behaviour to patterns.

CVE References

  • No canonical CVE for a concept page. Search the NVD for concrete instances when studying real cases.

NIST References

RFC References

  • No governing RFC for this topic. Where a protocol is involved, its RFC is linked from the relevant networking chapter.

Research Papers

  • Reflections on Trusting Trust — Ken Thompson, 1984
  • Smashing the Stack for Fun and Profit — Aleph One, Phrack 49, 1996
  • The Protection of Information in Computer Systems — Saltzer & Schroeder, 1975

Books

  • Practical Malware Analysis — Sikorski & Honig
  • The Art of Memory Forensics — Ligh, Case, Levy & Walters
  • Practical Binary Analysis — Dennis Andriesse

Official Documentation


Part of the Malware Analysis section of Cybersecurity-Mastery. 🔴 Expert · ~60 min hands-on · Last updated 2026-08-12.

Cybersecurity-Mastery — interactive security learning · runs locally