SIM card exploita9on. Karsten Nohl SRLabs Template v12



Similar documents
SIM card exploita9on. The SRLabs Team. SRLabs Template v12

BadUSB On accessories that turn evil

UAB Cyber Security Ini1a1ve

Mobile self- defense. Karsten Nohl SRLabs Template v12

@msecnet / Bogdan ALECU

Invest in security to secure investments. Breaking SAP Portal. Dmitry Chastuhin Principal Researcher at ERPScan

Defending mobile phones. Karsten Nohl, Luca Melette,

Karsten Nohl, Breaking GSM phone privacy

Mobile Applica,on and BYOD (Bring Your Own Device) Security Implica,ons to Your Business. Dmitry Dessiatnikov

Phone Systems Buyer s Guide

Security testing the Internet-of-things

How To Protect Virtualized Data From Security Threats

Mobile network security report: Poland

Security features include Authentication and encryption to protect data and prevent eavesdropping.

CSA SDP Working Group

Alexander Polyakov CTO ERPScan

Mobile network security report: Norway

VoIP Security How to prevent eavesdropping on VoIP conversa8ons. Dmitry Dessiatnikov

Interna'onal Standards Ac'vi'es on Cloud Security EVA KUIPER, CISA CISSP HP ENTERPRISE SECURITY SERVICES

Kaseya Fundamentals Workshop DAY THREE. Developed by Kaseya University. Powered by IT Scholars

Mobile network security report: Netherlands

Mobile network security report: Belgium

Mobile network security report: Greece

Mobile network security report: Germany

The Seven Habits of State-of-the-Art Mobile App Security

BlackBerry 10.3 Work and Personal Corporate

Mobile network security report: Poland

Data Management in the Cloud: Limitations and Opportunities. Annies Ductan

Privacy- Preserving P2P Data Sharing with OneSwarm. Presented by. Adnan Malik

Protocol Rollback and Network Security

Security Evaluation CLX.Sentinel

Main Research Gaps in Cyber Security

Computer Security Incident Handling Detec6on and Analysis

CS 356 Lecture 17 and 18 Intrusion Detection. Spring 2013

HIPAA Breaches, Security Risk Analysis, and Audits

Princeton University Computer Science COS 432: Information Security (Fall 2013)

DDOS Mi'ga'on in RedIRIS. SIG- ISM. Vienna

Bacula Open Source Project Bacula Systems (professional support)

Palo Alto Networks Cyber Security Platform for the Software Defined Data center. Zekeriya Eskiocak Security Consultant Palo Alto Networks

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

Wireless Networks: Network Protocols/Mobile IP

CRYPTOGRAPHY AS A SERVICE

Effec%ve AX 2012 Upgrade Project Planning and Microso< Sure Step. Arbela Technologies

Still Aren't Doing. Frank Kim

Software Defined Perimeter

Defending Behind The Device Mobile Application Risks

Thanks for showing interest in Vortex IIT Delhi & What After College (WAC) Ethical Hacking Workshop.

GSM security country report: Germany

: Network Security. Name of Staff: Anusha Linda Kostka Department : MSc SE/CT/IT

That Point of Sale is a PoS

SMS Fuzzing SIM Toolkit Attack

What is network security?

PLATFORM ENCRYPTlON ARCHlTECTURE. How to protect sensitive data without locking up business functionality.

IPv6 and DDoS Protec0on: Securing Carrier Grade NAT Infrastructure

PICKPOCKETING MWALLETS. A guide to looting mobile financial services

NETWORK DEVICE SECURITY AUDITING

Message Authentication Codes

A WOLF IN SHEEP'S CLOTHING The Dangers of Persistent Web Browser Storage

Privileged Administra0on Best Prac0ces :: September 1, 2015

Mobile Security. Practical attacks using cheap equipment. Business France. Presented the 07/06/2016. For. By Sébastien Dudek

10 Potential Risk Facing Your IT Department: Multi-layered Security & Network Protection. September 2011

SecureDoc Disk Encryption Cryptographic Engine

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 6. Wireless Network Security

Top 10 most interes.ng SAP vulnerabili.es and a9acks

Some Security Challenges of Cloud Compu6ng. Kui Ren Associate Professor Department of Computer Science and Engineering SUNY at Buffalo

Rational AppScan & Ounce Products

Chapter 7: Network security

Mobile Security. Luther Knight Mobility Management Technical Specialist, Europe IOT IBM Security April 28, 2015.

Information Security for the Rest of Us

GSM security country report: USA

Loophole+ with Ethical Hacking and Penetration Testing

Security within a development lifecycle. Enhancing product security through development process improvement

Transcription:

SIM card exploita9on Karsten Nohl <nohl@srlabs.de> SRLabs Template v12

SIM cards are fully programmable computer systems Applica'ons on modern SIM card Smartcard with real- 9me opera9ng system Basic func'ons Iden9fica9on (IMSI) Authen9ca9on (Ki & Hash func9on) Simple file system Address book SMS messages Session keys Java virtual machine Custom Java apps Roaming mgmt Payment Tracking 2

