Flip Feng Shui: Hammering a Needle in the Software Stack Ben Gras - - PowerPoint PPT Presentation

flip feng shui hammering a needle in the software stack
SMART_READER_LITE
LIVE PREVIEW

Flip Feng Shui: Hammering a Needle in the Software Stack Ben Gras - - PowerPoint PPT Presentation

Flip Feng Shui: Hammering a Needle in the Software Stack Ben Gras Kaveh Razavi Erik Bosman Bart Preneel 1 Cristiano Giuffrida Herbert Bos August 10, 2016 1 Teaser OpenSSH compromise apt-get compromise by GPG signature forgery No


slide-1
SLIDE 1

Flip Feng Shui: Hammering a Needle in the Software Stack

Kaveh Razavi

Ben Gras

Erik Bosman Bart Preneel1 Cristiano Giuffrida Herbert Bos August 10, 2016

1

slide-2
SLIDE 2

Teaser

◮ OpenSSH compromise ◮ apt-get compromise by GPG signature forgery ◮ No software bug ◮ Weak assumptions ◮ Demo!

1

slide-3
SLIDE 3

Contribution

Flip Feng Shui is a novel exploitation structure

◮ Hardware glitch ◮ Memory massaging primitive

Makes the glitch

◮ Easy to target precisely ◮ Reliable

We demonstrate FFS = Rowhammer + Memory Deduplication

2

slide-4
SLIDE 4

Outline

Flip Feng Shui At Work

3

slide-5
SLIDE 5

Outline

Flip Feng Shui At Work Flip Feng Shui Mechanics

4

slide-6
SLIDE 6

Outline

Flip Feng Shui At Work Flip Feng Shui Mechanics OpenSSH Attack

5

slide-7
SLIDE 7

Outline

Flip Feng Shui At Work Flip Feng Shui Mechanics OpenSSH Attack GPG/APT Updates Attack Demo

6

slide-8
SLIDE 8

Outline

Flip Feng Shui At Work Flip Feng Shui Mechanics OpenSSH Attack GPG/APT Updates Attack Demo Notification, Conclusion & Further Resources

7

slide-9
SLIDE 9

Section 1 Flip Feng Shui At Work

8

slide-10
SLIDE 10

Flip Feng Shui

◮ Flip one bit per page in a co-hosted victim VM ◮ Whenever you know its contents ◮ Organised bitflip ◮ DRAM glitch ◮ Breaks CPU virtualization isolation

9

slide-11
SLIDE 11

Section 2 Flip Feng Shui Mechanics

10

slide-12
SLIDE 12

Flip Feng Shui Mechanics

◮ Co-hosted VMs ◮ Memory deduplication ◮ Rowhammer ◮ RSA

11

slide-13
SLIDE 13

Memory deduplication

12

slide-14
SLIDE 14

Memory deduplication

13

slide-15
SLIDE 15

Memory deduplication

14

slide-16
SLIDE 16

Memory deduplication

15

slide-17
SLIDE 17

Memory deduplication

16

slide-18
SLIDE 18

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

17

slide-19
SLIDE 19

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

18

slide-20
SLIDE 20

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

19

slide-21
SLIDE 21

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

20

slide-22
SLIDE 22

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

21

slide-23
SLIDE 23

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

22

slide-24
SLIDE 24

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

23

slide-25
SLIDE 25

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

24

slide-26
SLIDE 26

Rowhammer

◮ Causes charge to leak in DRAM ◮ DRAM row activations cause flips

25

slide-27
SLIDE 27

Memory deduplication + Rowhammer = FFS

26

slide-28
SLIDE 28

Memory deduplication + Rowhammer = FFS

27

slide-29
SLIDE 29

Memory deduplication + Rowhammer = FFS

28

slide-30
SLIDE 30

Memory deduplication + Rowhammer = FFS

◮ FFS breaks COW

29

slide-31
SLIDE 31

RSA

◮ Public key cryptosystem ◮ Two keys: public and private ◮ Compute secret private from factorization

30

slide-32
SLIDE 32

FFS - What now?

Break weakened RSA.

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 10 20 30 40 50 Factorization Success Probability Available Templates 1024-bit Moduli 2048-bit Moduli 4096-bit Moduli

31

slide-33
SLIDE 33

Section 3 OpenSSH Attack

32

slide-34
SLIDE 34

authorized keys file

Looks like this:

ssh -rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX y7MdVToVAvKB0 /Xven/kqBzfRZm+GITl6sB0u+Aa 3/ UTC3x+eKjB2jf +48 kTP7AvsdbSwg9Q5upN77xX 3 mNGwwj1RUQpOPPc99XH09M84iCydE +9 smYseySf bJQnrov5Ricz2Z18Neuy5ZUH / Ldrf1NSwWoo5NZL 6 tj0E9JvZurMPPk2EqEyHltEFC6OetJwEfaPq9kO glmzFtBWLHR4dF1796JeVkFiWcmMaykAoN +JRF2n MlayPlUxdWR0JwxZ2cJ9la / QLXvv8x0tsORGP9ZG 5 BWqOcD781evuSS3i91BNg6Osl7mlxo6Mc3oUbew /7 ddV08WjdRBn7iQF9WN beng@mymachine

◮ RSA public key ◮ Attacker writes this to memory ◮ We need the private key

33

slide-35
SLIDE 35

OpenSSH FFS attack

34

slide-36
SLIDE 36

OpenSSH FFS attack

35

slide-37
SLIDE 37

OpenSSH FFS attack

36

slide-38
SLIDE 38

OpenSSH FFS attack

37

slide-39
SLIDE 39

OpenSSH Attack

0.2 0.4 0.6 0.8 1 2 4 6 8 10 12 CDF Attack time (mins) successful attacks

◮ Could retry

38

slide-40
SLIDE 40

Section 4 GPG/APT Updates Attack Demo

39

slide-41
SLIDE 41

GPG/APT Updates

◮ With FFS we flip /etc/apt/sources.list ◮ With FFS we flip /etc/apt/trusted.gpg ◮ Use computed private key ◮ Long term RSA Ubuntu signing keys

40

slide-42
SLIDE 42

Section 5 Notification, Conclusion & Further Resources

41

slide-43
SLIDE 43

Notification

◮ Notified: Red Hat, Oracle, Xen, VMware, Debian,

Ubuntu, OpenSSH, GnuPG, some hosting companies

◮ Thank you NCSC ◮ GnuPG commit

42

slide-44
SLIDE 44

Conclusion

◮ Flip Feng Shui breaks isolation ◮ Co-hosting VMs is risky ◮ Disable memory dedup

https://www.vusec.net/projects/flip-feng-shui

43