Confidential computing attack

From brucesongs/kali-claw · View interactive version

Confidential computing attack is an AI agent skill from the GitHub repository brucesongs/kali-claw. Attacks against Trusted Execution Environments (TEEs) and confidential computing platforms — Intel SGX (Foreshadow/SGAxe/LVI/ÆPIC Leak), Intel TDX, AMD SEV/SEV-ES/SEV-SNP (CrossLine/BadRAM), Azure CCF, Marblerun, and Gramine/Occlum libos enclaves. Covers side-channel leakage, attestation forgery, AB

How to use this skill

Skill file

Confidential Computing Attack

Supplementary Files:

- payloads.md — Attack payloads organized by TEE: Intel SGX (Foreshadow/SGAxe/LVI/ÆPIC Leak), Intel TDX, AMD SEV-SNP (CrossLine/BadRAM), Azure CCF, Marblerun, Gramine/Occlum

- test-cases.md — 18 structured test cases covering attestation forgery, side-channel leakage, ABI misuse, host-to-enclave breakout, and sealed-secret recovery

- guides/confidential-computing-attack-playbook.md — End-to-end playbook with engagement scoping, lab setup (QEMU with SGX/SEV emulation), attestation workflow attacks, enclave breakout methodology, and blue-team detection

- guides/real-world-incident-case-studies.md — Eight case studies including SGX Foreshadow (2018), SGAxe (2020), LVI (2020), ÆPIC Leak (2022), AMD SEV CrossLine (2025), BadRAM (2024), and Gramine ABI abuse

Summary

This skill targets confidential computing — the technology that protects data in use via hardware-isolated enclaves. While at-rest and in-transit encryption are well-understood, TEEs introduce a new attack surface: enclave attestation forgery, microarchitectural side channels, ABI misuse between enclave and untrusted host, and host-to-enclave breakout.

Tools: sgx-step, sgvisor, sev-tool, snp-lab, marblerun-cli, ccf-client, occlum-tools, gramine-direct, rust-sgx, edgelessrt, intel-sgx-sdk, sgxs-tools, libsgx, sgx_emulate

Domain: confidential-computing

MITRE ATT&CK: T1046 Network Service Discovery · T1602 Data from Configuration Repository · T1068 Exploitation for Privilege Escalation · T1556 Modify Authentication Process

Description

Attacks against Trusted Execution Environments (TEEs) and confidential computing platforms — Intel SGX (Foreshadow/SGAxe/LVI/ÆPIC Leak), Intel TDX, AMD SEV/SEV-ES/SEV-SNP (CrossLine/BadRAM), Azure CCF, Marblerun, and Gramine/Occlum libos enclaves.

Confidential computing assumes a strong threat model: the OS, hypervisor, BIOS, and even physical DRAM are untrusted. Only the TEE itself (the CPU enclave) is trusted. Attacks against this model fall into four broad categories:

  1. Microarchitectural side channels — exploiting CPU cache, branch predictor, TLB, or memory bus behavior to leak enclave secrets
  2. Attestation forgery — bypassing or faking attestation reports to make untrusted code appear trusted
  3. ABI misuse — abusing the carefully-specified boundary between enclave and untrusted host to corrupt enclave state
  4. Host-to-enclave breakout — escaping from an enclave back to the host, or vice versa

This skill is distinct from:

Where container-security asks "can I escape this container?", confidential-computing-attack asks "given that this enclave is supposed to be impenetrable even to a malicious cloud provider, what corner cases let me violate that promise?"

Use Cases

Differentiation from Adjacent Skills

| Skill | Target | Boundary | Typical entry |

|---|---|---|---|

| hardware-security | Physical chips, IoT devices | Physical access | JTAG, glitching |

| firmware-reverse | UEFI/BIOS, Option ROM | Boot-time | DMA attacks, SMM |

| container-security | OCI, K8s, containerd | Kernel namespace | Container escape |

| confidential-computing-attack (this) | TEEs (SGX, TDX, SEV-SNP, CCF) | CPU enclave boundary | Side channel, attestation abuse |

| cloud-security | CSP control plane | Cloud IAM | IAM enumeration |

| kernel-exploitation | OS kernel | User/kernel boundary | Syscall misuse |

Core Tools

Intel SGX

Intel TDX

AMD SEV / SEV-ES / SEV-SNP

Azure CCF

Marblerun

LibOS Enclaves

Methodology

Phase 1 — Reconnaissance

Phase 2 — Attestation Attacks

Phase 3 — Microarchitectural Side Channels

Phase 4 — ABI Misuse

Phase 5 — Enclave Breakout / Escape

Phase 6 — Sealed Secret Recovery

Phase 7 — TEE Host Compromise

Phase 8 — TDX / SEV-SNP Specific

Defense Perspective

Core Principles

  1. Defense in depth — assume any single TEE may be compromised; layer attestation, code signing, and runtime checks
  2. Quote verification is critical — never accept attestation reports without verifying signature, freshness, and nonce
  3. Advisory policy is policy — Intel's "advisory allowlist" lets unpatched enclaves still attest; decide explicitly
  4. Sealed secrets require key rotation — rotate Seal Key after platform firmware updates
  5. Side-channel resistance is hard — assume data-dependent branches leak; use constant-time crypto

Hardening Checklist

Detection

Practical Steps

SGX Recon

  1. nm enclave.signed.so | grep -E "sgx_|ecall" to find entry points
  2. objdump -d enclave.signed.so for SGX instruction patterns (enclu, encls)
  3. sgx_sign dump -key ... -enclave ... -dumpfile ... for metadata

SGX Attestation Replay

  1. Capture a valid attestation report (older or from compromised platform)
  2. Replay to relying party without fresh nonce
  3. If relying party doesn't verify nonce → accept stale report

SGX Foreshadow (L1TM) Recovery

  1. Deploy sibling thread that triggers enclave page fault
  2. Use sgx-step to single-step enclave execution
  3. Apply L1 Terminal Fault to leak enclave cache lines
  4. Reconstruct secret from cache line samples

AMD SEV-SNP Attestation Audit

  1. sev-tool --get_vcek to fetch the platform's VCEK certificate
  2. Verify attestation report signature against VCEK
  3. Check policy fields (abi_major, abi_minor, smt)
  4. Compare MEASUREMENT field against expected guest measurement

Azure CCF Governance Attack

  1. Identify network consortium (config.json: members, certificates)
  2. Compromise a member's private key (or social-engineer a quorum member)
  3. Submit set_constitution proposal to add malicious operator
  4. If accepted → malicious node joins network

Gramine LibOS Recon

  1. gramine-sgx-sign --manifest app.manifest to inspect manifest
  2. gramine-sgx-token to generate runtime measurement
  3. Identify syscall emulation bugs via fuzzing (e.g., gramine-sgx-direct --trace-syscalls)

Detection Methods

TEE Audit Logging

Side-Channel Detection

SIEM Detection Rules

Defense Evasion Techniques

Attestation Bypass

TEE Escape Stealth

Cloud Confidential VM Attacks

Cross-References

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.