Attacks on Android 7 File Based Encryption Ronan Loftus 1 & - - PowerPoint PPT Presentation

attacks on android 7 file based encryption
SMART_READER_LITE
LIVE PREVIEW

Attacks on Android 7 File Based Encryption Ronan Loftus 1 & - - PowerPoint PPT Presentation

Introduction Overview Attacks Conclusion Attacks on Android 7 File Based Encryption Ronan Loftus 1 & Marwin Baumann 1 1 Systems and Network Engineering MSc. University of Amsterdam Research Project 1, 2017 Ronan Loftus & Marwin


slide-1
SLIDE 1

Introduction Overview Attacks Conclusion

Attacks on Android 7 File Based Encryption

Ronan Loftus1 & Marwin Baumann1

1Systems and Network Engineering MSc.

University of Amsterdam

Research Project 1, 2017

Ronan Loftus & Marwin Baumann

slide-2
SLIDE 2

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

Table of Contents

1

Introduction Encryption Landscape Motivation

2

Overview How It’s Made

3

Attacks Remanence Exhaustive Search Authentication Subversion

4

Conclusion Results Recommendations

Ronan Loftus & Marwin Baumann

slide-3
SLIDE 3

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

Encryption Since Android 3.0

‘Full Disk’ Encryption: Encrypts the data partition Major problem: Needs user interaction after reboot

Ronan Loftus & Marwin Baumann

slide-4
SLIDE 4

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

New in Android 7.0

File Based Encryption: Still only encrypts the data partition Each file encrypted with separate key Per user encryption

Ronan Loftus & Marwin Baumann

slide-5
SLIDE 5

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

Why?

Why do people want to encrypt their devices?

Ronan Loftus & Marwin Baumann

slide-6
SLIDE 6

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

Why?

Why do people want to encrypt their devices? To protect data at rest. When device is lost/stolen keep your personal data confidential Businesses can feel more comfortable keeping sensitive data

  • n employee devices

Ronan Loftus & Marwin Baumann

slide-7
SLIDE 7

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

What’s the question?

Our primary research question: Is Android 7 File Based Encryption vulnerable to the same attacks as Full Disk Encryption in previous Android versions?

Ronan Loftus & Marwin Baumann

slide-8
SLIDE 8

Introduction Overview Attacks Conclusion Encryption Landscape Motivation

What’s the question?

Our primary research question: Is Android 7 File Based Encryption vulnerable to the same attacks as Full Disk Encryption in previous Android versions? Kind of. . .

Ronan Loftus & Marwin Baumann

slide-9
SLIDE 9

Introduction Overview Attacks Conclusion How It’s Made

Table of Contents

1

Introduction Encryption Landscape Motivation

2

Overview How It’s Made

3

Attacks Remanence Exhaustive Search Authentication Subversion

4

Conclusion Results Recommendations

Ronan Loftus & Marwin Baumann

slide-10
SLIDE 10

Introduction Overview Attacks Conclusion How It’s Made

How does Full Disk Encryption work?

Uses dm-crypt (u)Randomly created master key (DEK) encrypts data partition using AES-128 (CBC) DEK encrypted with KEK using, at least, AES-128 (CBC) Master key is static until partition wiped.

Ronan Loftus & Marwin Baumann

slide-11
SLIDE 11

Introduction Overview Attacks Conclusion How It’s Made

Full Disk Encryption overview

Ronan Loftus & Marwin Baumann

slide-12
SLIDE 12

Introduction Overview Attacks Conclusion How It’s Made

How does File Based Encryption work?

Two areas encrypted differently This solves the big problem with Full Disk Encryption mentioned earlier.

Ronan Loftus & Marwin Baumann

slide-13
SLIDE 13

Introduction Overview Attacks Conclusion How It’s Made

How does File Based Encryption work?

Many keys

Uses native ext4 filesystem level encryption 512 bit master key is encrypted using AES-256 in GCM mode File names encrypted using AES-256 in CBC-CTS mode File contents encrypted using AES-256 in XTS mode Master key still static!

Ronan Loftus & Marwin Baumann

slide-14
SLIDE 14

Introduction Overview Attacks Conclusion How It’s Made

File Based Encryption overview

Ronan Loftus & Marwin Baumann

slide-15
SLIDE 15

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Table of Contents

1

Introduction Encryption Landscape Motivation

2

Overview How It’s Made

3

Attacks Remanence Exhaustive Search Authentication Subversion

4

Conclusion Results Recommendations

Ronan Loftus & Marwin Baumann

slide-16
SLIDE 16

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Madness

Let’s attack the cryptosystem directly . . .

Ronan Loftus & Marwin Baumann

slide-17
SLIDE 17

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Madness

Let’s attack the cryptosystem directly . . . Nope!

Ronan Loftus & Marwin Baumann

slide-18
SLIDE 18

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Cold Boot

Data remanence attacks rely on cryptographic keys being kept in memory Trusted Execution Environment (TEE) secure area of the main processor Since TEE, keys not stored in RAM

Ronan Loftus & Marwin Baumann

slide-19
SLIDE 19

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Brute Force (online)

Enumerate all the combinations. Always possible in theory! Attack: Using Android Debug Bridge Using On-the-Go protocol Using robot

Ronan Loftus & Marwin Baumann

slide-20
SLIDE 20

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Brute Force (offline)

Qualcomm

no TEE: Image partitions and start cracking

Ronan Loftus & Marwin Baumann

slide-21
SLIDE 21

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Brute Force (offline)

Qualcomm

