SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
Hacking smartcards & RFID




            Erik Poll
          Digital Security
    Radboud University Nijmegen

                                  1
What are smartcards & RFID tags?
Micro-controller



      with contact interface



      or contactless interface




Erik Poll – Digital Security                    2
Why use them?
Convenience
•   more convenient than username/password


Security
•  more secure than username/password



Also more convenient & secure than barcodes and magstripes




Erik Poll – Digital Security                                 3
What makes them secure?
• Tamper-resistant and tamper-evident – to some degree,
  but never tamper-proof

• no way to remove or access the “hard disk”

• therefore
   – any access to data - say the credit on your ov-chipcard - is under control of
     the card’s functionality
   – the same goes for adding or changing code on the card
      • if possible at all




Erik Poll – Digital Security                                                         4
What can they do ?
1. stupid card just reports some data
    card shouts out a (unique) serial number on start-up

2. stupid smartcard aka memory card
   provides configurable file system with some access control
           by means of PIN code/passwords or crypto keys
           or even simpler: irreversible writes (OTP or WORM memory)


3. smart smartcard aka microprocessor card
   provides programmable CPU that can implement any
   functionality



Erik Poll – Digital Security                                           5
Smartcard hardware for microprocessor cards
• CPU (usually 8 or 16, but now also 32 bit)
• possibly also
   – crypto co-processor & random number generator (RNG)
• memory: RAM and ROM & EEPROM
      – EEPROM serves as the smartcard's hard disk
• no power, no clock!

A modern card may have 512 bytes RAM, 16K ROM, 64K EEPROM and
  operate at 13.5 MHz




Erik Poll – Digital Security                                    6
Do-it-Yourself
•   Buy a card reader or NFC mobile phone
•   Buy some tags and cards



•   Programming you own smartcards is
    possible using JavaCard or MULTOS smartcards


•   Check
    • www.ru.nl/ds/smartcards
    • libnfc
    • proxmark
    • rfidiot.org




Erik Poll – Digital Security                       7
Attacking smartcards and RFID
•    logical attacks
      – find flaw in the functionality, targeting eg
          • the crypto – ie the cryptographic algorithms
          • the protocol
          • the key management
          • any other functionality
•    physical attacks
      – physically mess with the card
•    combinations
      – abuse functionality while you mess with the card




Erik Poll – Digital Security                               8
The simplest physical attack




External power supply and external clock
• Vcc: orignally 5 V, now also 3V or 1.8V
• Vpp: higher voltage for writing EEPROM (13 V)
                               Vpp no longer used: painting over
                               this contact is a major security
                               threat
Erik Poll – Digital Security                                       9
Logical attacks: tools of the trade




for passive eavesdropping or active Man-in-the-Middle
Logical attacks:
                               A very weak RFID tag




Erik Poll – Digital Security                          11
Mifare Ultralight
•    Used in disposable ov-chipkaart
•    No keys to protect memory access
•    Relies on read-only and write-once memory for security
•    Memory organised in 16 pages of 4 bytes
      – first part is read-only
          • includes 7 byte serial number
      – second part is One Time Programmable (OTP)
          • you can write 1's, not 0's
          • includes data for locking
      – third part is readable & writable




Erik Poll – Digital Security                                  12
                                                              12
MIFARE Ultralight memory layout
               Page byte 0          byte 1   byte 2   byte 3
read           0         UID0       UID1     UID2     checksum   serial number
only                                                                  UID
               1
               2         checksum            lock 0   lock1         OTP
               3         OTP 0      OTP 1    OTP 2    OTP 3
               4

               5
                                                                 application
read/          6                                                    data
write
               7
               8
               9
               10
  Erik Poll – Digital Security                                                 13
                                                                               13
               11
Flaw in disposable ov-chipcard
• wo lock bytes initially 0x00F0
• set to 0xF8FF to invalidate tag
• we can change an invalid tag so that terminals fail to
  recognize it as invalid...
• remaining 3 lock bits can still be set to one, so that lock
  bytes become 0xFFFF
