hacking cellular networks...hacking cellular networks security research with open source cellular...

36
Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam

Upload: others

Post on 10-Mar-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Hacking Cellular Networks Security Research with Open Source

Cellular Network Projects

HUANG Lin

Qihoo 360

ZOU Xiaodong

Hiteam

Page 2: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Agenda

• Who we are & why we are giving this talk

• Security testing of LTE – Specification vulnerabilities – Implementation flaws: network & terminals – Testing setup

Page 3: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Who we are

• Huang Lin – Wireless security researcher from Qihoo 360 – Worded in Orange from 2005~2014 – SDR expert, use OAI since 2011

• Zou Xiaodong (aka Seeker) – Founder & CEO, HiTeam Group, a higher education +

IT company – 30+ year coding & hacking – Angel investor & entrepreneurship mentor

Page 4: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

4

Hackers – A Big Group of SDR Users

Short distance: Bluetooth, RFID, NFC Wifi, Zigbee, 315/433MHz Cellular: 2G/3G/4G Satellite system: GPS, GlobalStar, DVB-S Private protocol: private network, links of drones Industry control system

$4000 $750 $300

AD936x 60MHz ~ 6GHz

LMS600x/700x 100KHz ~ 3.8GHz

Using wideband SDR tools to analyze many kinds of wireless systems

¥100

Page 5: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Video Demo: GPS Spoofing

Page 6: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Fake GSM Base Station in China

• Resulting in a wide range of hazards – Send spam SMS – Phishing fraud

Page 7: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

When Bike-sharing Meets Fake BS

• For IoT devices – Lose network

connection – Data link hijack

Page 8: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Most Fake BS Based on OpenBTS

• OpenBTS Project – Developed since 2009 – First software based cellular base station – Had some real deployments

St. Pierre and Miquelon is a self-governing territorial overseas collective of France (COM) situated near Newfoundland, Canada. An entrepreneur,GlobalTel, applied for wireless spectrum and deployed seven base stations, now actively serving a population of 6,000.

Page 9: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

GSM Terminal Side: OsmocomBB

• OsmocomBB – GSM sniffer: OsmocomBB

+ C118 – GSM man-in-the-middle

attack: OsmocomBB + C118 + OpenBSC

Multiple C118s listening the GSM channels simultaneously.

Page 10: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

3G Base Station: Osmocom Accelerate3g5 Project

• Femtocell + Open source CN – Femto: nano3G – CN: HNB-GW, SGSN, GGSN, VLR, HLR, PGW

Page 11: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

4G Security Research • Related works

– Ravishankar Borgaonkar, Altaf Shaik, et.al., LTE and IMSI Catcher Myths, BlackHat Europe, 2015 (OpenLTE)

– Roger Piqueras Jover, LTE Security and Protocol Exploits, ShmooCon 2016

– Lin Huang, Forcing Targeted LTE Cellphone into Unsafe Network, HITB AMS Security Conference, 2016. (OpenLTE)

– Xiaodong Zou, Advanced Fake Base Station Exploitations, KCon Hacking Conference, August 2016. (OAI)

– Stig F. Mjølsnes, Ruxandra F. Olimid, Easy 4G/LTE IMSI Catchers for Non-Programmers, Feb. 2017. (OAI)

Page 12: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

4G Exploitations

IMSI Catcher DoS Attack

Redirection Attack

These exploitations are all related to 4G fake base station. There may be quite a lot IMSI catcher based on OAI.

Page 13: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Video Demo: Redirection Attack

Page 14: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Cellular Projects Summary

2G 3G 4G Network side

OpenBTS OpenBSC

OpenBTS-UMTS Osmocom Accelerate3g5

OAI OpenLTE/srsLTE

Terminal side

OsmocomBB N/A OAI UE srsUE

Page 15: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Expectation to 5G: Security Response Capability

• In IT/Internet area – Not every vulnerability needs to be fixed – Once exploitation appears, and widely known,

the patch will be applied immediatly

• In mobile communication – Network side

• Operators: update network equipment needs long tim

• Vendors: Some old hardware cannot be updated. – Terminal side

• Cellphone firmware is rarely updated • It’s difficult to patch IoT devices.

Page 16: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Programmable, Configurable and Patchable

• Network equipment becomes softer – Soft-CN: NFV, SDN etc, more mature – Soft-RAN: developing

• Terminal chipset becomes softer too – Programmable, especially for higher layers – Fix vulnerability and add new feature by