no TEE: Image partitions and start cracking with TEE: not possible, unless the device has a Qualcomm chip (≈60% of Android devices) The key derivation function is not actually bound to the hardware in Qualcomm chips Been patched in AOSP but still exists in hardware so a downgrade attack is still viable for Full Disk Encryption

Ronan Loftus & Marwin Baumann

slide-22
SLIDE 22

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Brute Force (semi-online)

Try to offload some of the work from the device Make the device do the hardware specific work then compute the rest on a more powerful machine

Ronan Loftus & Marwin Baumann

slide-23
SLIDE 23

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Evil Maid

Classic attack on encrypted devices. Just install a keylogger! Capture users authentication credentials using a non encrypted part of the device Install a new keyboard Subvert code displaying PIN prompts

Ronan Loftus & Marwin Baumann

slide-24
SLIDE 24

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Evil Maid

Subvert "Binder" Input Method Editor

com.android.inputmethod.latin

Ronan Loftus & Marwin Baumann

slide-25
SLIDE 25

Introduction Overview Attacks Conclusion Remanence Exhaustive Search Authentication Subversion

Fingerprints

Becoming far more common for users to authenticate to their cryptosystem via fingerprint With trivial modification to the source, sensor will authenticate anything it can read

Ronan Loftus & Marwin Baumann

slide-26
SLIDE 26

Introduction Overview Attacks Conclusion Results Recommendations

Table of Contents

1

Introduction Encryption Landscape Motivation

2

Overview How It’s Made

3

Attacks Remanence Exhaustive Search Authentication Subversion

4

Conclusion Results Recommendations

Ronan Loftus & Marwin Baumann

slide-27
SLIDE 27

Introduction Overview Attacks Conclusion Results Recommendations

Cold Boot

Since Android 7.0 devices MUST come with a hardware backed keystore (TEE) This renders remanence attacks obsolete!

Ronan Loftus & Marwin Baumann

slide-28
SLIDE 28

Introduction Overview Attacks Conclusion Results Recommendations

Brute Force (online)

Rate limits have been updated since 7.0 Try to subvert the “Gatekeeper”

Ronan Loftus & Marwin Baumann

slide-29
SLIDE 29

Introduction Overview Attacks Conclusion Results Recommendations

Brute Force (offline)

Qualcomm vulnerability has been software patched Downgrade attack would still be possible but . . .

Ronan Loftus & Marwin Baumann

slide-30
SLIDE 30

Introduction Overview Attacks Conclusion Results Recommendations

Brute Force (semi-online)

We theorise that is still possible Untested

Ronan Loftus & Marwin Baumann

slide-31
SLIDE 31

Introduction Overview Attacks Conclusion Results Recommendations

Evil Maid

Hook the binder Dump the credentials to the disk Can also Send over network (out of scope)

Ronan Loftus & Marwin Baumann

slide-32
SLIDE 32

Introduction Overview Attacks Conclusion Results Recommendations

IPCThreadState.cpp

Listing 1: IPCThreadState::talkWithDriver

1

i o c t l ( mProcess− >mDriverFD , BINDER_WRITE_READ, &bwr )

Listing 2: evil_ioctl

1

int e v i l _ i o c t l ( int fd , int

  • p_type ,

binder_write_read ∗ bwr )

2

{

3

int r e s = i o c t l ( fd ,

  • p_type ,

bwr ) ;

4

e v i l _ r e p l y _ m a n i p u l a t i o n ( bwr ) ;

5

return r e s ;

6

}

Ronan Loftus & Marwin Baumann

slide-33
SLIDE 33

Introduction Overview Attacks Conclusion Results Recommendations

Fingerprints

Phone contains modified fingerprintd binary. Listing 3: FingerprintDaemonProxy.cpp

1

callback -> onAuthenticated (device ,

2

// msg ->data. authenticated .finger.fid ,

3

0x1a4 , // non -zero id

4

msg ->data. authenticated .finger.gid);

Ronan Loftus & Marwin Baumann

slide-34
SLIDE 34

Introduction Overview Attacks Conclusion Results Recommendations

Summary of Attacks

Attack needs these conditions to succeed: Attack 7.0+ Requirement Online BF X 1

  • 2

Offline BF X

  • Semi-online BF
  • unlocked bootloader

Cold Boot X unlocked bootloader Evil Maid

  • custom recovery

Fingerprints

  • custom recovery

1unless can subvert gatekeeper 2ADB enabled allows automation Ronan Loftus & Marwin Baumann

slide-35
SLIDE 35

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To AOSP: Encrypt more of the device to reduce attack surface Encrypt (sensitive) binder communications

Ronan Loftus & Marwin Baumann

slide-36
SLIDE 36

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To the user: Turn off root access

Ronan Loftus & Marwin Baumann

slide-37
SLIDE 37

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To the user: Turn off root access Use the stock recovery

Ronan Loftus & Marwin Baumann

slide-38
SLIDE 38

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To the user: Turn off root access Use the stock recovery [re]Lock your bootloader

Ronan Loftus & Marwin Baumann

slide-39
SLIDE 39

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To the user: Turn off root access Use the stock recovery [re]Lock your bootloader Use long complex password

Ronan Loftus & Marwin Baumann

slide-40
SLIDE 40

Introduction Overview Attacks Conclusion Results Recommendations

Recommendations

With great power . . .

To the user: Turn off root access Use the stock recovery [re]Lock your bootloader Use long complex password Have no fun with your device!

Ronan Loftus & Marwin Baumann

slide-41
SLIDE 41

Introduction Overview Attacks Conclusion Results Recommendations

That’s All Folks

Questions? Comments? Critisicms?

Ronan Loftus & Marwin Baumann