75
Practical Security Testing for LTE Networks BlackHat Abu Dhabi December 2012 Martyn Ruks & Nils 1 06/11/2012

Practical security testing for lte networks

  • Upload
    pfedya

  • View
    65

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Practical security testing for lte networks

Practical Security Testing for LTE Networks BlackHat Abu Dhabi December 2012 Martyn Ruks & Nils

1 06/11/2012

Page 2: Practical security testing for lte networks

Today’s Talk

• Intro to LTE Networks

• Technical Details

• Attacks and Testing

• Defences

• Conclusions

06/11/2012 2

Page 3: Practical security testing for lte networks

06/11/2012 3

Intro to LTE Networks

Page 4: Practical security testing for lte networks

A Brief History Lesson

• 1G – 1980s Analogue technology (AMPS, TACS)

• 2G – 1990s Move to digital (GSM,GPRS,EDGE)

• 3G – 2000s Improved data services (UMTS, HSPA)

• 4G – 2010s High bandwidth data (LTE Advanced)

06/11/2012 4

Mobile Networks

Page 5: Practical security testing for lte networks

Historic Vulnerabilities

• Older networks have been the subject of practical and theoretical attacks

• Examples include:

• Ability to man in the middle

• No perfect forward secrecy

• No encryption on the back-end

• LTE Advanced addresses previous attacks

06/11/2012 5

Mobile Networks

Page 6: Practical security testing for lte networks

Why is LTE Important?

• We have lived with 3G for a long time

• 4G provides high speed mobile data services for customers

• High level of scalability on the back-end for operators

06/11/2012 6

Mobile Networks

Page 7: Practical security testing for lte networks

06/11/2012 7

Technical Details

Page 8: Practical security testing for lte networks

06/11/2012 8

NodeB Core

Network

Internet Base Station User Back-End

Conceptual View 3G

RNC

Page 9: Practical security testing for lte networks

06/11/2012 9

Network Overview 3G

UE

NB

NB SGSN GGSN Internet

HSS AuC

Core Network

RNC

Page 10: Practical security testing for lte networks

06/11/2012 10

eNodeB

EPC

Internet Base Station User Back-End

Conceptual View 4G

Page 11: Practical security testing for lte networks

06/11/2012 11

Network Overview 4G

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 12: Practical security testing for lte networks

06/11/2012 12

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 13: Practical security testing for lte networks

User Equipment (UE)

• What the customer uses to connect

• Mainly dongles and hubs at present

• Smartphones and tablets will follow (already lots in US)

06/11/2012 13

The Components

Page 14: Practical security testing for lte networks

06/11/2012 14

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 15: Practical security testing for lte networks

evolved Node B (eNB)

• The bridge between wired and wireless networks

• Forwards signalling traffic to the MME

• Passes data traffic to the PDN/Serving Gateway

06/11/2012 15

The Components

Page 16: Practical security testing for lte networks

06/11/2012 16

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 17: Practical security testing for lte networks

Evolved Packet Core (EPC)

• The back-end core network

• Manages access to data services

• Uses IP for all communications

• Divided into several components

06/11/2012 17

The Components

Page 18: Practical security testing for lte networks

06/11/2012 18

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 19: Practical security testing for lte networks

Mobile Management Entity (MME)

• Termination point for UE Signalling

• Handles authentication

events

• Key component in back-end communications

06/11/2012 19

The Components

Page 20: Practical security testing for lte networks

06/11/2012 20

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 21: Practical security testing for lte networks

Home Subscriber Service (HSS)

• Contains a user’s subscription data (profile)

• Typically includes the Authentication Centre (AuC)

• Where key material is stored

06/11/2012 21

The Components

Page 22: Practical security testing for lte networks

06/11/2012 22

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 23: Practical security testing for lte networks

PDN and Serving Gateways (PGw and SGw)

• Handles data traffic from UE

• Can be consolidated into a

single device

• Responsible for traffic routing

within the back-end

• Implements important filtering controls

06/11/2012 23

The Components

Page 24: Practical security testing for lte networks

06/11/2012 24

The Components

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 25: Practical security testing for lte networks

Policy Charging and Rules Function (PCRF)

• Does what it says on the tin

• Integrated into the network core

• Allows operator to perform bandwidth shaping

06/11/2012 25

The Components

Page 26: Practical security testing for lte networks

06/11/2012 26

The Components

UE HeNB MME

SGw PGw PCRF Internet

HSS

EPC

Page 27: Practical security testing for lte networks

Home eNB (HeNB)

• The “FemtoCell” of LTE

• An eNodeB within your home

• Talks to the MME and PDN/Serving Gateway

• Expected to arrive much later in 4G rollout

06/11/2012 27

The Components

Page 28: Practical security testing for lte networks

06/11/2012 28

Control and User Planes

Network Overview

Page 29: Practical security testing for lte networks