• flaw in terminals: tags with lock bytes 0xF8FF are
  recognized as invalid, but tags with 0xFFFF are not
   • flaw since fixed by patching terminals

     [Source "Security Evaluation of the disposable OV chipkaart", by UvA
     students Pieter Siekerman and Maurits van der Schee , July 2007]




Erik Poll – Digital Security                                                14
                                                                            14
More fundamental limitation: replay attack
• Mifare Ultraright can store signed or encrypted data, but cannot
  do any processing, or offer any access control to reading the data
• No way to protect against spoofing of tags




• Only mitigation: serial number (UID) cannot be overwritten, so
  spoofing requires special hardware if UID is used

Erik Poll – Digital Security                                       15
                                                                   15
Logical attacks:
                               Attacking the crypto




Erik Poll – Digital Security                          16
Challenge-response


       secret
                         CPU                    challenge c
        key K
                                                response encryptK(c)




• If the card can do encryption, the secret key K never leaves the card

• Card issuer does not have to trust card holder, terminal, or network

•   This is how you bank card works: it uses a 3DES key that only the bank knows




Erik Poll – Digital Security                                                       17
Breaking this?


       secret
                         CPU                        challenge c
        key K
                                                    response encryptK(c)




1. Figuring out which encryption function is used
   – maybe this is known & published
   – otherwise: reverse engineering, experimenting to figure out how encryption works
2. For poor encryption: by trying out few challenges,
    you may be able to reconstruct key

    For good crypto – 3DES, AES, RSA,... – this is hopeless




Erik Poll – Digital Security                                                        18
Proprietary crypto broken in DS group
•   Mifare Classic
•   ATMEL SecureMemory, CryptoMemory and CryptoRF
•   HID iClass and iClass Elite
•   Hitag2




•   Moral of the story: use established, crypto primitives
     – publicly studied according to Kerckhoffs principle




Erik Poll – Digital Security                                 19
Crypto 1 in Mifare Classic




Erik Poll – Digital Security                          20
Logical attacks:
                  Attacking the key management




Erik Poll – Digital Security                      21
Common problems with crypto keys

• people using the same key in all cards
•    for one customer, or - worse - all their customers!
•    HID iClass uses a globally unique master key, which is built into all
     HID card readers
• worse still, using the default keys
•    75% of MIFARE applications was found to use default keys or keys
     used in examples in documentation

                               [Source: Lukas Grunwald, DEFCON14, 2007]
•    A0A1A2A3A4A5 is an initial transport key of MIFARE tags.
     Googling for A0A1A2A3A4A5 produces links to documentation with
     other example keys to try!



Erik Poll – Digital Security                                              22
                                                                          22
Logical attacks:
                       attacking security protocols




Erik Poll – Digital Security                          23
Fraud with internet banking in Netherlands

            2008               2.1 M€
            2009               1.9 M€
            2010               9.8 M€ (7100€ per incident)
            2011               35 M€ (4500€ per incident)
            2012 (1st half)    27.3 M€

                                                      [source: NVB]




Erik Poll – Digital Security                                          24
Internet banking &
                           Man-in-the-Browser attacks



                               display of PC can
                                not be trusted
                               (despite     )
                                                          59   8 76
                                                     23 4
                                                   → 3 6 54
                                                      2
                                                   ←1




Erik Poll – Digital Security                                          25
Internet banking & protecting
                       against Man-in-the-Browser attacks

                                          this display can
                                          be trusted and
                                          understood




                                         USB




Erik Poll – Digital Security                                 26
Protocol of USB-connected e.dentifier2




Erik Poll – Digital Security                           27
Protocol of USB-connected e.dentifier2




Erik Poll – Digital Security                           28
Protocol of USB-connected e.dentifier2




                                      Vulnerability:
                                       e.dentifier2 tells PC that
                                       user pressed OK
                                       PC instructs e.dentifier2
                                       to continue transaction




Erik Poll – Digital Security                                  29
Attack




Erik Poll – Digital Security            30
Movie




Erik Poll – Digital Security           31
Other example logical weaknesses
                              -
                      for e-passports




