mitigating exploits, rootkits and advanced persistent threats

39
1 Hot Chips 2014 | Tutorial Mitigating Exploits, Rootkits and Advanced Persistent Threats David Durham, Senior Principal Engineer Intel Corporation Hot Chips Tutorial

Upload: others

Post on 02-Feb-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mitigating Exploits, Rootkits and Advanced Persistent Threats

1 Hot Chips 2014 | Tutorial

Mitigating Exploits, Rootkits

and Advanced Persistent

Threats David Durham, Senior Principal Engineer

Intel Corporation

Hot Chips Tutorial

Page 2: Mitigating Exploits, Rootkits and Advanced Persistent Threats

2 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Agenda

Page 3: Mitigating Exploits, Rootkits and Advanced Persistent Threats

3 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 4: Mitigating Exploits, Rootkits and Advanced Persistent Threats

4 Hot Chips 2014 | Tutorial

Increasingly Sophisticated Attacks

Operation Aurora: ”Google

announced an attack targeting it and what is believed to be more than 30 other companies ….”

CNET January 12, 2010

Stuxnet: “…a novel way to use

computers to sabotage an enemy's lifeline infrastructure suggests a powerful new kind of weapon is moving within reach of weak states, militant groups and criminals…”

Reuters Nov 30, 2010

The Heartbleed Vulnerability: What It Is and How It Affects You: “…Heartbleed is not a virus, but rather a mistake written into OpenSSL” April 2014

Meet ‘Flame,’ The Massive Spy Malware “…designed primarily to spy on the users of infected computers and steal data from them, including documents, recorded conversations and keystrokes.” May 2012, Wired

Banking Malware (SpyEye) Monitors Victims by Hijacking Webcams and Microphones May 2012, PCWorld

Page 5: Mitigating Exploits, Rootkits and Advanced Persistent Threats

5 Hot Chips 2014 | Tutorial

Malware Signatures More & More…

• Malware samples continue sharp rise

• Polymorphic viruses

• Methods of packing, redistributing existing malware

• Looking for known malware misses 0-days and targeted attacks

Page 6: Mitigating Exploits, Rootkits and Advanced Persistent Threats

6 Hot Chips 2014 | Tutorial

Emerging ‘Stack Pivoting’ Exploits Bypass Common Security- APSA13-02 exploit:

http://blogs.mcafee.com/mcafee-labs/emerging-stack-pivoting-exploits-bypass-common-security

0-Day: Vulnerability, Armed, Exploited Sample: APSA13-02 Exploit Analysis

Shared Address Space

Code

Sand

box

RET

RET

write

write

write

write

Heap

Stack Pivot

Stack

Stack Pivot

RET

Page 7: Mitigating Exploits, Rootkits and Advanced Persistent Threats

7 Hot Chips 2014 | Tutorial

Generalized Attack Vectors

Shared Address Space

Comp

A

Buffer Overflow Comp

B

write

write

write

write write

write

write

write

Data Pages

Inject/Modify

Corrupt driver /

malicious code

Disable

Damage Resource

Valid kernel components

Attack External Dependencies

Secret Key

Malware

Eavesdrop

Write Secret

Read

Shared Address Space

Shared Address Space Shared Address Space

FuncA

Input Validation

Bypass

Internal Functions

FuncB Malware

Circumvent

Return Oriented Programming

Page 8: Mitigating Exploits, Rootkits and Advanced Persistent Threats

8 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 9: Mitigating Exploits, Rootkits and Advanced Persistent Threats

9 Hot Chips 2014 | Tutorial

OS Kernel

App Malicious

App

Detect onset of the attack

Monitor behavior

Prevent suspicious access

Anti- Virus

IA Processor

Monitor

Report

Attack

“Behavior-based” detection to stop zero-day attacks

Paradigm Shift

Signature Behavior

Page 10: Mitigating Exploits, Rootkits and Advanced Persistent Threats

10 Hot Chips 2014 | Tutorial

Putting the Defenses Together

VM Functions

Intel® VT-d

Intel® AES-NI

Intel® VT Virtualization

Exceptions

Trusted Launch

Software Isolation

Intel® TXT

Intel® Trusted Execution Technology (Intel® TXT) Intel® Virtualization Technology (Intel® VT) for Directed I/O (Intel® VT-d) Intel® Virtualization Technology (Intel® VT) Intel® Memory Protection Extensions (Intel® MPX) Intel® Software Guard Extensions (Intel® SGX)

