practical enclave malware with intel sgx
play

Practical Enclave Malware with Intel SGX Michael Schwarz, Samuel - PowerPoint PPT Presentation

Practical Enclave Malware with Intel SGX Michael Schwarz, Samuel Weiser, Daniel Gruss June 20, 2019 - DIMVA19 Graz University of Technology www.tugraz.at Outline SGX 2 Michael Schwarz , Samuel Weiser, Daniel Gruss Graz University of


  1. Practical Enclave Malware with Intel SGX Michael Schwarz, Samuel Weiser, Daniel Gruss June 20, 2019 - DIMVA’19 Graz University of Technology

  2. www.tugraz.at Outline SGX 2 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  3. www.tugraz.at Outline SGX 2 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  4. www.tugraz.at Outline SGX 2 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  5. www.tugraz.at Outline 2 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  6. www.tugraz.at SGX Application Untrusted part Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  7. www.tugraz.at SGX Application Untrusted part Create Enclave Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  8. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  9. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  10. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  11. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  12. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Return Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  13. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Return Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  14. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Return . . . Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  15. www.tugraz.at SGX Application Untrusted part Trusted part Create Enclave Call Gate Trusted Fnc. Call Trusted Fnc. Return . . . Operating System 3 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  16. www.tugraz.at What if? • Enclaves are black boxes 4 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  17. www.tugraz.at What if? • Enclaves are black boxes • Protected from all applications and OS 4 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  18. www.tugraz.at What if? • Enclaves are black boxes • Protected from all applications and OS • What if they contain malicious code? 4 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  19. www.tugraz.at What if? • Enclaves are black boxes • Protected from all applications and OS • What if they contain malicious code? • Can we hide zero days? 4 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  20. www.tugraz.at Threat Model Intel’s Statement [...] Intel is aware of this research which is based upon assumptions that are outside the threat model for Intel SGX. The value of Intel SGX is to execute code in a protected enclave; however, Intel SGX does not guarantee that the code executed in the enclave is from a trusted source [...] 5 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  21. www.tugraz.at SGX Limitations Classical exploits cannot be mounted within SGX: 6 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  22. www.tugraz.at SGX Limitations Classical exploits cannot be mounted within SGX: • No syscalls 6 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  23. www.tugraz.at SGX Limitations Classical exploits cannot be mounted within SGX: • No syscalls • No shared memory/libraries 6 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  24. www.tugraz.at SGX Limitations Classical exploits cannot be mounted within SGX: • No syscalls • No shared memory/libraries • No interprocess communication 6 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  25. www.tugraz.at SGX Limitations Classical exploits cannot be mounted within SGX: • No syscalls • No shared memory/libraries • No interprocess communication • Blocked instructions 6 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  26. www.tugraz.at State-of-the-art Malicious Enclaves • Side-channel attacks from SGX [Sch+17] 7 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  27. www.tugraz.at State-of-the-art Malicious Enclaves • Side-channel attacks from SGX [Sch+17] • Fault attacks from SGX [Gru+18; Jan+17] 7 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  28. www.tugraz.at State-of-the-art Malicious Enclaves • Side-channel attacks from SGX [Sch+17] • Fault attacks from SGX [Gru+18; Jan+17] • No real exploits from SGX so far 7 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  29. www.tugraz.at TEE-REX TEE - REX T E E R EX rusted xecution nvironment eturn-oriented-programming ploit 8 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  30. www.tugraz.at Attack Overview Data Code Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  31. www.tugraz.at Attack Overview Data Read Primitive ( TAP ) Gadget Code Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  32. www.tugraz.at Attack Overview Write Primitive ( CLAW ) Cave Data Read Primitive ( TAP ) Gadget Code Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  33. www.tugraz.at Attack Overview Write Primitive ( CLAW ) Cave Data Read Primitive ( TAP ) Gadget Code ROP injection chain Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  34. www.tugraz.at Attack Overview Write Primitive ( CLAW ) Cave Data Read Primitive ( TAP ) Gadget Code ROP injection chain Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  35. www.tugraz.at Attack Overview Write Primitive ( CLAW ) Cave Data Read Primitive execute ( TAP ) Gadget Code ROP injection chain Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  36. www.tugraz.at Attack Overview Write Primitive ( CLAW ) Cave Data Read Primitive execute ( TAP ) Gadget Code ROP injection chain Stack Enclave 9 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  37. www.tugraz.at Problems • Enclave can access host memory... 10 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  38. www.tugraz.at Problems • Enclave can access host memory... • ...but crashes on invalid access 10 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  39. www.tugraz.at Problems • Enclave can access host memory... • ...but crashes on invalid access • No syscall or exception handler available 10 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  40. www.tugraz.at Transactional Memory • Intel TSX: hardware transactional memory 11 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  41. www.tugraz.at Transactional Memory • Intel TSX: hardware transactional memory • Multiple reads and writes are atomic 11 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  42. www.tugraz.at Transactional Memory • Intel TSX: hardware transactional memory • Multiple reads and writes are atomic • Operations in a transaction 11 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  43. www.tugraz.at Transactional Memory • Intel TSX: hardware transactional memory • Multiple reads and writes are atomic • Operations in a transaction • Conflict → abort and roll back 11 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  44. www.tugraz.at Transactional Memory • Intel TSX: hardware transactional memory • Multiple reads and writes are atomic • Operations in a transaction • Conflict → abort and roll back • Faults are suppressed 11 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

  45. www.tugraz.at Transactional Memory Thread 0 Cache Thread 1 12 Michael Schwarz , Samuel Weiser, Daniel Gruss — Graz University of Technology

Recommend


More recommend