Erik Poll – Digital Security                     32
Unwanted functionality
•    Test version of Dutch passport
     provided software emulation of Mifare Classic

•     with default key, of course...




This allows adding a cloned ov-chipcard on the passport




Erik Poll – Digital Security                              33
Attacking the terminal software
 
      Lukas Grunwald managed to crash e-passport terminals by
      sending a malformed JPEG
       
         causing a buffer overflow in the graphics library




 
      Smartcards and RFID tags should be treated as untrusted
      inputs
       
            until we have authenticated the card and/or the data it
            provides




Erik Poll – Digital Security                                          34
e-passport leaking info by error response

                     2 byte error                     meaning
                       response
Belgian                  6986                       not allowed
Dutch                      6982            security status not satisfied
French                     6F00                 no precise diagnosis
Italian                    6D00                    not supported
German                     6700                     wrong length
                       Error code for illegal B0, ie. READ BINARY, instruction
This reveals the nationality of a passport
• in spite of access control to passport data
  255 other instructions to try,
But attack range limited to 30 cm, so danger of passport bombs overhyped
     and we can try different parameters ...
Erik Poll – Digital Security                                                 35
Physical attacks:
                               side-channel attacks




Erik Poll – Digital Security                          36
Power trace of an RSA encryption




          [Source: Riscure]



Erik Poll – Digital Security                     37
Power analysis: reading the key from this trace!




Erik Poll – Digital Security                             38
Physical, invasive attacks




Erik Poll – Digital Security                          39
First step: removing chip from smartcard




Erik Poll – Digital Security                         40
Optical reverse engineering




          microscope images with different layers in different
          colours, before and after etching



                               [Source: Oliver Kömmerling, Marcus Kuhn]
Erik Poll – Digital Security                                              41
Probing


      Observe or change the data on the bus while the chip is in operation.

       eg to observe key




                    probing with
                    8 needles




    Erik Poll – Digital Security                                       42
Fibbing

FIB = Focussed Ion Beam
can observe or modify chip by
• drilling holes
• cutting connections
• soldering new connections and
  creating new gates




                 hole drilled in
                the chip surface             blown fuse
Erik Poll – Digital Security                              43
Extracting ROM content


Staining can
optically reveal
the bits
stored in ROM:
dark squares are 1
light squares are 0




                                  [Source: Brightsight]
   Erik Poll – Digital Security                           44
Latest fashion: fault attacks
•    Introduce a fault while chip is operating
      – by glitching: dipping the voltage
      – by shooting a laser at the chip




Erik Poll – Digital Security                         45
Conclusions
•    Smartcard & RFID security not perfect
      – cheap, logical attacks
         • little equipment, but some time & brainpower
      – expensive, physical atacks
         • more equipment
      – both can be devastating...

•    The ongoing arms race between defenders and attackers will
     never end
      – these days esp. for side-channel and fault attacks




Erik Poll – Digital Security                                 46

Mais conteúdo relacionado

Mais procurados

Tráfico telefónico
Tráfico telefónicoTráfico telefónico
Tráfico telefónicorenatopuente
 
Capitulo 2 - Arquitectura de red UMTS (3G)
Capitulo 2 - Arquitectura de red UMTS (3G)Capitulo 2 - Arquitectura de red UMTS (3G)
Capitulo 2 - Arquitectura de red UMTS (3G)Andy Juan Sarango Veliz
 
Espectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIEspectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIAndy Juan Sarango Veliz
 
Conmutación telefónica
Conmutación telefónicaConmutación telefónica
Conmutación telefónicaedeive
 
Signal Integrity - A Crash Course [R Lott]
Signal Integrity - A Crash Course [R Lott]Signal Integrity - A Crash Course [R Lott]
Signal Integrity - A Crash Course [R Lott]Ryan Lott
 
Modulación por desplazamiento de fase (psk) exposicion
Modulación por desplazamiento de fase (psk) exposicionModulación por desplazamiento de fase (psk) exposicion
Modulación por desplazamiento de fase (psk) exposicionAlieth Guevara
 