Device Isolation Crypto Acceleration Introspection Acceleration

Measurement

Supervisory Execution Prevention

Intel® OS Guard

Intel® MPX

Intel® SGX

Forward Looking…

Buffer Overflow Protections Minimal TCB

Page 11: Mitigating Exploits, Rootkits and Advanced Persistent Threats

11 Hot Chips 2014 | Tutorial

EPT

Page Level Protections

Granular isolation within an address space

VM

VM

OS

OS

IA IA

IA IA

Evolution of Memory Protections

IA

Ring-0

Ring-3

OS

Privilege levels based on protection rings

VMM

VM

VM

OS OS

IA

IA

Multiple virtual machine isolation

Memory View

Reduce the attack surface while minimizing overhead

Page 12: Mitigating Exploits, Rootkits and Advanced Persistent Threats

12 Hot Chips 2014 | Tutorial

Overlaying Granular Protections

Driver

Needing PT

Access

Page TablesMemory Manager

Library Routines

(e.g., bcopy)Other Driver

Other Driver

Memory Manager

Special Drivers

Accommodates existing OS methodology and legacy code

Page 13: Mitigating Exploits, Rootkits and Advanced Persistent Threats

13 Hot Chips 2014 | Tutorial

Kernel

DLL App Code JIT

Process

Kernel module Kernel module

Kernel module

Monitor

Additional Monitoring: Privileged software monitors OS activity

• Intel® Virtualization Technology (Intel® VT) enables protections beyond the OS

• Overlays additional protections and monitoring policies by enabling memory views

• Provides continuous detection of illicit behaviors

• Accelerated using VM Functions and Virtualization Exceptions…

Further Subdivide OS and Applications

Measured Launch

Accelerating Granular Isolation

Page 14: Mitigating Exploits, Rootkits and Advanced Persistent Threats

14 Hot Chips 2014 | Tutorial

Extended Page Tables for Isolation within VM

CPU0

Hypervisor

Intel® VT-x with EPT

VM0

Extended Page Tables (EPT)

EPT Walker

Use VMFUNC to cross EPT domains

Report EPT Violations Via VE

Extended Page Table Pointer List indexed by VMFUNC

Intel® Virtualization Technology for IA-32, Intel® 64 and Intel® Architecture (Intel® VT-x)

• VM Function (VMFUNC) to switch EPTs under guest

• Virtualization Exceptions (VE) directly notify guest of EPT access violations

Memory View 1

Memory View 2

VMFUNC

#VE

Physical Pages

TLBs

VMFUNC

Page 15: Mitigating Exploits, Rootkits and Advanced Persistent Threats

15 Hot Chips 2014 | Tutorial

Granular Isolation (Before)

VMX Root Monitor

R-X

R--

R-X

Execution

EPT fault

EPT fault

View1 View2

R--

R-X

R--

R-- (read-only) R-X (read-execute)

Additional Overhead

Page 16: Mitigating Exploits, Rootkits and Advanced Persistent Threats

16 Hot Chips 2014 | Tutorial

Granular Isolation with VM Functions

R-X

R--

R-X

Execution EPT 1 EPT 2

R--

R-X

R--

VMFUNC0

VMFUNC0

R-- (read-only) R-X (read-execute)

Enforce Control Flow Integrity with Intel® VT

Page 17: Mitigating Exploits, Rootkits and Advanced Persistent Threats

17 Hot Chips 2014 | Tutorial

Monitoring with Virtualization Exceptions

R-X

R--

R-X

Execution EPT 1 EPT 2

R--

R-X

R--

VMFUNC(0)

Guest code Page using VMFUNC0

R-- (read-only) R-X (read-execute)

Guest #VE

Handler

EPT Exceptions directed to the guest

Page 18: Mitigating Exploits, Rootkits and Advanced Persistent Threats

18 Hot Chips 2014 | Tutorial

Context Switching Virtual MachineSwitching

VMFUNC Switching

Relative Performance Comparison

Privilege Level Monitor Overhead

State Save New Paging Hierarchy

VM Function for Switching

Varies Varies

Page 19: Mitigating Exploits, Rootkits and Advanced Persistent Threats

19 Hot Chips 2014 | Tutorial

VIDT

Memory View

X

VIDT

Memory View

X

Layering Virtualization and Introspection

• Root VMM supports VT nesting (with EPT shadowing)

• Root VMM and guest opt-in to enable features

• VMFUNC switches authorized EPTs without engaging VMM(s)

