A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not...

30
SIMulator SIMulator A Security Assessment Tool for Mobile Communications

Transcript of A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not...

Page 1: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIMulatorSIMulatorA Security Assessment Tool for Mobile

Communications

Page 2: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

About usAbout usSebastian Renner ([email protected])Enrico Pozzobon ([email protected])

Page 3: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

2G/3G+ Security Investigation2G/3G+ Security Investigationon IoT Deviceson IoT Devices

Page 4: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

2G Man-in-the-Middle (MITM)2G Man-in-the-Middle (MITM)attackattack

Setting up a pirate base transceiver station (BTS)Make use of weak security mechanisms

Page 5: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Some data is Some data is notnot transferred transferredvia 2G!via 2G!

Page 6: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

3G Authentication3G Authentication

3G Authentication

SIM

SIM

MS

MS

BTS

BTS

Authentication Request (IMSI)

Compute Challenge (K)

Challenge (AUTN, RAND)

Challenge (AUTN, RAND)

Verify AUTN; Compute RES (K)

Response (RES)

Response (RES)

Compare RES

Authentication Response

Page 7: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

3G MITM attack (1/2)3G MITM attack (1/2)

Page 8: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

3G MITM attack (2/2)3G MITM attack (2/2)Use programmable SIM cards!Exchange of the SIM card can be detectedTested SIMs were not fully reprogrammable

Page 9: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication
Page 10: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIM Simulator aka. SIMulatorSIM Simulator aka. SIMulator

Page 11: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

ObjectiveObjectiveReplicate/Clone existing SIMInject custom key material

Page 12: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIM CardsSIM CardsSIMs are basically smartcardsCommunication based on ISO 7816

Command

Response

Files structered in a tree

|CLA|INS|P1|P2|Lc|Data|Le|

|Data|SW1|SW2|

Page 13: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIM Pinout [1]SIM Pinout [1]

Page 14: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIM File Tree [2]SIM File Tree [2]

Page 15: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

ISO7816 card state machineISO7816 card state machine

Page 16: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Example: SELECT FILEExample: SELECT FILEHDR: |00|a4|00|04|02| ACK: a4 DATA: 3f00 NULL: 60 STATE: 612a ---------------------- HDR: |00|c0|00|00|2a| ACK: c0 DATA: 6228820278218.. STATE: 9000

Page 17: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Architecture and DesignArchitecture and DesignSTM32F103 for low layer communicationJavaScript "driver" simulates the file system

Page 18: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

STM32F103C8T6STM32F103C8T6USB CDC serial device

No drivers are neededSuper cheap

~€1.50 for a complete board5 UART interfaces

That can be configured as ISO7816 cardsOr as interfaces (card readers)

Page 19: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication
Page 20: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication
Page 21: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Node.js applicationNode.js applicationSIM file system is defined in a JSON FileComes with some example emulated SIM cards

that can be easily extendedCorrectness of emulation can be "unit tested"The modem can not distinguish an emulated cardand the real one

Page 22: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication
Page 23: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

...but...butThe whole file structure has to be described in JSThe behaviour specific to the SIM card as well

Page 24: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

SIM MITMSIM MITMAPDU forwarding from modem to original SIMSIMulator gets triggered on AUTHENTICATE APDUResponse is spoofed

Page 25: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Use CasesUse CasesPenetration testing modemsUnit testing for smart card-interfacing applicationsSecurity investigations that include SIM/smart cardsRelaying a smartcard over a long distance from areader

Page 26: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Demo TimeDemo Time

Finally!Finally!

Page 27: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

TROOPERS 2019: SIMulator DemoTROOPERS 2019: SIMulator Demo

https://www.youtube.com/watch?v=NcrZvowYPl8

Page 28: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Clone it on GitHub!Clone it on GitHub!https://github.com/strbli/SIMulator

Page 29: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

ReferencesReferences[1] Koscher, Karl and Butler, Eric. The Secret Life of SIM Cards. 2013.[1] Koscher, Karl and Butler, Eric. The Secret Life of SIM Cards. 2013.

URL: URL:

[2] 3rd Generation Partnership Project. 3G TS 31.102 - Characteristics of[2] 3rd Generation Partnership Project. 3G TS 31.102 - Characteristics ofthe Universal Subscriber Identity Module (USIM) application. 1999.the Universal Subscriber Identity Module (USIM) application. 1999.

https://simhacks.github.io/defcon-21/https://simhacks.github.io/defcon-21/

Page 30: A Security Assessment Tool for Mobile · Make use of w eak security mechanisms. Some data is not transferred via 2G! 3G Authentication 3G Authentication SIM SIM MS MS BTS BTS Authentication

Questions?Questions?