Sincronización en Redes Telefónicas Públicas Conmutadas
Sincronización en Redes Telefónicas Públicas ConmutadasSincronización en Redes Telefónicas Públicas Conmutadas
Sincronización en Redes Telefónicas Públicas ConmutadasEng. Fernando Mendioroz, MSc.
 
Lecture11 combinational logic dynamics
Lecture11 combinational logic dynamicsLecture11 combinational logic dynamics
Lecture11 combinational logic dynamicsvidhya DS
 
Storage interface sata_pata
Storage interface sata_pataStorage interface sata_pata
Storage interface sata_pataPREMAL GAJJAR
 
USB Type-C R1.1 Introduction
USB Type-C R1.1 IntroductionUSB Type-C R1.1 Introduction
USB Type-C R1.1 IntroductionTing Ou
 
Recepcion de y distribución de RTV terrestre
Recepcion de y distribución de RTV terrestreRecepcion de y distribución de RTV terrestre
Recepcion de y distribución de RTV terrestrejruizprofe
 

Mais procurados (20)

Tráfico telefónico
Tráfico telefónicoTráfico telefónico
Tráfico telefónico
 
Vlsi physical design (Back End Process)
Vlsi physical design (Back End Process)Vlsi physical design (Back End Process)
Vlsi physical design (Back End Process)
 
05 unidades de medida
05 unidades de medida05 unidades de medida
05 unidades de medida
 
Capitulo 2 - Arquitectura de red UMTS (3G)
Capitulo 2 - Arquitectura de red UMTS (3G)Capitulo 2 - Arquitectura de red UMTS (3G)
Capitulo 2 - Arquitectura de red UMTS (3G)
 
Espectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIEspectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones III
 
Conmutación telefónica
Conmutación telefónicaConmutación telefónica
Conmutación telefónica
 
Signal Integrity - A Crash Course [R Lott]
Signal Integrity - A Crash Course [R Lott]Signal Integrity - A Crash Course [R Lott]
Signal Integrity - A Crash Course [R Lott]
 
Modulación por desplazamiento de fase (psk) exposicion
Modulación por desplazamiento de fase (psk) exposicionModulación por desplazamiento de fase (psk) exposicion
Modulación por desplazamiento de fase (psk) exposicion
 
SDH
SDHSDH
SDH
 
Sincronización en Redes Telefónicas Públicas Conmutadas
Sincronización en Redes Telefónicas Públicas ConmutadasSincronización en Redes Telefónicas Públicas Conmutadas
Sincronización en Redes Telefónicas Públicas Conmutadas
 
Introduction to EDA Tools
Introduction to EDA ToolsIntroduction to EDA Tools
Introduction to EDA Tools
 
Reed Solomon
Reed SolomonReed Solomon
Reed Solomon
 
Lecture11 combinational logic dynamics
Lecture11 combinational logic dynamicsLecture11 combinational logic dynamics
Lecture11 combinational logic dynamics
 
Television Digital Terrestre en el Ecuador
Television Digital Terrestre en el EcuadorTelevision Digital Terrestre en el Ecuador
Television Digital Terrestre en el Ecuador
 
BANDA LATERAL UNICA
BANDA LATERAL UNICABANDA LATERAL UNICA
BANDA LATERAL UNICA
 
Storage interface sata_pata
Storage interface sata_pataStorage interface sata_pata
Storage interface sata_pata
 
Lightly Doped Drain
Lightly Doped DrainLightly Doped Drain
Lightly Doped Drain
 
USB Type-C R1.1 Introduction
USB Type-C R1.1 IntroductionUSB Type-C R1.1 Introduction
USB Type-C R1.1 Introduction
 
Recepcion de y distribución de RTV terrestre
Recepcion de y distribución de RTV terrestreRecepcion de y distribución de RTV terrestre
Recepcion de y distribución de RTV terrestre
 
Layout02 (1)
Layout02 (1)Layout02 (1)
Layout02 (1)
 

Semelhante a Hacking Smartcards & RFID