• EPT violations reported via #VE to guest directly

– No VM Exits for guest policies

– No additional overhead for VMMs

• Root VMM decides which pages #VE and which will VM Exit

– Disambiguates copy-on-write and other VMM notification needs

Inner Guest 1

Server VMM VMX-root with Nested VT

Intel CPU w/ VT-x2

sEPTs

Inner VMM

vEPTs

Handler

#VE

EPT Violation ->#VE controls

W

Memory View

Inner VMM N

Inner Guest N

Enables efficient introspection across multiple VMs

Page 20: Mitigating Exploits, Rootkits and Advanced Persistent Threats

20 Hot Chips 2014 | Tutorial

Revisiting Attack Vectors

Shared Address Space

FuncA

Input Validation

Bypass

Internal Functions

FuncB Malware

Circumvent

Shared Address Space

Comp

A

Buffer Overflow Comp

B

write

write

write

write write

write

write

write

Inject/Modify

Corrupt driver /

malicious code

Disable

Damage Resource

Valid kernel components

Attack External Dependencies

Secret Key

Malware

Eavesdrop

Write Secret

Read

Hidden Page

Return Oriented Programming

Shared Address Space

Shared Address Space

Overlay memory views to monitor software behavior

Page 21: Mitigating Exploits, Rootkits and Advanced Persistent Threats

21 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 22: Mitigating Exploits, Rootkits and Advanced Persistent Threats

22 Hot Chips 2014 | Tutorial

Overlaying Protections: Things to Consider…

Memory Mappings

Registers

Async Events

May also address external devices depending on usage

Page 23: Mitigating Exploits, Rootkits and Advanced Persistent Threats

23 Hot Chips 2014 | Tutorial

Monitoring Processor Registers

• VMM can be configured to intercept changes to:

– Model Specific Registers

– Control Registers

– Debug Registers

– Descriptor Tables (IDTR…)

– Mode dependent…

• VMCS determines what registers to monitor

• GPRs including the stack pointer can be checked at boundaries and on events

Memory View Memory

View

Guest

VMX-root

Intel® VT CPU

Registers

mov CR

Memory View

VMCS – Selects what exits

VM Exit

Monitor processor state to prevent attacks

Page 24: Mitigating Exploits, Rootkits and Advanced Persistent Threats

24 Hot Chips 2014 | Tutorial

Page Table Edit Control

!W !W !W

CR3 Target List

Write Protect

Prevent attacks that remap virtual memory

Page 25: Mitigating Exploits, Rootkits and Advanced Persistent Threats

25 Hot Chips 2014 | Tutorial

Interrupts & Asynchronous Events

• Protect Interrupt Descriptor Table & Register

• Trust Interrupt Service Routines or own ISR stub

• Stub code protects state

– Stack

– General Purpose Registers

Protect or intercept asynchronous paths

Base Limit

IDT

ISRs ISRs ISRs

Read Only

Read Only

IDTR

IDTR

Exiting

Page 26: Mitigating Exploits, Rootkits and Advanced Persistent Threats

26 Hot Chips 2014 | Tutorial

Devices

• Device space configuration

– Programmed IO in/out

– Relocation of device registers in memory/BAR change

– Trigger VM Exit

• Memory Mapped IO

– Device registers

– Covered by EPT policy

• DMA

– Buffers in memory

– Covered by EPT policy

Intel® VT-d protects against compromised devices

DRAM

Devices

Address Space

Intel® Virtualization Technology (Intel® VT) for Directed I/O (Intel® VT-d)

Memory View

Page 27: Mitigating Exploits, Rootkits and Advanced Persistent Threats

27 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 28: Mitigating Exploits, Rootkits and Advanced Persistent Threats

28 Hot Chips 2014 | Tutorial

McAfee® Deep Defender Overview

• McAfee® DeepSAFE™ technology in the McAfee® Deep Defender product can safely monitor writes to critical memory assets

• The Deep Defender component within the operating system understands the O/S layout and rootkit techniques

• The DeepSAFE component uses CPU primitives to monitor CPU and memory so that pages containing sensitive code and data are access-controlled

Page 29: Mitigating Exploits, Rootkits and Advanced Persistent Threats

29 Hot Chips 2014 | Tutorial

Providing Better Protections

Audio Input

Storage Video

Page 30: Mitigating Exploits, Rootkits and Advanced Persistent Threats

30 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 31: Mitigating Exploits, Rootkits and Advanced Persistent Threats

