peeping tom in the neighborhood: keystroke eavesdropping ... · of stack esp (current stack...

39
Peeping Tom in the Neighborhood: Keystroke Eavesdropping on Multi-User System Kehuan Zhang, XiaoFeng Wang Indiana University

Upload: others

Post on 11-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Peeping Tom in the Neighborhood: Keystroke Eavesdropping on Multi-User System

Kehuan Zhang, XiaoFeng WangIndiana University

Page 2: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

What I will talk about…

The discovery of a new vulnerability in the shared information on multi-user systemsAn example of attack

To infer the key input by the victim

Page 3: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Information Sharing on Multi-user Systems

Has the license already been

checked out by Bob?

Electronic Design Automation (EDA) Server which has only one valid license to do circuit

simulation

Page 4: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

The output of top(1) program

Page 5: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

The procfs (process file system)

A pseudo file systemProvides information about the system and each process

Page 6: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

System information provided by procfs

Page 7: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

File contents in /proc/interrupts

Page 8: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

File contents in /proc/slabinfo

Page 9: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Process-related information

zkh@zkh-iu-office:/proc/13936$ ps13936 pts/0 00:00:00 bash13996 pts/0 00:00:00 pszkh@zkh-iu-office:/proc/13936$ lsattr cpuset io mountinfo pagemap statauxv cwd latency mounts root statmcgroup environ limits mountstats sched statusclear_refs exe loginuid net schedstat taskcmdline fd maps oom_adj sessionid wchancoredump_filter fdinfo mem oom_score smaps

Page 10: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

15146 (bash) S 15144 15146 15146 34816 15279 4194304 4389 27503 0 0 18 4 51 25 20 0 1 0 27457355 6582272 953 4294967295 134512640 135216992 3216531696 3216530760 3086509104 0 65536 3686404 1266761467 3222492509 0 0 17 1 0 0 0 0 0

Content of /proc/<pid>/statimage name Starting address

of stack

ESP (Current stack pointer)

EIP (Current instruction pointer)

Page 11: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Contents of /proc/<pid>/maps

Page 12: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Privacy Implications

All the information mentioned is globally readableKey inference (this paper)Others

Trace program execution pathInfer user behavior or input dataASLR (Address Space Layout Randomization)

Page 13: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Multi-user system

Shared Information

What we did – keystroke eavesdropping

Victim’sprocess procfs

Attacker’sShadowprocess

typing

ESPchanges

ESPvalues

ESP tracesKeystroke timingKeystroke contents

Page 14: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Related work

Keystroke inference has been well studiedSsh traffic [SWT 2001]Keyboard acoustic [AA 2004, ZZT 2005,BWY 2006]Electromagnetic emanation [VP 2009]

What is differentA new and more accurate way to get keystroke timingUse semantic information to get multiple timing sequencesNovel technology to get better results from multiple sequences

Page 15: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Contributions

Discover a new vulnerability in process file systemDevelop techniques to exploit this vulnerability to determine keystroke timingAugment the keystroke analysis technique with semantic information

Page 16: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Assumptions

Multi-user systemCapability to execute programsMulti-core CPU

Page 17: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Linux System

VictimIs typing

Victim’sprocess procfs

Attacker’sShadowprocess

ESPtraces HMM

List ofPossible

inputs

Overview of the attack

STEP 1: Extract the ESP variation pattern of a keystroke event

STEP 2: Log the ESP trace at background

STEP 3: Detect the keystroke timing from trace

STEP 4: Infer the Keystroke through timing analysis

Page 18: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Step 1: Extract ESP patterns of keystrokes

Consists of ESP value when a system call is madeSystem call is time consumingCan be reliably captured by the shadow programMost ESP values captured are belonging to system call

Two types of programDeterministic Non-deterministic

Page 19: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Extract pattern for deterministic programs

Examples: Vim, sshdUse differential analysis techniqueModify strace source code to output the ESP value when a system call is madeExample

First run without any keystroke

Second run with a single keystroke100 120 108 112

100 120 108 112 103 119 122 139

Pattern

Page 20: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Extract pattern for non-deterministic programs

Examples: GeditDriven by random Events

• like cursor blinks, screen refresh, buffer flush

Solution: Use instruction level analysis

Page 21: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Example: GTK+ Event loop in GeditStart ESP

Output

Stop ESP Output

Event processing

Page 22: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Step 2: Log ESP traces

Using a shadow processMake it efficient as much as possible

Written in assembly languageEach sample has only two system calls: lseek() and read()Use a buffer to reduce cost of writing data to disk

Page 23: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Step 3: Determine keystroke timings

Challenge:To recognize a keystroke event from an incomplete ESP trace

SolutionConvert into a LCS (longest common subsequence) problem

• Let X be “ABCDEFG" and Y be “BGCEHAF". The longest common subsequence between X and Y is “BCEF".

• We regard each ESP value as a unique character • Using existed dynamic programming algorithms

Page 24: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Examples: Determine keystroke timings

Page 25: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Step 4: Key Inferences

Use the Hidden Markov Model (HMM)Based on the n-Viterbi algorithmOur contribution:

Leverage the information from multiple timing sequences

Page 26: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Limitation of single timing sequence

yt

q2 q1

Page 27: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

y1 y2y3 y6y5 y4y7 y

q2

q1

Multi-sequence approach 1: Averaging

Page 28: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Multi-sequence approach 2: Combined probability

y1 y2y3 y6y5 y4y7

q2

q1

●●●

●● ● ●

∏∏==

<7

12

7

11 )|Pr()|Pr(

i

it

i

it qyqy

● ●

Page 29: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Evaluations

Things to be evaluatedThe accuracy of the keystroke timing detectedThe performance of key sequence inference

Three sample applicationsVimsshdGedit

PlatformIntel Core 2 Duo E6700, 3GB RAMRed Hat Linux Enterprise 4

Page 30: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Timing accuracy

Page 31: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Impacts of server workloads

Percentage of keystrokes detected vs. CPU usage

Page 32: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Impacts of server workloads

CPU usage history of three real-world severs within 72 hours

Page 33: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Evaluation of password inference

Acquire the training data for HMMGenerate three passwords randomlyGet 50 timing sequences for each passwordRun HMM to generate a list of guessed passwordsIdentify the position of the real password on the listCalculate the percentage of the search space

Page 34: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Key Inference -- password

Page 35: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Evaluation of English word inference

Build a dictionaryDrawn words from the dictionary randomlyGet a keystroke timing for each wordAsk HMM to output a list of guessed wordsDelete invalid output which is not appear in the dictionaryFind the position and calculate the percentage

Page 36: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Key Inference – English words

Page 37: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Discussion

Other UNIX-like systemsNo ESP/EIP informationBut provide CPU time information for system calls

DefensePatch the kernelNeed a complete evaluation about the information leakage

Page 38: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Conclusion

Privacy vulnerability in the process file systemKeystroke inference attack

Further studyOther attacksPotential mitigation technology

Page 39: Peeping Tom in the Neighborhood: Keystroke Eavesdropping ... · of stack ESP (Current stack pointer) EIP (Current instruction pointer) ... Based on the n-Viterbi algorithm Our contribution:

Q & A