Electronic key-card & ELC;elc
Electronic key-card & ELC;elcElectronic key-card & ELC;elc
Electronic key-card & ELC;elcMohitKataria15
 
Hack one iot device, break them all!
Hack one iot device, break them all!Hack one iot device, break them all!
Hack one iot device, break them all!Justin Black
 
Smart cards & RFID-Anant Patel
Smart cards & RFID-Anant PatelSmart cards & RFID-Anant Patel
Smart cards & RFID-Anant PatelAnant Patel
 
Inside .NET Smart Card Operating System
Inside .NET Smart Card Operating SystemInside .NET Smart Card Operating System
Inside .NET Smart Card Operating SystemSensePost
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Riscure
 
Encryption in industrial control systems; Is the juice worth the squeeze?
Encryption in industrial control systems; Is the juice worth the squeeze?Encryption in industrial control systems; Is the juice worth the squeeze?
Encryption in industrial control systems; Is the juice worth the squeeze?Brian Proctor - GICSP, CISSP, CRISC
 
smartcard-120830090352-phpapp02.pdf
smartcard-120830090352-phpapp02.pdfsmartcard-120830090352-phpapp02.pdf
smartcard-120830090352-phpapp02.pdfssuser5b47c8
 
Cryptographic tools
Cryptographic toolsCryptographic tools
Cryptographic toolsCAS
 
Workshop on 03 11-2012
Workshop on 03 11-2012Workshop on 03 11-2012
Workshop on 03 11-2012Gaurav Gautam
 
Meetup -- RFID
Meetup -- RFIDMeetup -- RFID
Meetup -- RFIDKevin2600
 
Hardwar based Security of Systems
Hardwar based Security of SystemsHardwar based Security of Systems
Hardwar based Security of SystemsJamal Jamali
 
Cryptographysecurity 1222867498937700-9
Cryptographysecurity 1222867498937700-9Cryptographysecurity 1222867498937700-9
Cryptographysecurity 1222867498937700-9muthulx
 
How to do Cryptography right in Android Part One
How to do Cryptography right in Android Part OneHow to do Cryptography right in Android Part One
How to do Cryptography right in Android Part OneArash Ramez
 

Semelhante a Hacking Smartcards & RFID (20)

Smart Card Security
Smart Card SecuritySmart Card Security
Smart Card Security
 
Electronic key-card & ELC;elc
Electronic key-card & ELC;elcElectronic key-card & ELC;elc
Electronic key-card & ELC;elc
 
Hack one iot device, break them all!
Hack one iot device, break them all!Hack one iot device, break them all!
Hack one iot device, break them all!
 
Smart cards & RFID-Anant Patel
Smart cards & RFID-Anant PatelSmart cards & RFID-Anant Patel
Smart cards & RFID-Anant Patel
 
Inside .NET Smart Card Operating System
Inside .NET Smart Card Operating SystemInside .NET Smart Card Operating System
Inside .NET Smart Card Operating System
 
Encryption 2021
Encryption 2021Encryption 2021
Encryption 2021
 
Access controls
Access controlsAccess controls
Access controls
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?
 
Encryption in industrial control systems; Is the juice worth the squeeze?
Encryption in industrial control systems; Is the juice worth the squeeze?Encryption in industrial control systems; Is the juice worth the squeeze?
Encryption in industrial control systems; Is the juice worth the squeeze?
 
Ewallet
EwalletEwallet
Ewallet
 
Smart Cards Evolution
Smart Cards EvolutionSmart Cards Evolution
Smart Cards Evolution
 
smartcard-120830090352-phpapp02.pdf
smartcard-120830090352-phpapp02.pdfsmartcard-120830090352-phpapp02.pdf
smartcard-120830090352-phpapp02.pdf
 
Cryptographic tools
Cryptographic toolsCryptographic tools
Cryptographic tools
 
Workshop on 03 11-2012
Workshop on 03 11-2012Workshop on 03 11-2012
Workshop on 03 11-2012
 