31 Hot Chips 2014 | Tutorial

Democratizing Security

• Software relies on a Trusted Execution Environment (TEE) in case other defenses fail

• Isolated hardware and restricted modes limit use

• A future where there are enough TEEs for all?

TEE

VIPs Only

Scaling Trusted Execution Environments for the many

Page 32: Mitigating Exploits, Rootkits and Advanced Persistent Threats

32 Hot Chips 2014 | Tutorial

Trust us

Trust How Many?

• Trusted Computing Base (TCB): – Set of all hardware, firmware &

software part of a trusted environment

• Minimizing the TCB: – Remove Software Stacks

– Remove Drivers

– Remove Devices

– Remove Firmware...

Page 33: Mitigating Exploits, Rootkits and Advanced Persistent Threats

33 Hot Chips 2014 | Tutorial

Trust The Processor

Page 34: Mitigating Exploits, Rootkits and Advanced Persistent Threats

34 Hot Chips 2014 | Tutorial

Scalable security within mainstream environment

Scaling Trust with a Minimal TCB

Proxy Proxy Proxy

Processor

VMM

OS

App App App

Threat surface reduction

Define precise trust boundaries

Remove extraneous components

from the trust boundary

Reduce TCB to the processor

Intel® Software Guard Extensions Programming Reference: https://software.intel.com/sites/default/files/329298-001.pdf

Page 35: Mitigating Exploits, Rootkits and Advanced Persistent Threats

35 Hot Chips 2014 | Tutorial

Utilize Existing Instruction Set Security Primitives E.g. Intel® Advanced Encryption Standard New Instructions:

VMM OS

App A App B Enclave Enclave

https://software.intel.com/en-us/articles/intel-advanced-encryption-standard-instructions-aes-ni/

ShiftRows()

SubBytes()

MixColumns()

AddRoundKey()

ShiftRows()

SubBytes()

AddRoundKey()

InvShiftRows()

InvSubBytes()

InvMixColumns()

AddRoundKey()

InvShiftRows()

InvSubBytes()

AddRoundKey()

AESENC AESENCLAST

AESDEC AESDECLAST

AESKEYGENASSIST AESIMC

… And many more

Page 36: Mitigating Exploits, Rootkits and Advanced Persistent Threats

36 Hot Chips 2014 | Tutorial

Problem Better Protection Solid Foundations

Usages Minimizing TCB

Summary

Page 37: Mitigating Exploits, Rootkits and Advanced Persistent Threats

37 Hot Chips 2014 | Tutorial

Summary

• Increasingly sophisticated attacks require better defenses

• Moving from signatures to behavioral models

• Next generation processors deliver new capabilities for advanced software monitoring and protection

• Ability to layer protections over legacy software

• Minimizing the Trusted Computing Base is the next step…

Page 38: Mitigating Exploits, Rootkits and Advanced Persistent Threats

38 Hot Chips 2014 | Tutorial

Biography

David Durham is a Senior Principal Engineer and Director in Intel Labs. His research team developed anti-malware and cryptographic security features currently found in hundreds of millions of Intel processors. David also developed policy-based network management technologies, created security solutions shipping in Intel® vPro™ platforms and worked with McAfee to deliver virtualization-based anti-malware products. Collaborating with industry leaders, his team developed IEEE 802.1 security protocols and advanced network access control capabilities now embedded in tens of millions of Intel platforms. He is a prolific author on computer communications, having written a book, multiple publications and several Internet protocol standards deployed in millions of connected devices. David received two Intel Achievement Awards, was granted over 100 US and international patents and earned his B.S. and M.S. degrees in Computer Engineering from Rensselaer Polytechnic Institute.

Page 39: Mitigating Exploits, Rootkits and Advanced Persistent Threats

39 Hot Chips 2014 | Tutorial

Legal Disclaimer INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to: http://www.intel.com/design/literature.htm Intel® Virtualization Technology (Intel® VT) requires a computer system with an enabled Intel® processor, BIOS, and virtual machine monitor (VMM). Functionality, performance or other benefits will vary depending on hardware and software configurations. Software applications may not be compatible with all operating systems. Consult your PC manufacturer. For more information, visit http://www.intel.com/go/virtualization. Intel, Look Inside and the Intel logo are trademarks of Intel Corporation in the United States and other countries.

*Other names and brands may be claimed as the property of others. Copyright ©2013-2014 Intel Corporation. All rights reserved.