detecting past and present intrusions through vulnerability-specific predicates

29
Detecting past and present intrusions through vulnerability- specific predicates Ashlesha Joshi, Sam King, George Dunlap, and Peter Chen

Upload: awena

Post on 04-Jan-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Detecting past and present intrusions through vulnerability-specific predicates. Ashlesha Joshi, Sam King, George Dunlap, and Peter Chen. Index. Authors Motivation & Introduction Goals Challenges & Solutions Evaluation Related work Conclusion. Author group. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Detecting past and present intrusions through vulnerability-specific predicates

Detecting past and present intrusions through vulnerability-

specific predicates

Ashlesha Joshi, Sam King, George Dunlap, and Peter Chen

Page 2: Detecting past and present intrusions through vulnerability-specific predicates

Index

• Authors

• Motivation & Introduction

• Goals

• Challenges & Solutions

• Evaluation

• Related work

• Conclusion

2

Page 3: Detecting past and present intrusions through vulnerability-specific predicates

Author group

• EECS DepartmentUniversity of Michigan

• Peter M. Chen is the leader of the group, and the other 3 authors are his students.

• The group is investigating how to add security services through virtual machines.

• Paper: Operating System Support for Virtual Machines USENIX 2003

3

Page 4: Detecting past and present intrusions through vulnerability-specific predicates

Authors

Ashlesha Joshi

Ph.D in Computer Science,

University of Michigan

4

Page 5: Detecting past and present intrusions through vulnerability-specific predicates

Samuel T. King 2006 Ph.D University of Michigan

Now in University of Illinois at Urbanna-Champain

Research areas: Operating System, Security and VM.

important papers:1.Virtualization and Security: Back to the Future IEEE

S&P 2008

2.SubVirt: Implementing malware with virtual machines IEEE S&P2006

3.Capo: a software-hardware interface for practical deterministic multiprocessor replay

ASPLOS '095

Page 6: Detecting past and present intrusions through vulnerability-specific predicates

George Washington Dunlap Ph.D University of Michigan

Research areas: Operating System , VM.

important papers:1.Execution replay of multiprocessor virtual

machines VEE’08

2.Debugging operating systems with time-traveling virtual machines ATEC '05

6

Page 7: Detecting past and present intrusions through vulnerability-specific predicates

Peter M. Chen 1992,Ph.D. in Computer Science from the University of California

at Berkeley ,

Research areas: Operating Systems, Databases, Distributed Systems.

important papers:1. Tolerating latency in replicated state machines through client

speculation NSDI’09

2. Execution replay of multiprocessor virtual machines VEE,08

3. Rethink the sync OSDI’06

4. Backtracking intrusions SOSP’03

7

Page 8: Detecting past and present intrusions through vulnerability-specific predicates

8

Motivation

• Software contains bugs, including flaws that may be exploited by an attacker

• Some time passes before vendor becomes aware of bug

• Software vendors try to release patches quickly

timepatch released patch

appliedvulnerability introduced

Vulnerability discovered

Page 9: Detecting past and present intrusions through vulnerability-specific predicates

9

Motivation

• Was this vulnerability triggered on my machine in the past?

• Can I somehow protect my system before I install the patch?

timepatch released patch

appliedvulnerability introduced

timepatch released patch

appliedvulnerability introduced

Vulnerability discovered

Page 10: Detecting past and present intrusions through vulnerability-specific predicates

10

Predicates

• Patch writer knows exactly what conditions during program execution indicate triggering of vulnerability

• Use this knowledge to write vulnerability-specific predicates that check these conditions– No false positives or false negatives

Page 11: Detecting past and present intrusions through vulnerability-specific predicates

11

An example

1 char *str = some_string;2 int length = strlen (str);3 char buf [BUFSIZE];4 strcpy(buf,str); // D’oh!Predicate: (length >= BUFSIZE)

Page 12: Detecting past and present intrusions through vulnerability-specific predicates

12

Approach

vulnerability introduced

“past” “present”

timepatch released patch

applied

Using replay, detect if vulnerability was triggered in past

Monitor ongoing execution to detect and respond to attempts to trigger vulnerability

Page 13: Detecting past and present intrusions through vulnerability-specific predicates

13

Goals

The system must…1. Not perturb the target software

2. Work for both OS and application-level vulnerabilities

3. Allow predicates to be installed dynamically

4. Allow predicates to be written easily

5. Have low overhead

Page 14: Detecting past and present intrusions through vulnerability-specific predicates

14

Challenge #1: Where do predicates execute?

On a normal computer, software runs either as a user-level application or in the operating system kernel. Neither of these locations is suitable for

executing predicates because predicates should run outside the target system to avoid perturbing

its state.

Page 15: Detecting past and present intrusions through vulnerability-specific predicates

15

control

IntroVirt structure

hardware

host OS

guest OS

application

predicate engine

state

predicates

intrusionsdetected

VMM

application