Cryptology - The practice and study of hiding information
Cryptology - The practice and study of hiding informationCryptology - The practice and study of hiding information
Cryptology - The practice and study of hiding information
 
Meetup -- RFID
Meetup -- RFIDMeetup -- RFID
Meetup -- RFID
 
Cyber security
Cyber securityCyber security
Cyber security
 
Hardwar based Security of Systems
Hardwar based Security of SystemsHardwar based Security of Systems
Hardwar based Security of Systems
 
Cryptographysecurity 1222867498937700-9
Cryptographysecurity 1222867498937700-9Cryptographysecurity 1222867498937700-9
Cryptographysecurity 1222867498937700-9
 
How to do Cryptography right in Android Part One
How to do Cryptography right in Android Part OneHow to do Cryptography right in Android Part One
How to do Cryptography right in Android Part One
 

Mais de Devnology

What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?Devnology
 
Meetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenMeetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenDevnology
 
Software Operation Knowledge
Software Operation KnowledgeSoftware Operation Knowledge
Software Operation KnowledgeDevnology
 
Slides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWISlides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWIDevnology
 
Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applicationsDevnology
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoDevnology
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseDevnology
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented RealityDevnology
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightDevnology
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingDevnology
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshopDevnology
 

Mais de Devnology (20)

What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?What do we really know about the differences between static and dynamic types?
What do we really know about the differences between static and dynamic types?
 
Meetup at SIG: Meten is weten
Meetup at SIG: Meten is wetenMeetup at SIG: Meten is weten
Meetup at SIG: Meten is weten
 
Software Operation Knowledge
Software Operation KnowledgeSoftware Operation Knowledge
Software Operation Knowledge
 
Slides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWISlides Felienne Hermans Symposium EWI
Slides Felienne Hermans Symposium EWI
 
Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205Devnology auteursrecht en open source 20130205
Devnology auteursrecht en open source 20130205
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software Development
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en Architectuur
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impact
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineering
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software Volcano
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented Reality
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in Silverlight
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshop
 

