Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from...

44
Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012) Best student paper award This slide is modified from http://www.cs.utexas.edu/~suman/publications/oakland12/ Memento.pptx

Transcript of Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from...

Page 1: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Suman Jana and Vitaly Shmatikov

The University of Texas at Austin

Memento: Learning Secrets from

Process Footprints

33rd Security & Privacy (May, 2012) Best student paper award

This slide is modified fromhttp://www.cs.utexas.edu/~suman/publications/oakland12/Memento.pptx

Page 2: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Outline

2012/05/28A Seminar at Advanced Defense Lab2

IntroductionSide channels through /procMementoImplementationEvaluationVariations of the attackSolutions?Summary

Page 3: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Introduction

2012/05/28A Seminar at Advanced Defense Lab3

Implementing whole security mechanism at user mode is very difficult.

Page 4: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Trends in software design

Applications rely on OS abstractions to improve their safety and reliability“Process”“User”

Case study: Web browsers

www.xbank.com www.quickdate.com

Fork a new process

OS isolation

Fork a new process

4 2012/05/28

Page 5: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Unintended consequences

GoodBetter isolationBetter reliability

Others not affected if one process crashes

Better safety

Bad

Leaks more info to concurrent processes

Topic of this talk

5 2012/05/28A Seminar at Advanced Defense Lab

Page 6: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

ProcFS: Process info in multi-user OS

ps

top –p 1

introduced in the 1980s

Tom Killian"Processes as Files" (1984)

cat /proc/1/st

atus

6

Page 7: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

What can one learn from ProcFS?

• IP addrs of websites other users are visiting

7 A Seminar at Advanced Defense Lab 2012/05/28

Page 8: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Side channels through /proc

• "Peeping Tom in the Neighborhood: Keystroke Eavesdropping on Multi-User Systems" - Usenix Security 2009o Keystroke timing leak through ESP/EIP values

from /proc/<pid>/stat

XiaoFeng Wang Kehuan Zhang 8 A Seminar at Advanced Defense Lab 2012/05/28

Page 9: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

The story of "Peeping Tom"

NDSS '09 program committee:

"Nobody uses multi-user computers anymore"

Shout-out toXiaoFeng ;)

9 A Seminar at Advanced Defense Lab 2012/05/28

Page 10: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

The story of "Peeping Tom"

Oakland '09 program committee:

"Nobody uses multi-user computers anymore"

Shout-out toXiaoFeng ;)

10 A Seminar at Advanced Defense Lab 2012/05/28

Page 11: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Nobody uses multi-user computers anymore???

11 A Seminar at Advanced Defense Lab 2012/05/28

Page 12: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Android sandboxing =UNIX multi-user isolation

ps

top –p 1

UNIX multi-users in the 1980s

cat /proc/1/st

atus

12 A Seminar at Advanced Defense Lab 2012/05/28

Page 13: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Android sandboxing =UNIX multi-user isolation

ps

top –p 1

Android “multi-users” in 2012

cat /proc/1/st

atus

13 A Seminar at Advanced Defense Lab 2012/05/28

Page 14: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Android sandboxing =UNIX multi-user isolation

Different apps run as different users

Android uses OS “user” abstraction to isolate applications

14 2012/05/28

Page 15: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Android “multi-users” in 2012

cat /proc/1/st

atus

Android sandboxing =UNIX multi-user isolation

ps

top –p 1

ProcFS API is still unchanged!!

15 A Seminar at Advanced Defense Lab 2012/05/28

Page 16: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

What can a zero-permission app do?

Can read all world-readable files in /proc

• … but “Peeping Tom” attack does not work o ESP/EIP too unpredictable - JVM, GUI etc.

• Introducing “Memento” attacks Works on all major OSs (except iOS)

16 A Seminar at Advanced Defense Lab 2012/05/28

Page 17: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

This is not just about Android!

17 A Seminar at Advanced Defense Lab 2012/05/28

Page 18: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Process resource usage =big-time side channel

Memory usage leaks inputs and user actionsReveals webpages visited in Chrome, Firefox,

Android browser, any WebKit-based browserReveals state of Web applications

Membership in dating sites, specific interests on medical sites, etc.

CPU usage leaks keystroke timingFor bash, ssh, Android on-screen keyboard

handlerYields a better, much more robust “Peeing

Tom”

Completelynew attack!

18 A Seminar at Advanced Defense Lab 2012/05/28

Page 19: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

“Memento” (2000): putting together “memory streams”

19 A Seminar at Advanced Defense Lab 2012/05/28

Page 20: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

“Memento” (2000): putting together “memory streams”

20 A Seminar at Advanced Defense Lab 2012/05/28

Page 21: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Memprint: stream of memory usage

10568 KB15976 KB

11632 KB65948 KB

49380 KB

48996 KB

60280 KB 60820 KB 59548 KB

21 A Seminar at Advanced Defense Lab 2012/05/28

Page 22: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

2050

Sniffing memory footprints

zero-permission malicious process

OS isolation

browser process

alloc 1 alloc 2

OS free page pool

used page countmemprint

2050

22 A Seminar at Advanced Defense Lab 2012/05/28

Page 23: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

2056

Sniffing memory footprints

zero-permission malicious process

OS isolation

browser process

alloc 1 alloc 2

OS free page pool

used page countmemprint

brk/mmap

2050 2056