updating firmware

FCC DA 16-1282 NOI document, mentions one requirement to 5G security: patch management

Page 17: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Security Testing of LTE/LTE-A

• Specification vulnerabilities • UE implementation flaws • Network:

– Implementation flaws – Configuration issues

Page 18: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Specification Vulnerabilities

• RRC redirection • RLF report

Page 19: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

UE Implementation Flaws

• Network authentication • Data encryption • Security procedure of baseband OTA • Robustness of baseband • SMS sender spoofing • VoLTE

Page 20: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Network Authentication

• AUTN • AS EIA0 • NAS EIA0 • MAC null • Bypass?

Page 21: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Data Encryption

• AS EEA0 • NAS EEA0 • Unencryption?

Page 22: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

UE HSS MME eNodeB 1a. Authentication and Key Agreement

2. NAS Security Mode Command (EEAX, EIAX)

3. AS Security Mode

Command (EEAX, EIAX)

1b. Authentication

Information Request

Encoding Integrity Ciphering Algorithm X000X000 EIA0 EEA0 NULL X001X001 128-EIA1 128-EEA1 SNOW3G X010X010 128-EIA2 128-EEA2 AES X011X011 128-EIA3 128-EEA3 ZUC

Security algorithms are selected by the provider

Security Algorithms

Page 23: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

UE K

HSS K

1. Authentication Information Request (IMSI)

2. Authentication Information Answer (RAND, XRES, AUTN, KAMS E)

a) Check AUTN b) Compute RES c) Compute K AMSE

Check RES == XRES

1. Authentication and Key Agreement

eNodeB MME

Attach Request (IMSI)

3. RRC Security Mode Command

2. NAS Security Mode Command 1. NAS Security Mode Command

(EIA, EEA, MAC(EIA,EEA))

2. NAS Security Mode Complete MAC()

3. Authentication Request (RAND, AUTN)

4.Authentication Response (RES)

1. Initial Context Setup (KeNodeB) 2. RRC Security Mode Command

(EIA, EEA, MAC(EIA,EEA)) 3. RRC Security Mode Complete

MAC()

Attach Accept

Attach Complete

Security Procedure

Page 24: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Network Configuration Issues

• Visibility of the back-end from UE • Visibility of other UEs • GTP over GTP? • Ability to attack MME (signalling)

Page 25: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Network Implementation Flaws

• Robustness of stacks (eg SCTP) – Fuzzing – Sequence number generation

• Management interfaces – Web UI – SSH consoles – Proprietary protocols

Page 26: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

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

40

Key Protocols

Page 27: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

eNB UE MME

S1AP NAS

NAS

S1AP and Signalling

Key Protocols

Page 28: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

eNB UE

MME

S1AP and Signalling

CompromisedUE

Spoofed eNB

Key Protocols

Page 29: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

eNB MME

S1AP and Signalling

S1 Setup S1 Setup Response Attach Request

Authentication Request

Authentication Response

Security Mode

Key Protocols

Page 30: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

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

Key Protocols

Page 31: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

GTP and User Data

eNB UE SGw

GTP IP

IP

Internet

IP

Key Protocols

Page 32: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

GTP and User Data

UE

IP

GTP

UDP

IP

GTP

UDP

IP

eNodeB

32 11/09/2012

Key Protocols

Page 33: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

GTP and User Data

eNB UE SGw Internet

IP GTP

GTP IP GTP

IP GTP

Key Protocols

Page 34: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

GTP and User Data

eNB UE SGw

Source IP Address (IP)

Invalid IP Protocols (IP)

GTP Tunnel ID (GTP)

Source IP Address (GTP)

Destination IP Address (IP)

PGw

34 11/09/2012

Key Protocols

Page 35: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Testing Setup (Phase 1) • EPC: Gigabyte Brix i7-5500, 16G RAM • eNodeB/RRU:

– UP Board + USRP B210/B200mini – ThinkPad T440s + bladeRF/LimeSDR

• UE: Samsung, iPhone, OnePlus, ZTE, etc.

Page 36: Hacking Cellular Networks...Hacking Cellular Networks Security Research with Open Source Cellular Network Projects HUANG Lin Qihoo 360 ZOU Xiaodong Hiteam Agenda •Who we are & why

Thank you!

Resource list

Xiaodong Zou Wechat: 70772177 Twitter: @xdzou Email: [email protected]