Último

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Hacking Smartcards & RFID

  • 1. Hacking smartcards & RFID Erik Poll Digital Security Radboud University Nijmegen 1
  • 2. What are smartcards & RFID tags? Micro-controller with contact interface or contactless interface Erik Poll – Digital Security 2
  • 3. Why use them? Convenience • more convenient than username/password Security • more secure than username/password Also more convenient & secure than barcodes and magstripes Erik Poll – Digital Security 3
  • 4. What makes them secure? • Tamper-resistant and tamper-evident – to some degree, but never tamper-proof • no way to remove or access the “hard disk” • therefore – any access to data - say the credit on your ov-chipcard - is under control of the card’s functionality – the same goes for adding or changing code on the card • if possible at all Erik Poll – Digital Security 4
  • 5. What can they do ? 1. stupid card just reports some data card shouts out a (unique) serial number on start-up 2. stupid smartcard aka memory card provides configurable file system with some access control by means of PIN code/passwords or crypto keys or even simpler: irreversible writes (OTP or WORM memory) 3. smart smartcard aka microprocessor card provides programmable CPU that can implement any functionality Erik Poll – Digital Security 5
  • 6. Smartcard hardware for microprocessor cards • CPU (usually 8 or 16, but now also 32 bit) • possibly also – crypto co-processor & random number generator (RNG) • memory: RAM and ROM & EEPROM – EEPROM serves as the smartcard's hard disk • no power, no clock! A modern card may have 512 bytes RAM, 16K ROM, 64K EEPROM and operate at 13.5 MHz Erik Poll – Digital Security 6
  • 7. Do-it-Yourself • Buy a card reader or NFC mobile phone • Buy some tags and cards • Programming you own smartcards is possible using JavaCard or MULTOS smartcards • Check • www.ru.nl/ds/smartcards • libnfc • proxmark • rfidiot.org Erik Poll – Digital Security 7
  • 8. Attacking smartcards and RFID • logical attacks – find flaw in the functionality, targeting eg • the crypto – ie the cryptographic algorithms • the protocol • the key management • any other functionality • physical attacks – physically mess with the card • combinations – abuse functionality while you mess with the card Erik Poll – Digital Security 8
  • 9. The simplest physical attack External power supply and external clock • Vcc: orignally 5 V, now also 3V or 1.8V • Vpp: higher voltage for writing EEPROM (13 V) Vpp no longer used: painting over this contact is a major security threat Erik Poll – Digital Security 9
  • 10. Logical attacks: tools of the trade for passive eavesdropping or active Man-in-the-Middle
  • 11. Logical attacks: A very weak RFID tag Erik Poll – Digital Security 11
  • 12. Mifare Ultralight • Used in disposable ov-chipkaart • No keys to protect memory access • Relies on read-only and write-once memory for security • Memory organised in 16 pages of 4 bytes – first part is read-only • includes 7 byte serial number – second part is One Time Programmable (OTP) • you can write 1's, not 0's • includes data for locking – third part is readable & writable Erik Poll – Digital Security 12 12
  • 13. MIFARE Ultralight memory layout Page byte 0 byte 1 byte 2 byte 3 read 0 UID0 UID1 UID2 checksum serial number only UID 1 2 checksum lock 0 lock1 OTP 3 OTP 0 OTP 1 OTP 2 OTP 3 4 5 application read/ 6 data write 7 8 9 10 Erik Poll – Digital Security 13 13 11
  • 14. Flaw in disposable ov-chipcard • wo lock bytes initially 0x00F0 • set to 0xF8FF to invalidate tag • we can change an invalid tag so that terminals fail to recognize it as invalid... • remaining 3 lock bits can still be set to one, so that lock bytes become 0xFFFF • flaw in terminals: tags with lock bytes 0xF8FF are recognized as invalid, but tags with 0xFFFF are not • flaw since fixed by patching terminals [Source "Security Evaluation of the disposable OV chipkaart", by UvA students Pieter Siekerman and Maurits van der Schee , July 2007] Erik Poll – Digital Security 14 14
  • 15. More fundamental limitation: replay attack • Mifare Ultraright can store signed or encrypted data, but cannot do any processing, or offer any access control to reading the data • No way to protect against spoofing of tags • Only mitigation: serial number (UID) cannot be overwritten, so spoofing requires special hardware if UID is used Erik Poll – Digital Security 15 15
  • 16. Logical attacks: Attacking the crypto Erik Poll – Digital Security 16
  • 17. Challenge-response secret CPU challenge c key K response encryptK(c) • If the card can do encryption, the secret key K never leaves the card • Card issuer does not have to trust card holder, terminal, or network • This is how you bank card works: it uses a 3DES key that only the bank knows Erik Poll – Digital Security 17
  • 18. Breaking this? secret CPU challenge c key K response encryptK(c) 1. Figuring out which encryption function is used – maybe this is known & published – otherwise: reverse engineering, experimenting to figure out how encryption works 2. For poor encryption: by trying out few challenges, you may be able to reconstruct key For good crypto – 3DES, AES, RSA,... – this is hopeless Erik Poll – Digital Security 18
  • 19. Proprietary crypto broken in DS group • Mifare Classic • ATMEL SecureMemory, CryptoMemory and CryptoRF • HID iClass and iClass Elite • Hitag2 • Moral of the story: use established, crypto primitives – publicly studied according to Kerckhoffs principle Erik Poll – Digital Security 19
  • 20. Crypto 1 in Mifare Classic Erik Poll – Digital Security 20
  • 21. Logical attacks: Attacking the key management Erik Poll – Digital Security 21
  • 22. Common problems with crypto keys • people using the same key in all cards • for one customer, or - worse - all their customers! • HID iClass uses a globally unique master key, which is built into all HID card readers • worse still, using the default keys • 75% of MIFARE applications was found to use default keys or keys used in examples in documentation [Source: Lukas Grunwald, DEFCON14, 2007] • A0A1A2A3A4A5 is an initial transport key of MIFARE tags. Googling for A0A1A2A3A4A5 produces links to documentation with other example keys to try! Erik Poll – Digital Security 22 22
  • 23. Logical attacks: attacking security protocols Erik Poll – Digital Security 23
  • 24. Fraud with internet banking in Netherlands 2008 2.1 M€ 2009 1.9 M€ 2010 9.8 M€ (7100€ per incident) 2011 35 M€ (4500€ per incident) 2012 (1st half) 27.3 M€ [source: NVB] Erik Poll – Digital Security 24
  • 25. Internet banking & Man-in-the-Browser attacks display of PC can not be trusted (despite ) 59 8 76 23 4 → 3 6 54 2 ←1 Erik Poll – Digital Security 25
  • 26. Internet banking & protecting against Man-in-the-Browser attacks this display can be trusted and understood USB Erik Poll – Digital Security 26
  • 27. Protocol of USB-connected e.dentifier2 Erik Poll – Digital Security 27
  • 28. Protocol of USB-connected e.dentifier2 Erik Poll – Digital Security 28
  • 29. Protocol of USB-connected e.dentifier2 Vulnerability:  e.dentifier2 tells PC that user pressed OK  PC instructs e.dentifier2 to continue transaction Erik Poll – Digital Security 29
  • 30. Attack Erik Poll – Digital Security 30
  • 31. Movie Erik Poll – Digital Security 31
  • 32. Other example logical weaknesses - for e-passports Erik Poll – Digital Security 32
  • 33. Unwanted functionality • Test version of Dutch passport provided software emulation of Mifare Classic • with default key, of course... This allows adding a cloned ov-chipcard on the passport Erik Poll – Digital Security 33
  • 34. Attacking the terminal software  Lukas Grunwald managed to crash e-passport terminals by sending a malformed JPEG  causing a buffer overflow in the graphics library  Smartcards and RFID tags should be treated as untrusted inputs  until we have authenticated the card and/or the data it provides Erik Poll – Digital Security 34
  • 35. e-passport leaking info by error response 2 byte error meaning response Belgian 6986 not allowed Dutch 6982 security status not satisfied French 6F00 no precise diagnosis Italian 6D00 not supported German 6700 wrong length Error code for illegal B0, ie. READ BINARY, instruction This reveals the nationality of a passport • in spite of access control to passport data 255 other instructions to try, But attack range limited to 30 cm, so danger of passport bombs overhyped and we can try different parameters ... Erik Poll – Digital Security 35
  • 36. Physical attacks: side-channel attacks Erik Poll – Digital Security 36
  • 37. Power trace of an RSA encryption [Source: Riscure] Erik Poll – Digital Security 37
  • 38. Power analysis: reading the key from this trace! Erik Poll – Digital Security 38
  • 39. Physical, invasive attacks Erik Poll – Digital Security 39
  • 40. First step: removing chip from smartcard Erik Poll – Digital Security 40
  • 41. Optical reverse engineering microscope images with different layers in different colours, before and after etching [Source: Oliver Kömmerling, Marcus Kuhn] Erik Poll – Digital Security 41
  • 42. Probing  Observe or change the data on the bus while the chip is in operation. eg to observe key probing with 8 needles Erik Poll – Digital Security 42
  • 43. Fibbing FIB = Focussed Ion Beam can observe or modify chip by • drilling holes • cutting connections • soldering new connections and creating new gates hole drilled in the chip surface blown fuse Erik Poll – Digital Security 43
  • 44. Extracting ROM content Staining can optically reveal the bits stored in ROM: dark squares are 1 light squares are 0 [Source: Brightsight] Erik Poll – Digital Security 44
  • 45. Latest fashion: fault attacks • Introduce a fault while chip is operating – by glitching: dipping the voltage – by shooting a laser at the chip Erik Poll – Digital Security 45
  • 46. Conclusions • Smartcard & RFID security not perfect – cheap, logical attacks • little equipment, but some time & brainpower – expensive, physical atacks • more equipment – both can be devastating... • The ongoing arms race between defenders and attackers will never end – these days esp. for side-channel and fault attacks Erik Poll – Digital Security 46