david evans university of virginia computer security research cs696 fall 2007 17 september 2007

50
David Evans University of Virginia http://www.cs.virginia.edu/evans/ Computer Security Research CS696 Fall 2007 17 September 2007

Upload: augustine-king

Post on 26-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

David EvansUniversity of Virginiahttp://www.cs.virginia.edu/evans/

Computer Security

Research

CS696 Fall 200717 September 2007

Page 2: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

2http://www.cs.virginia.edu/evans

Computer Security

Study of computing systems in the presence

of adversaries

about what happens when people don’t

follow the rules

Page 3: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

3http://www.cs.virginia.edu/evans

Security in Context

SecurityUses tools and methods from:

Theory

Programming Languages

SoftwareEngineering

OperatingSystemsArchitecture

Cryptography

Page 4: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

4http://www.cs.virginia.edu/evans

Security in Context

SecurityUses tools and methods from:

Theory

Programming Languages

SoftwareEngineering

OperatingSystems

Architecture

Cryptography

Addresses problems in:

Applications

SystemsEmbedded Computing

Graphics

Networks

Page 5: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

5http://www.cs.virginia.edu/evans

Menu

(2) Malware Detection

(with Sudhanva Gurumurthi, Nate Paul,

Adrienne Felt)

(0) RFID Privacy(Karsten Nohl)

(1) User Intent Based Policies

(Jeff Shirley)

(3) Security through Diversity

(w/John Knight, Jack Davidson, ..., UC Davis,

UNM, UCSB)

Page 6: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

6http://www.cs.virginia.edu/evans

RFID Privacy - Karsten Nohl

10kgatesCryptographic

Hash Function

2kgates

RFID tag

Can we provide adequate privacy and authenticity with simple, cheap primitives?

Page 7: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

7http://www.cs.virginia.edu/evans

User-Intent Based Access Control

Jeff Shirley

Page 8: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

8http://www.cs.virginia.edu/evans

Michael Sinz’s Comic

Page 9: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

9http://www.cs.virginia.edu/evans

Jennifer Kahng’s undergraduate thesis experiment

37% clicked Continue 31% clicked Continue

2% typed in “yes”

Page 10: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

10http://www.cs.virginia.edu/evans

Radical Assumption

Most users are not COMPLETE MORONS!

Page 11: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

11http://www.cs.virginia.edu/evans

Page 12: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

12http://www.cs.virginia.edu/evans

User-Intent Based Access Control

• For desktop systems: the user is not the enemy, the programs are

• How users interact with programs indicates what they trust them to do

• Polices that incorporate user intent:– More precise– (Mostly) Universal– Dynamic– Understandable

Page 13: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

13http://www.cs.virginia.edu/evans

Example: Universal File Policy

FileOpen(file $f) read($f)

FileSave(file $f) write($f)

InstallCreate(file $f) read($f), write($f)

Page 14: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

14http://www.cs.virginia.edu/evans

Network Policy

EnterInSmallBox(host $h) connect($h)

Page 15: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

15http://www.cs.virginia.edu/evans

Challenges

• Securely recording user actions• Inferring intentions from actions• Finding and evaluating interesting

policies• Automatically deriving policies

Page 16: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

Disk-Level Behavioral Virus Detection

work withNathanael Paul,

Adrienne Felt, and Sudhanva Gurumurthi

http://www.cs.virginia.edu/malware

Page 17: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

17http://www.cs.virginia.edu/evans

Stereotypical Malwarist, circa 2000

David Smith“Melissa” 1999

Onel de GuzmanMichael Buen“ILoveYou” Worm, 2000

Page 18: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

18http://www.cs.virginia.edu/evans

rem barok -loveletter(vbe) <i hate go to school>rem by: spyder / [email protected] /

@GRAMMERSoft Group / Manila,Philippines…x=1 for ctrentries=1 to a.AddressEntries.Count set male=out.CreateItem(0) male.Recipients.Add(a.AddressEntries(x)) male.Body = “kindly check the attached LOVELETTER …” male.Attachments.Add(dirsystem &“\LOVE-LETTER-FOR-YOU.TXT.vbs”) male.Send x=x+1next

“ILoveYou” Worm CodeThoughtful message

Hid location

Creative speller

Good understanding of for loops

Page 19: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

19http://www.cs.virginia.edu/evans

Detecting “ILoveYou”

file.contains(“@GRAMMERSoft Group”)

• Signature Scanning– Database of strings that are found in

known viruses– A/V scanner examines opened files (on-

access) or stored files (on-demand) for that string

Page 20: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

20http://www.cs.virginia.edu/evans

Stereotypical Malwarist, 2007Picture by Tobic, http://www.worth1000.com/emailthis.asp?entry=31033

Page 21: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

21http://www.cs.virginia.edu/evans

