77
Base Jumping Attacking the GSM baseband and base station [email protected] Thursday, 14 October 2010

Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

  • Upload
    vannhan

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Base Jumping

Attacking the GSM baseband and base station

[email protected]

Thursday, 14 October 2010

Page 2: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Overview

❖GSM❖Base Station❖Base Band❖Conclusion

2

Thursday, 14 October 2010

Page 3: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM: The Protocol

3

Thursday, 14 October 2010

Page 4: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Documents

4

❖Dozens of docs❖Thousands of pages❖Important one (defines L3)

❖GSM 04 08

Thursday, 14 October 2010

Page 5: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

5

Thursday, 14 October 2010

Page 6: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

6

Thursday, 14 October 2010

Page 7: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

7

Logical Channels

Broadcast Channels (BCH)     Broadcast Control Channel (BCCH)     Frequency Correction Channel (FCCH)     Synchronization Channel (SCH)     Cell Broadcast Channel (CBCH)

Thursday, 14 October 2010

Page 8: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Logical Channels, cont.❖ Common Control Channels (CCCH)     Paging Channel (PCH)     Random Access Channel (RACH)     Access Grant Channel (AGCH)

8

Thursday, 14 October 2010

Page 9: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Logical Channels, cont.

Standalone Dedicated Control Channel (SDCCH)     Associated Control Channel (ACCH)     Fast Associated Control Channel (FACCH)     Slow Associated Control Channel (SACCH)

9

Thursday, 14 October 2010

Page 10: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM Channels

10

❖Opening a channel is slow❖Can take seconds

❖Specific channels for specific uses

Thursday, 14 October 2010

Page 11: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Opening a channel

11

Thursday, 14 October 2010

Page 12: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

12

Thursday, 14 October 2010

Page 13: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

12

RACH

Thursday, 14 October 2010

Page 14: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

12

RACH

AGCH

Thursday, 14 October 2010

Page 15: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

12

RACH

AGCH

LCH

Thursday, 14 October 2010

Page 16: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

13

Thursday, 14 October 2010

Page 17: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

13

PCH

Thursday, 14 October 2010

Page 18: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

13

RACH

PCH

Thursday, 14 October 2010

Page 19: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

13

RACH

PCH

AGCH

Thursday, 14 October 2010

Page 20: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

13

RACH

PCH

AGCH

LCH

Thursday, 14 October 2010

Page 21: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

14

MS

BTS

BTSBSCMSC

ARFCN

Thursday, 14 October 2010

Page 22: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

15

Base Transceiver StationBTS

Base StationController

BSC

Mobile StationController

MSC

Mobile StationMS

Base Station Sub-SystemBSS

Thursday, 14 October 2010

Page 23: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

16

MSBSSMSCHLR

VLR

Thursday, 14 October 2010

Page 24: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Mobile Identifiers

17

Thursday, 14 October 2010

Page 25: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

Thursday, 14 October 2010

Page 26: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

Thursday, 14 October 2010

Page 27: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 28: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 29: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 30: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 31: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 32: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

18

IMSI

IMEI

Thursday, 14 October 2010

Page 33: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM Attacks

19

Thursday, 14 October 2010

Page 34: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

20

Thursday, 14 October 2010

Page 35: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

RACHell

21

❖Request channel allocation❖Flood the BSS with requests❖First announced by Dieter Spaar at DeepSec

❖Prevent everyone from using that cell

Thursday, 14 October 2010

Page 36: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 37: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 38: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 39: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 40: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 41: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

RACHell

Thursday, 14 October 2010

Page 42: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

22

?

RACHell

Thursday, 14 October 2010

Page 43: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

23

Thursday, 14 October 2010

Page 44: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

23

Our Target

Thursday, 14 October 2010

Page 45: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Demo - RACHell

24

Thursday, 14 October 2010

Page 46: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

IMSI Flood

❖Send IMSI ATTACH messages❖pre-authentication❖Overload the HLR/VLR infrastructure❖Prevent everyone using the network

25

Thursday, 14 October 2010

Page 47: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 48: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 49: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 50: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 51: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 52: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 53: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

26

IMSI Flood

Thursday, 14 October 2010

Page 54: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

IMSI DETACH

❖Send multiple Location Update Requests including a spoofed IMSI❖Unauthenticated

❖Prevent SIM from receiving calls and SMS

❖Discovered by Sylvain Munaut

27

Thursday, 14 October 2010

Page 55: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 56: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 57: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 58: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 59: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 60: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 61: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

28

IMSI DETACH

Thursday, 14 October 2010

Page 62: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

How hard to get an IMSI?

29

Thursday, 14 October 2010

Page 63: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Baseband Fuzzing

30

Thursday, 14 October 2010

Page 64: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

31

=+

How to make a smartphone

Thursday, 14 October 2010

Page 65: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

32

Two separate computers

Thursday, 14 October 2010

Page 66: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

32

Two separate computers

Thursday, 14 October 2010

Page 67: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

33

Baseband

❖Controls the radio❖Separate CPU and code base❖RTOS❖Written in C❖Typically legacy code base (decades)

Thursday, 14 October 2010

Page 68: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM Frame Delivery

❖OpenBTS + XML-RPC❖ lch_open(char * IMSI)❖ lch_send(int fd, char *buf, size_t len)❖ lch_recv(int fd, char *buf, size_t len)❖ lch_close(int fd)

34

Thursday, 14 October 2010

Page 69: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM Fuzzing Framework

❖USRP + OpenBTS for delivery❖GSM900 band❖BugMine case generation & mutation❖No Instrumentation

❖Very bad visibility on bugs

35

Thursday, 14 October 2010

Page 70: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Coseinc GSM FuzzFarm❖Targetting

❖ iPhone❖HTC (Android)❖Palm Pre❖Blackberry❖Nokia

36

Thursday, 14 October 2010

Page 71: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

37

Thursday, 14 October 2010

Page 72: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

38

Thursday, 14 October 2010

Page 73: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Conclusion

39

Thursday, 14 October 2010

Page 74: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

GSM Trouble

40

❖GSM is no longer a walled garden❖GSM spec has security problems❖Expect many more issues as OSS reduces costs for entry

Thursday, 14 October 2010

Page 75: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Future work

❖More GSM stack fuzzing❖Next gen protocol stacks

41

Thursday, 14 October 2010

Page 76: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

42

Thanks to

Harald Welte, Osmocom-bb & OpenBTS

Thursday, 14 October 2010

Page 77: Base Jumping - Attacking the GSM BB and BTS - grugq, 2010conference.hackinthebox.org/hitbsecconf2010kul/materials/D2T1 - The... · Base Jumping Attacking the GSM baseband ... (CCCH)

Questions?

43

Thursday, 14 October 2010