Page 16: Detecting past and present intrusions through vulnerability-specific predicates

16

Challenge #2: Semantic gap

Problem: VMM exposes guest state at the wrong level of abstraction– It gives us registers, memory locations, disk blocks, …– We want program variables, files, …

1 uid = getuid();2 // forget to check group membership3 perform privileged action

Predicate– Perform missing authentication, e.g., read /etc/group

Page 17: Detecting past and present intrusions through vulnerability-specific predicates

17

Bridging the semantic gap

• How could the programmer write this predicate?– Determine memory location where uid is stored; if

page not resident, read from disk; read value of uid; traverse guest OS file system structures to see if /etc/group in file cache, if so, read from memory; if not, traverse FS structures to see which disk blocks contain it, then read blocks from disk; …

– i.e., emulate guest functionality• Our solution: call guest code

– Leverages existing guest code that does what we want

– Here, we cause the guest itself to read the file and check group membership

Page 18: Detecting past and present intrusions through vulnerability-specific predicates

18

Challenge #3: Avoiding perturbations to target state

• Calling guest functions perturbs target

• Solution: use checkpoint and restore– Take a checkpoint before changing guest

state– Restore to checkpoint after predicate

execution

• Also protects from (buggy) predicates that modify guest state incorrectly

Page 19: Detecting past and present intrusions through vulnerability-specific predicates

19

• the state checked by the predicate can change after the predicate executes but before the state is used by the vulnerable code.

Challenge #4: Preemptions between the predicate and the bug

Page 20: Detecting past and present intrusions through vulnerability-specific predicates

20

Predicate refresh

• Detect and respond to race– “Predicate refresh”– Observation: in uniprocessors, a scheduling

event must occur before any other process can run

– Re-execute predicate on scheduling events to detect relevant changes in state

Page 21: Detecting past and present intrusions through vulnerability-specific predicates

Evaluation

• The system has 5 goals. Goal 1,2,3 are met by design.

• Goal 4:Allow predicates to be written easily and

goal 5:low overhead, are the main evaluation objectives.

21

Page 22: Detecting past and present intrusions through vulnerability-specific predicates

Example Predicates

• CAN-2003-096:

• This bug involves a missing bounds check in the Linux kernel’s do_brk function

• The function neglects to check for integer overflow and to check if the process is trying to expand its heap above the address TASK SIZE. The patch consists of the following code, inserted before line 1044 of mmap.c

22

Page 23: Detecting past and present intrusions through vulnerability-specific predicates

23

Predicate for CAN-2003-0961

Actual Patch:if((addr + len) > TASK_SIZE || (addr + len) < addr)

return –EINVAL;

Predicate:registerBreak(“mmap.c:1044:begin”, brkEventHandler);

void brkEventHandler() {unsigned long addr = readVar(“addr”);unsigned long len = readVar(“len”);

if((addr+len) > TASK_SIZE || (addr+len) < addr) {cout << “brk bug triggered” << endl;

}}

Page 24: Detecting past and present intrusions through vulnerability-specific predicates

CAN-2002-0656

• Vulnerability:static int get_client_master_key(SSL *s) {

...

s->session->key_arg_length=i; // line 419

s->state=SSL2_ST_GET_CLIENT_MASTER_KEY_B;

...}

• Patch:if(i > SSL_MAX_KEY_ARG_LENGTH) {

SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,

SSL_R_KEY_ARG_TOO_LONG);

return -1; }24

Page 25: Detecting past and present intrusions through vulnerability-specific predicates

• Predicate:void sslEventHandler() {

unsigned long i = readVar("i");

if(i > SSL_MAX_KEY_ARG_LENGTH)

// "kill process" response strategy

introvirt.killCurrentProcess();

}

25

Page 26: Detecting past and present intrusions through vulnerability-specific predicates

26

Experience

• Wrote predicates for 20 real vulnerabilities (Linux kernel, bind, emacs, gv, imapd, OpenSSL, php, smbd, squid, wu-ftpd, xpdf)– Easy to write once vulnerability is understood– Length and complexity comparable to patch– Most are simple, e.g., just read a few variables

• Overhead for most predicates is less than 10%– Many predicates are on infrequently executed code

paths– Frequently executed predicates are simple and fast– Checkpoint/restore adds 5ms

Page 27: Detecting past and present intrusions through vulnerability-specific predicates

Predicates they have written

27

Page 28: Detecting past and present intrusions through vulnerability-specific predicates

28

Related work

• VM introspection [Rosenblum97]

• VM introspection for intrusion detection [Garfinkel03]

• Shield [Wang04]

• Vigilante [Costa05]

Page 29: Detecting past and present intrusions through vulnerability-specific predicates

29

Conclusions

• Vulnerability-specific predicates detect triggering of software vulnerabilities

• IntroVirt predicate engine– Simple to write general-purpose predicates– No perturbations in state

• Alert users about past attacks

• Detect and respond to attacks in the present