The Organized Malware Industry

• Multi-million dollar industry• Vulnerability black market

– Zero-day exploits sell for ~$4000

• Virus “professionals”– Sell viruses, or use them to build botnets

and rent spamming/phishing service

Bad news for society, but great news for security researchers!

Page 22: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

22http://www.cs.virginia.edu/evans

Modern Viruses• Multi-threaded, stealthy, parasitic • Self-encrypted: each infection is

encrypted with a new key– No static strings to match except

decryption code

• Metamorphic: the decryption code is modified with each infection– Modify instructions

• Below host level: rootkits

Page 23: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

23http://www.cs.virginia.edu/evans

Traditional Detection is Doomed

• Reactive: signatures only detect known viruses

• Static: code is easy to change and hard to analyze

• Circumventable: malware can get below the detector

Page 24: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

24http://www.cs.virginia.edu/evans

Our Goal• Detect viruses:

– At a level malware can’t compromise– Without disrupting non-malicious

applications– Without (overly) impacting performance

• Recognize the fundamental behavior of viruses, instead of relying on blacklists of known viruses

Page 25: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

25http://www.cs.virginia.edu/evans

Semi-Obvious RiddleWhat is:• Available on almost every

computer• Able to see all disk activity• And has processing power and

memory comparable to ~2000 Apple II’s?

The disk processor.

200MHz ARM Processor, 16-32MB Cache

Page 26: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

26http://www.cs.virginia.edu/evans

Even More Obvious Riddle

What behavior do all file-infecting viruses have in common?

They infect files.

Page 27: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

27http://www.cs.virginia.edu/evans

Disk-Level Behavioral Detection

Executing Program

Program makes file requests to OS

OS issues Read/Write requests to disk

Disk processor analyzes request

stream for malicious behavior

Operating System

Page 28: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

28http://www.cs.virginia.edu/evans

Advantages• Proactive

– General techniques to detect new viruses

• Difficult to Evade– Can’t hide disk events

from disk– Dynamic: Hard to change

disk-level behavior• Difficult to Circumvent

– Runs below host OS

Page 29: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

29http://www.cs.virginia.edu/evans

Executing Program

Disk processor analyzes request

stream for malicious behavior

Operating System

read(file, buf, numbytes);

<R, sector, length>

<R, 2995263, length>

Semantic Mapper

<R, gaim.exe, 0, length>

Rule Detectors

gaim.exe:...

... R:0 W:0

*

Page 30: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

30http://www.cs.virginia.edu/evans

Windows PE File

MS-D

OS H

ead

er

PE H

ead

er

Sect

ion H

eaders

Sect

ion 0

Sect

ion 1

Sect

ion N

Page 31: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

31http://www.cs.virginia.edu/evans

Infecting a Windows PE File

MS-D

OS H

ead

er

PE H

ead

er

Sect

ion H

eaders

Sect

ion 0

Sect

ion 1

Sect

ion N

Read

Write WriteWrite

Page 32: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

32http://www.cs.virginia.edu/evans

RWW Rule

