Nearby Threats: Reversing, Analyzing, and Attacking Googles Nearby - - PowerPoint PPT Presentation

nearby threats reversing analyzing and attacking google s
SMART_READER_LITE
LIVE PREVIEW

Nearby Threats: Reversing, Analyzing, and Attacking Googles Nearby - - PowerPoint PPT Presentation

NDSS 2019 @ San Diego, US Nearby Threats: Reversing, Analyzing, and Attacking Googles Nearby Connections on Android Daniele Antonioli 1 , Nils Ole Tippenhauer 2 , Kasper Rasmussen 3 1 Singapore University of Technology and Design (SUTD) 2


slide-1
SLIDE 1

NDSS 2019 @ San Diego, US

Nearby Threats: Reversing, Analyzing, and Attacking Google’s ‘Nearby Connections’ on Android

Daniele Antonioli1, Nils Ole Tippenhauer2, Kasper Rasmussen3

1Singapore University of Technology and Design (SUTD) 2CISPA Helmholtz Center for Information Security 3University of Oxford

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android 1

slide-2
SLIDE 2

What are Google Nearby Connections?

  • Public API for Android and Android Things

◮ In-app proximity-based services ◮ E.g. peer-to-peer file editing

  • Implemented in the Google Play Services

◮ Available across different Android versions ◮ Applications use it as a shared library Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Motivation 2

slide-3
SLIDE 3

Why Analyzing Nearby Connections?

  • Wide attack surface

◮ Android (version ≥ 4.0) and Android Things ◮ Uses Bluetooth and Wi-Fi (at the same time)

  • Proprietary technology

◮ No public specifications ◮ Implementation is closed-source and obfuscated Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Motivation 3

slide-4
SLIDE 4

Our Core Contributions

  • First (security) analysis of Nearby Connections

◮ Uncovers its proprietary mechanisms and protocols ◮ Based on reversing its Android implementation

  • Re-implementation of Nearby Connections (REarby)

◮ Exposes parameters not accessible with the official API ◮ Impersonates nearby devices from any application

  • Attacking Nearby Connections on Android

◮ Connection manipulation and range extension attacks ◮ Responsible disclosure with Google Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Motivation 4

slide-5
SLIDE 5

Nearby Connections Public Information

  • Server advertises a service, client discovers it (sid)
  • Connection strategies: P2P_STAR and P2P_CLUSTER

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Background 5

slide-6
SLIDE 6

Nearby Connections Public Information 2

  • Client and server connect using Bluetooth and/or Wi-Fi
  • Nodes exchange encrypted payloads (peer-to-peer)

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Background 6

slide-7
SLIDE 7

Our Dynamic Binary Instrumentation

  • Workhorse: Frida, https://www.frida.re

◮ Profiling of processes, e.g. NC-App, NC-GPS ◮ Hook function and methods calls ◮ Override parameters and return values ◮ Read and write processes’ memory Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Setup 7

slide-8
SLIDE 8

Reversed Phases of a Nearby Connection

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-9
SLIDE 9

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-10
SLIDE 10

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-11
SLIDE 11

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-12
SLIDE 12

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-13
SLIDE 13

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret 5 Application Layer Connection Establishment: interactive

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-14
SLIDE 14

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret 5 Application Layer Connection Establishment: interactive 6 Key Derivation Functions: session, AES and HMAC keys

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-15
SLIDE 15

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret 5 Application Layer Connection Establishment: interactive 6 Key Derivation Functions: session, AES and HMAC keys 7 Optional Physical Layer Switch: Bluetooth BR/EDR to Wi-Fi

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-16
SLIDE 16

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret 5 Application Layer Connection Establishment: interactive 6 Key Derivation Functions: session, AES and HMAC keys 7 Optional Physical Layer Switch: Bluetooth BR/EDR to Wi-Fi 8 Exchange Encrypted Payloads: 30 seconds timeout

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-17
SLIDE 17

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth BR/EDR name and BLE reports 2 Connection Request: Bluetooth BR/EDR, not authenticated 3 Key Exchange Protocol: establishment of a shared secret 4 Optional Authentication: based on the shared secret 5 Application Layer Connection Establishment: interactive 6 Key Derivation Functions: session, AES and HMAC keys 7 Optional Physical Layer Switch: Bluetooth BR/EDR to Wi-Fi 8 Exchange Encrypted Payloads: 30 seconds timeout 9 Disconnection

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 8

slide-18
SLIDE 18

Key Exchange Protocol (KEP)

Client C Server S Generate skC, pkC Pick NC cC = Hash(pkC) Generate skS, pkS Pick NS Kep1: 1, endpointId, ncname, version Kep2: 2, NC, cC, algo Kep3: 3, NS, pkS Kep4: 4, pkC Verify cC (Sx, Sy) = skS · pkC (Sx, Sy) = skC · pkS

  • Based on ECDH, NIST P256 curve, shared secret is Sx

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 9

slide-19
SLIDE 19

Optional Physical Layer Switch

  • Bluetooth to soft access point (Wi-Fi Direct, hostapd)

◮ Server instructs the client over Bluetooth ◮ Client contacts the server over Wi-Fi Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android RE 10

slide-20
SLIDE 20

Range Extension MitM Attack

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 11

slide-21
SLIDE 21

Range Extension MitM Attack

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 12

slide-22
SLIDE 22

Soft Access Point Manipulation Attack

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 13

slide-23
SLIDE 23

Victim Connects to Attacker’s REarby Server

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 14

slide-24
SLIDE 24

Attacker Manipulates Bluetooth to Wi-Fi Switch

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 15

slide-25
SLIDE 25

Victim Connects to Attacker’s Wi-Fi AP

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 16

slide-26
SLIDE 26

Attacker Configures Victim’s Network Interface

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 17

slide-27
SLIDE 27

Attacker Eavesdrops All Wi-Fi Traffic

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Attacks 18

slide-28
SLIDE 28

Conclusions

  • First security analysis of Nearby Connections
  • Reversed its Android implementation and re-implemented it (REarby)
  • Range extension and soft access point manipulation attacks
  • Try the Soft Access Point Manipulation attack:

https://github.com/francozappa/REarby/tree/master/poc-hostapd

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Conclusions 19

slide-29
SLIDE 29

Conclusions

  • First security analysis of Nearby Connections
  • Reversed its Android implementation and re-implemented it (REarby)
  • Range extension and soft access point manipulation attacks
  • Try the Soft Access Point Manipulation attack:

https://github.com/francozappa/REarby/tree/master/poc-hostapd

  • Thanks for your time! Questions?

Daniele Antonioli Nearby Threats: Reversing, Analyzing and Attacking Google’s ’Nearby Connections’ on Android Conclusions 19