SIM have many security layers from smartcards to cryptography and Java process separa9on SIM card includes various protec'on mechanisms User authen'ca'on by simple comparison SIM authen'ca'on by cryptographic hash func9on (oren Comp128 in GSM; Milenage in 3G/4G) A Secure Java deployment using DES/3DES/AES signature + encryp9on PIN/PUK numbers Ki OTA keys B Applica'on separa'on: Java VM sand boxing Individual protec9on logic for banking applets, iden9fica9on applets, etc. Storage protec'on through proprietary smartcard security mechanisms Java crypto API: DES/3DES/AES; some9mes RSA 3

Agenda SIM card background A GeDng on to the SIM B Stealing SIM secrets 4

OTA security level is chosen by server while SIM enforces mandatory minimum level ILLUSTRATIVE OTA server ini9ates remote transac9on Binary SMS communica'on Target app / key set # Command possibly encrypted and/or signed Used security level Response protected according to request, but not below minimum level stored on card Reque- sted security level SIM card stores mul9ple key sets, possibly with different protec9on levels Key set 1 Encry- p9on Signa- ture Key set 3 Key set 2 DES 3DES AES Man- datory ü 5

OTA error handling is underspecified, possibly opening agack surface Binary SMS communica'on AOacker probes cards to gain material for DES key cracking Command with wrong signature Use: DES signature Request: DES signature Response to mal- signed request differs by card type a. (25%* of cards) (No response) SIM card with DES key (prevalence of DES keys varies between operators; can be up to 100%) b. (50%*) c. (25%*) Error message Error message Some9mes with all- zeros signatures DES signature Data useable for key cracking * Es9mated from a geographically skewed measurement set 6

OTA DES do not withstand key cracking Challenge: Derive 56 bit DES key from OTA response signature Cracking strategies Investment Cracking 'me Be pa'ent Brute force on GPU EUR 1.000 6 months Throw money at it Brute force on PGA cluster EUR 50.000 1 day Ride the rainbow Time- memory trade- off using large hard disks & GPU EUR 1.500 + 1 year pre- computa9on Only possible when OTA response is fully predictable 1 minute (but <100% success rate) 7

Agacker SMS can request DES- signed SMS response with fully predictable content Command packet is sent by the agacker to provoke response UDHI PID 1 127 DCS 246 Agack- specific features UDH CPL CHL SPI KIc KID TAR CNTR PCNTR CC Data 027000 Packet Header No DES App 01 Padding Rand. length length cipher signature counter invalid No ciphering Sign PoR request Generic command Packet details: 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 No ciphering Cryptographic checksum Do not cipher PoR Sign PoR Send PoR in any case Response packet may offer agack surface UDH RPL RHL TAR CNTR PCNTR Status Code CC 027100 Packet length Header length App 01 Padding counter Status Code Crypto- Checksum Data Response or No response Signature over predictable data useable for rainbow table key cracking 8

Pre- computa9on tables store DES code book in condensed form E233 206 503A OCE DB18 22CB B951 CA3 A83 CA3 77C 77C Collision 87A4 49A6 118 B33 The uncondensed code book is 100 s of Petabyte. Tables provide a trade- off: Longer chains := a) less storage, b) longer agack 9me 9

Table op9miza9on 1: Dis9nguished point tables save hard disk lookups 7707 BEO 6100 B00 44B2 415 44B2 A200 A200 Collision CA06 302 B400 Only one hard disk access needed instead of one for each chain link 10

Table op9miza9on 2: Rainbow tables mi9gate the effect of collisions E233 1 44B2 2 BBA8 3 1B22 Collision DB18 1 ODE3 2 44B2 3 5DE2 22CB 1 6C7A 2 55D2 3 922A 1 2 3 87A4 116 362E C7D5 Rainbow tables have no mergers, but quadra9cally growing agack 9me 11

Video: Remotely cracking OTA key Video source: hgp://www.heise.de/security/ar9kel/des- Hack- exponiert- Millionen- SIM- Karten- 1920898.html 12

OTA agacks extend beyond DES signatures Many mobile operators responded to the looming SIM hacking risk considerate and faster than we could have wished for. Others quickly concluded they were not affected: Operator statements We use encryp9on instead of signa- tures; the agack does not apply here Does it make sense? No. Encryp9ng a known plaintext with DES is as bad as signing it. Even when both are required, the agack s9ll applies (but needs two rainbow tables) We don t even use OTA No. virtually all SIMs are Java cards. Even if you are not using those capabili9es, an agacker may (and will probably find that you never cared to update the keys of this virtual waste land) We only use 3DES Maybe. 3DES is good, but have you made sure to use full entropy 112/168 bit keys instead of mul9ple copies of a 56 bit key? changed all the standard keys? heard of downgrade a*acks? 13

or some cards, even 3DES keys are crackable Downgrade aoack flow AOacker Crack first third of key Command Error Command Request DES- signed response (KID = 1) DES- signed Request 2- key 3DES response (KID = 5) Some SIM cards with 3DES key use lower signature schemes when requested (in viola9on of the standard) Crack second third* Crack final third* Error Command Error 2- key 3DES- signed Request 3- key 3DES response (KID = 9) 3- key 3DES- signed 2- key 3DES DES 56 bit 3- key 3DES 56 bit 56 bit * Must be brute- forced; Rainbow table agack no longer possible 14