read [name@offset:0; write [name@offset:0], write [name@offset:]+

,-separated events in any order

;-separated groups are ordered

name is an executable file (starts with MZ or ZM)

Page 33: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

33http://www.cs.virginia.edu/evans

Detection ResultsVirus RRWW RWW RW W

Alcaul.o, Chiton.b, Detnat, Enerlam.b, Ganda, Harrier, Jetto, Magic.1590, Matrix.750, Maya.4108, NWU, Oroch.5420, Parite.b*, Resur.f, Sality.l*, Savior.1832, Seppuku.2764, Simile, Tuareg (19 viruses)

All infections detected

Aliser.7825 70% 83% All infections detected

Efish* 87% All infections detected

Evyl 91% All infections detected

Page 34: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

34http://www.cs.virginia.edu/evans

False Positives

• Experiments with 8 users, 100 million events– RRWW: 3, RWW: 15, RW: 35, W: 118

• Few Causes: updates, system restores, program installs, software development

• Solutions – if we can change some hard to change things

Page 35: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

35http://www.cs.virginia.edu/evans

Helix Project:Security through Dynamic Diversitywith Jack Davidson, John Knight, Anh Nguyen-Tuongand University of New Mexico, UC Davis, UC Santa Barbara

Page 36: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

36http://www.cs.virginia.edu/evans

Page 37: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

37http://www.cs.virginia.edu/evans

Security Through Diversity• Today’s Computing Monoculture

– Exploit can compromise billions of machines since they are all running the same software

• Biological Diversity• Computer security research: [Cohen

92], [Forrest+ 97], [Cowan+ 2003], [Barrantes+ 2003], [Kc+ 2003], [Bhatkar+2003], [Just+ 2004], [Bhatkar, Sekar, DuVarney 2005]

Page 38: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

38http://www.cs.virginia.edu/evans

N-Variant Systems

• Avoid secrets!– Keeping them is hard– They can be broken or stolen

• Prove security properties without relying on assumptions about secrets or probabilistic arguments

• Allows low-entropy variations

Page 39: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

39http://www.cs.virginia.edu/evans

2-Variant System

Input(Possibly Maliciou

s)

Server Variant

0

ServerVariant

1

MonitorOutpu

t

Poly

gra

ph

er

Page 40: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

40http://www.cs.virginia.edu/evans

N-Version N-Variant Programming Systems

• Multiple teams of programmers implement same spec

• Voter compares results and selects most common

• No guarantees: teams may make same mistake

• Transformer automatically produces diverse variants

• Monitor compares results and detects attack

• Guarantees: variants behave differently on particular input classes

[Avizienis & Chen, 1977]

Page 41: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

41http://www.cs.virginia.edu/evans

N-Variant System Framework• Polygrapher

– Replicates input to all variants

• Variants– N processes that

implement the same service

– Vary property you hope attack depends on: memory locations, instruction set, system call numbers, scheduler, calling convention, …

Variant

0

Variant

1

MonitorPoly-grapher

• Monitor– Observes variants– Delays external effects

until all variants agree– Initiates recovery if

variants diverge

Page 42: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

42http://www.cs.virginia.edu/evans

Variants Requirements• Detection Property

Any attack that compromises Variant 0 causes Variant 1 to “crash” (behave in a way that is noticeably different to the monitor)

• Normal Equivalence PropertyUnder normal inputs, the variants stay in equivalent states:

A0(S0) A1(S1) Actual states are different, but abstract states are equivalent

Page 43: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

43http://www.cs.virginia.edu/evans

Memory Partitioning• Variation

– Variant 0: addresses all start with 0– Variant 1: addresses all start with 1

• Normal Equivalence– Map addresses to same address space

• Detection Property– Any absolute load/store is invalid on one

of the variants

Page 44: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

44http://www.cs.virginia.edu/evans

Instruction Set Tagging• Variation: add an extra bit to all opcodes

– Variation 0: tag bit is a 0– Variation 1: tag bit is a 1– At run-time check bit and remove it

• Low-overhead software dynamic translation using Strata [Scott, et al., CGO 2003]

• Normal Equivalence: Remove the tag bits• Detection Property

– Any (tagged) opcode is invalid on one variant– Injected code (identical on both) cannot run on

both

Page 45: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

45http://www.cs.virginia.edu/evans

Ideal Implementation

• Polygrapher– Identical inputs to variants at same time

• Monitor– Continually examine variants completely

• Variants– Fully isolated, behave identically on

normal inputs

Too expensive for real systems

Page 46: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

46http://www.cs.virginia.edu/evans

Implementation

• Modified Linux 2.6.11 kernel

• Run variants as processes• Create 2 new system calls

– n_variant_fork– n_variant_execve

• Wrap existing system calls– Replicate input– Monitor system calls

V0 V1 V2

Kernel

Hardware

Page 47: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

47http://www.cs.virginia.edu/evans

Wrapping System Calls

• I/O system calls (process interacts with external state) (e.g., open, read, write)– Make call once, send same result to all variants

• Reflective system calls (e.g, fork, execve, wait)– Make call once per variant, adjusted accordingly

• Dangerous – Some calls break isolation (mmap) or escape

framework (execve)– Disallow unsafe calls

Page 48: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

48http://www.cs.virginia.edu/evans 48

ResultsNormalized Latency

0 0.5 1 1.5 2 2.5 3

Saturated

Unsaturated

Unmodified Apache2-Variant, Address Partitioning

2-Variant, Instruction Tagging(1 WebBench client)

(5 hosts * 6 each WebBench clients)

Apache 1.3 on Linux 2.6.11

Latency increase from 2.35 to 2.77 ms

34.2 ms 48.3

ms

17.6 ms

Page 49: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

49http://www.cs.virginia.edu/evans

Big Research Challenges• Useful variations: diversity

effectiveness depends on adversary– Change some property important attack

classes rely on– Don’t change properties application

relies on

• What do we do after detecting attack?– Recover state, generate signatures, fix

vulnerabilities

Page 50: David Evans University of Virginia  Computer Security Research CS696 Fall 2007 17 September 2007

50http://www.cs.virginia.edu/evans

Summary• Computer Security studies computing

systems in the presence of adversaries– Cross-cuts all areas of CS– Projects involving disk drives, RFIDs, OS

kernel, user-level applications, dynamic analysis

• Security Lunches (Wednesdays, 1pm)http://www.cs.virginia.edu/srg/

• Stop by my office Wednesday, 9:30-10:30am or email to set up a time