06/11/2012 29

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 30: Practical security testing for lte networks

Radio Protocols (RRC, PDCP, RLC)

• These all terminate at the eNodeB

• RRC is only used on the control plane

• Wireless user and control data

is encrypted (some exceptions)

• Signalling data can also be encrypted end-to-end

06/11/2012 30

RRC

PDCP

RLC

The Protocols

Page 31: Practical security testing for lte networks

06/11/2012 31

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 32: Practical security testing for lte networks

Internet Protocol (IP)

• Used by all back-end comms

• All user data uses it

• Supports both IPv4 and IPv6

• Important to get routing and filtering correct

• Common UDP and TCP services in use

06/11/2012 32

The Protocols

IP

Page 33: Practical security testing for lte networks

06/11/2012 33

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 34: Practical security testing for lte networks

The Protocols - SCTP

• Another protocol on top of IP

• Robust session handling

• Bi-directional sessions

• Sequence numbers very important

06/11/2012 34

The Protocols

IP

SCTP

Page 35: Practical security testing for lte networks

06/11/2012 35

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 36: Practical security testing for lte networks

The Protocols – GTP-U

• Runs on top of UDP and IP

• One of two variants of GTP used in LTE

• This transports user IP data

• Pair of sessions are used identified by Tunnel-ID

06/11/2012 36

The Protocols

IP

GTP-U

UDP

Page 37: Practical security testing for lte networks

06/11/2012 37

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 38: Practical security testing for lte networks

The Protocols – GTP-C

• Runs on top of UDP and IP

• The other variant of GTP used in LTE

• Used for back-end data

• Should not be used by the MME in pure 4G

06/11/2012 38

The Protocols

IP

GTP-C

UDP

Page 39: Practical security testing for lte networks

06/11/2012 39

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 40: Practical security testing for lte networks

S1AP

• Runs on top of SCTP and IP

• An ASN.1 protocol

• Transports UE signalling

• UE sessions distinguished by a pair of IDs

06/11/2012 40

The Protocols

IP

S1AP

SCTP

Page 41: Practical security testing for lte networks

06/11/2012 41

The Protocols

UE

eNB

eNB

MME

SGw PGw PCRF Internet

HSS

EPC

Page 42: Practical security testing for lte networks

X2AP

• Very similar to S1AP

• Used between eNodeBs for signalling and handovers

• Runs over of SCTP and IP and is also an ASN.1 protocol

06/11/2012 42

The Protocols

IP

X2AP

SCTP

Page 43: Practical security testing for lte networks

06/11/2012 43

Potential Attacks

Page 44: Practical security testing for lte networks

What Attacks are Possible

• Wireless attacks and the baseband

• Attacking the EPC from UE

• Attacking other UE

• Plugging into the Back-end

• Physical attacks (HeNB)

06/11/2012 44

Targets for Testing

Page 45: Practical security testing for lte networks

Wireless Attacks and the Baseband

• A DIY kit for attacking wireless protocols is now closer (USRP based)

• Best chance is using commercial

kit to get a head-start

• Not the easiest thing to attack

06/11/2012 45

Targets for Testing

Page 46: Practical security testing for lte networks

Attacking the EPC from UE

• Everything in the back-end is IP

• You pay someone to give you IP access to the environment

• Easiest place to start

06/11/2012 46

Targets for Testing

Page 47: Practical security testing for lte networks

Attacking other UE

• Other wirelessly connected devices are close

• May be less protection if seen as a local network

• The gateway may enforce segregation between UE

06/11/2012 47

Targets for Testing

Page 48: Practical security testing for lte networks

Wired network attacks

• eNodeBs will be in public locations

• They need visibility of components in the EPC

• Very easy to communicate with an IP network

• Everything is potentially in scope

06/11/2012 48

Targets for Testing

Page 49: Practical security testing for lte networks

Physical Attacks (eNB)

• Plugging into management interfaces is most likely attack, except …

• A Home eNodeB is a different story

• Hopefully we have learned from the Vodafone Femto-Cell Attack

06/11/2012 49

Targets for Testing

Page 50: Practical security testing for lte networks

06/11/2012 50

What you can Test

Page 51: Practical security testing for lte networks

As a Wirelessly Connected User

• Visibility of the back-end from UE

• Visibility of other UEs

• Testing controls enforced by Gateway

• Spoofed source addresses

• GTP Encapsulation (Control and User)

06/11/2012 51

Tests to Run

Page 52: Practical security testing for lte networks

From the Back-End

• Ability to attack MME (signalling)

• Robustness of stacks (eg SCTP) • Fuzzing

• Sequence number generation

• Testing management interfaces • Web consoles

• SSH

• Proprietary protocols

06/11/2012 52

Tests to Run

Page 53: Practical security testing for lte networks

Challenges

• Spoofing UE authentication is difficult

• Messing with radio layers is hard