OHM 2013 workshops confirm vulnerability and point to next issues Signature disclosure Cards s9ll disclose signatures even though: Many cards got patched over last 2 weeks OHM par9cipants use newer SIM cards than average 23% 29% Key entropy is low (measured at OHM) OTA DES key Entropy 000028b000208002 ~16bit 3088802602104804 ~24bit 11% 2cee2212443ae0a6 ~44bit aa7890c234aeee28 ~50bit Signature- disclosing cards in research set Cards affected in OHM sample (14 countries) 96a6141aaa5ef0ee ~52bit 15

Agenda SIM card background A Gevng on to the SIM B Stealing SIM secrets 16

Java virus does not automa9cally have access to all SIM assets OTA- deployed SIM virus can access SIM Toolkit API Java sand box should protect cri'cal data on SIM Data access on SIM would enable further abuse Standard STK func'on Abuse poten'al Protected func'on Abuse poten'al Send SMS Premium SMS fraud Read Ki SIM cloning Decrypt all 2G/3G/4G traffic Dial phone numbers, send DTM tones Circumvent caller- ID checks Mess with voice mail Read hash func'on Reverse- engineer proprietary authen9ca9on func9ons; perhaps find weaknesses Send USSD numbers Query phone loca'on and sedngs Open URL in phone browser Redirect incoming calls; some9mes also SMS Abuse USSD- based payment schemes Track vic9m Phishing Malware deployment to phone Any other browser- based agack Read OTA keys Read Java processes Write to lash or EEPROM Lateral agacks Clone NC payment takers and other future SIM applica9ons Alter OS to prevent vulnerability patching 17

Java VM on many SIMs fails to confine malicious applets Java virus may try to intrude on other parts of SIM Simplis9c memory boundary viola9on agempt: X = small_array[1000000] X Java VM needs to enforce sandbox boundaries of each app Java VM enforces array boundaries and stops request Other Java programs and na've SIM func'ons store value secrets Data in SIM Ki Banking applets Iden9fica- 9on applets Abuse scenario SIM cloning: SMS/call fraud, Steal balance Impersonate More complex construct to violate memory boundaries (responsible disclosure with vendors ongoing) Java VM fails to detect viola9on &! processes request All secret informa9on on SIM is exposed to malicious applets through vulnerabili9es in several popular Java implementa9ons 18

Puvng it all together Remote SIM cloning A Infiltrate card with malicious Java applet B Exfiltrate valuable data Ac'on Send binary SMS with OTA command to card, reques9ng card response Crack DES signing key, then sign Java virus & send through binary SMS Leverage gaps in Java VM memory separa9on to access arbitrary SIM card data Result Card may respond with a DES- signed error message Card installs and executes signed Java applet Malicious applet extracts Ki, banking applets, etc., and send to agacker via SMS 19

Wide- scale SIM hacking risk must be mi9gated on several layers Mi'ga'on layer for OTA hacking risk Effec'veness Cost Low High ilter OTA messages from unapproved sources Prevents probing in home network; leaves SIMs exposed when roaming, to fake base sta9ons, and to phone malware unc9onality readily available in most SMSCs Network operators short- term mi9ga9on op9on Deac9vate OTA on card Prevents agack (but also any future use of OTA w/ DES key) Can be done through SMS Use 3DES or AES OTA keys Use cards that do not disclose crypto texts ilter suspicious messages on phone base band Prevents agack (expect for where downgrade agack works) Prevents the agack Prevents the agack Some cards need replacing, others updates Some cards need to be replaced New sorware func9on for future phones Network operators mid- term mi9ga9on op9on Complimentary mi9ga9on op9on for phone manufacturers 20

Industry response was encouraging for responsibly disclosing hacking research The responsible disclosure went surprisingly well and is worth men9oning We disclosed several months ahead of the release to trusted contracts made around previous releases Experts from a few large companies verified the results and created best prac9ce responses Industry associa9ons disseminated guidelines to all other operators Many networks are now well underway implemen9ng filtering and reconfiguring cards Only a single lawyer stumbled into the interac9on, but quickly ler Take aways from a number of responsible disclosure that all went well (except for one) ind construc've partners in the industry; ask other hackers for their recommenda9ons Disclose early and don t be surprised if even the most mo9vated disclosure partner takes months to distribute the informa9on confiden9ally in their industry Bring someone with disclosure experience to mee9ngs Expect friendliness and remind your partner of the required e9quege should they ever act rude or arrogant Help your technical contacts win the internal bagles: Refuse to speak to their lawyers; never sign an NDA prior to your disclosure Be extremely careful accep9ng money; and only ever to help with mi9ga9on 21

Take aways A Some DES- secured SIM- cards allow for remote key cracking and applet installa9on B Java vulnerabili9es enable agacker to remotely extract Ki, banking applet data Mi9ga9on op9ons exist on network, baseband, and SIM card level Ques9ons? Karsten Nohl <nohl@srlabs.de> 22