23 A Seminar at Advanced Defense Lab 2012/05/28

Page 24: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

2080

Sniffing memory footprints

zero-permission malicious process

OS isolation

browser process

alloc 1 alloc 2

OS free page pool

used page countmemprint

brk/mmap

20562050 2080

24 A Seminar at Advanced Defense Lab 2012/05/28

Page 25: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Memprint for Chrome loading benaughty.com

25 A Seminar at Advanced Defense Lab 2012/05/28

Page 26: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Memprint for Chrome loading benaughty.com

26 A Seminar at Advanced Defense Lab 2012/05/28

Page 27: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Memprint for Chrome loading benaughty.com

27 A Seminar at Advanced Defense Lab 2012/05/28

Page 28: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Full attack

OS isolation

browserzero-permission

app

/proc/pid/statm

memprint

memprint database

28 A Seminar at Advanced Defense Lab 2012/05/28

Page 29: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Implementation

2012/05/28A Seminar at Advanced Defense Lab29

Measuring the target’s memory footprintLinux and Anddroid

/proc/<pid>/statm drs (data resident size) [link]FreeBSD

kvm_getprocs [link]Windows

Performance Data Helper (PDH) library [link]

Page 30: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Environment

2012/05/28A Seminar at Advanced Defense Lab30

ChromeVersion: 13.0.782.220Measure the render process

FirefoxVersion: 3.6.23Monolithic browser

Using fresh browser

AndroidVersion: 2.2 Froyo in the x86 simulatorThe results are the same for 3.1 Honeycomb

in Google’s ARM simulator.

Page 31: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Building the signature database

2012/05/28A Seminar at Advanced Defense Lab31

A memprint is a set of (E, c) tuples. E is an integer representing a particular

footprint sizec is how often it was observed during

measurement.Ex:

ALEXA TOP 1,000:

Page 32: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Similarity

2012/05/28A Seminar at Advanced Defense Lab32

21

2121

21212211

21212211

,:_

,max,,,

,min,,,

mm

mmmmJindexJaccard

mmccEmcEmcE

mmccEmcEmcE

Page 33: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Why the attack works

• Memprints are unique (for up to 43% of webpages)

• Can tune recognition to achieve zero false positives

• Memprints are stable• … across repeated visits to the same page

memprints are OS/browser-

dependent but machine-

independent

33

Page 34: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Cross-page similarity for 100 random pages out of Alexa top 1000

Different from others

Similar tothemselves

web

pag

e ID

web page ID

similarity = Jaccard index of memprints

34 A Seminar at Advanced Defense Lab

Page 35: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

35 2012/05/28A Seminar at Advanced Defense Lab

Evaluation

Distinguishability

A page is distinguishableDistinguishability > 0

values.similarity ofdeviation standard theis

values,similarity ofmean theis

,habilitydistinguisOrigin

neighborneighbortargettarget

MinMax

ilitytinguishaborigin dis

ormalize)hability(nDistinguis

Page 36: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

36 2012/05/28A Seminar at Advanced Defense Lab

100 random pages, 1,000-page ambiguity set

Page 37: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

37 2012/05/28A Seminar at Advanced Defense Lab

If the threshold makes no false positive

100 random distinguishable pages

Page 38: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

38 2012/05/28A Seminar at Advanced Defense Lab

Variations of the attack

Only focus changes caused by allocating or de-allocating large images.

Inferring the state f Web sessions.Add secondary side channel information

Ex : CPU scheduling statistics

Page 39: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Fine-grained info leak: OkCupid

is login successful

?

no

yes

memory usage

increases by 1-2 MB

is a paidcustomer

?

no

memory usage increases by

27-36 MB

no new flash player plugin

process

new flash player plugin

process to display ads

yes

39 A Seminar at Advanced Defense Lab 2012/05/28

Page 40: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Concurrent processes don't hurt, sometimes make it even better!!

40 A Seminar at Advanced Defense Lab 2012/05/28

Page 41: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Memento attacks: CPU usage info

• Monitor /proc/<pid>/status for number of context switches

Infer inter-keystroke timing for bash, ssh, Android on-screen keyboard handler etc. o Processing each keystroke requires a

predictable number of context switcheso Keystroke processing time << keystroke

interval

sufficient to reconstruct typed text

[Zhang and Wang]

41 2012/05/28

Page 42: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Keystroke timing (Android MMS app)

42 A Seminar at Advanced Defense Lab 2012/05/28

Page 43: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

Solutions?

Increasing reliance on OS isolation makes these attacks easier OS problem, not an application problem

• Disable /proco FreeBSD: no /proc, but attacker can still

measure victim's memory footprint via kvm_getprocs

Stop reporting fine-grained resource usage across “user” boundary Only report info for user's own processes Breaks tools like ps, top etc.

43 A Seminar at Advanced Defense Lab 2012/05/28

Page 44: Suman Jana and Vitaly Shmatikov The University of Texas at Austin Memento: Learning Secrets from Process Footprints 33 rd Security & Privacy (May, 2012)

does NOT need the API

needed the API

Summary

• Process info API o A legacy of the 1980so Reveals process's resource usage - CPU, mem,

netwo A single measurement is harmless (most of the

time)o Dynamics of processes’ resource usage = high-bandwidth side channel

Memento attacks o OS designers must rethink process info API

44 2012/05/28