• ASN.1 protocols are a pain

• Injecting into SCTP is tough

• Easy to break back-end communications

06/11/2012 53

Tests to Run

Page 54: Practical security testing for lte networks

S1AP Protocol

• By default no authentication to the service

• Contains eNodeB data and UE Signalling

• UE Signalling can make use of encryption and integrity checking

• If no UE encryption is used attacks against connected handsets become possible

06/11/2012 54

Tests to Run

Page 55: Practical security testing for lte networks

06/11/2012 55

Tests to Run

eNB UE MME

S1AP NAS

NAS

S1AP and Signalling

Page 56: Practical security testing for lte networks

06/11/2012 56

Tests to Run

eNB UE

MME

S1AP and Signalling

Spoofed UE

Spoofed eNB

Page 57: Practical security testing for lte networks

06/11/2012 57

Tests to Run

eNB MME

S1AP and Signalling

S1 Setup

S1 Setup Response

Attach Request

Authentication Request

Authentication Response

Security Mode

Page 58: Practical security testing for lte networks

GTP Protocol

• Gateway can handle multiple encapsulations

• It uses UDP so easy to have fun with

• The gateway needs to enforce a number of controls that stop attacks

06/11/2012 58

Tests to Run

Page 59: Practical security testing for lte networks

GTP and User Data

06/11/2012 59

Tests to Run

eNB UE SGw

GTP IP

IP

Internet

IP

Page 60: Practical security testing for lte networks

GTP and User Data

06/11/2012 60

Tests to Run

UE

IP

UDP

GTP

IP

IP

UDP

GTP

eNodeB

Page 61: Practical security testing for lte networks

GTP and User Data

06/11/2012 61

Tests to Run

eNB UE SGw Internet

IP GTP

GTP IP GTP

IP GTP

Page 62: Practical security testing for lte networks

GTP and User Data

06/11/2012 62

Tests to Run

eNB UE SGw

Source IP Address (IP)

Invalid IP Protocols (IP)

GTP Tunnel ID (GTP)

Source IP Address (GTP)

Destination IP Address (IP)

PGw

Page 63: Practical security testing for lte networks

Old Skool

• Everything you already know can be applied to testing the back-end

• Its an IP network and has routers and switches

• There are management services running

06/11/2012 63

Tests to Run

Page 64: Practical security testing for lte networks

06/11/2012 64

Defences

Page 65: Practical security testing for lte networks

The Multi-Layered Approach

• Get the IP network design right

• Protect the IP traffic in transit

• Enforce controls in the Gateway

• Ensure UE and HeNBs are secure

• Monitoring and Response

• Testing

06/11/2012 65

Defences

Page 66: Practical security testing for lte networks

Unified/Consolidated Gateway

• The “Gateway” enforces some very important controls:

• Anti-spoofing

• Encapsulation protection

• Device to device Routing

• Billing and charging of users

06/11/2012 66

Defences

Page 67: Practical security testing for lte networks

IP Routing

• Architecture design and routing in the core is complex

• Getting it right is critical to security

• We have seen issues with this

• This must be tested before an environment is deployed

06/11/2012 67

Defences

Page 68: Practical security testing for lte networks

IPSec

• If correctly implemented will provide Confidentiality and Integrity protection

• Can also provide authentication between components

• Keeping the keys secure is not trivial and not tested

06/11/2012 68

Defences

Page 69: Practical security testing for lte networks

Architecture Consideration

06/11/2012 69

EPC

Internet

eNodeB

MME HSS

Serving Gateway PDN Gateway

Internet

Gateway

EPC Switch

Defences

Page 70: Practical security testing for lte networks

06/11/2012 70

Conclusions

Page 71: Practical security testing for lte networks

• There are 3 key protective controls that should be tested within LTE environments

• Policies and rules in the Unified/Consolidated Gateway

• The implementation of IPSec between all back-end components

• A back-end IP network with well-designed routing and filtering

06/11/2012 71

Conclusion 1

Page 72: Practical security testing for lte networks

• Despite fears from the use of IP in 4G, LTE will improve security if implemented correctly

• The 3 key controls must be correctly implemented

• Testing must be completed for validation

• Continued scrutiny is required

• Legacy systems may be the weakest link

06/11/2012 72

Conclusion 2

Page 73: Practical security testing for lte networks

• Protecting key material used for IPSec is not trivial

• The security model for IPSec needs careful consideration

• Operational security processes are also important

• Home eNodeB security is a challenge

06/11/2012 73

Conclusion 3

Page 74: Practical security testing for lte networks

• More air interface testing is needed

• Will need co-operation from vendors/operators

• “Open” testing tools will need significant development effort

• Still lower hanging fruit if support for legacy wireless standards remain

06/11/2012 74

Conclusion 4

Page 75: Practical security testing for lte networks

06/11/2012 75

Questions

@mwrinfosecurity @mwrlabs