Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm...

112
Near Field Communication Security Thomas Patzke 22.04.2015

Transcript of Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm...

Page 1: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Near Field Communication Security

Thomas Patzke

22.04.2015

Page 2: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Who am I. . .

I Thomas Patzke (formerly Skora)

I Started with security related topics somewhere in the 90s

I University degree in 2006, RWTH Aachen, thesis about VoIPsecurity

I Security Consulting since 2006

I Primary security analysis/penetration testing

I (Web) Application Security

I Security analysis of”unusual“ stuff: POS, cash machines,

head units, security protocols

I Security Research in various areas

I Writing Security Tools

I Cryptography

Page 3: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Who am I. . .

I Thomas Patzke (formerly Skora)

I Started with security related topics somewhere in the 90s

I University degree in 2006, RWTH Aachen, thesis about VoIPsecurity

I Security Consulting since 2006

I Primary security analysis/penetration testing

I (Web) Application Security

I Security analysis of”unusual“ stuff: POS, cash machines,

head units, security protocols

I Security Research in various areas

I Writing Security Tools

I Cryptography

Page 4: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Who am I. . .

I Thomas Patzke (formerly Skora)

I Started with security related topics somewhere in the 90s

I University degree in 2006, RWTH Aachen, thesis about VoIPsecurity

I Security Consulting since 2006

I Primary security analysis/penetration testing

I (Web) Application Security

I Security analysis of”unusual“ stuff: POS, cash machines,

head units, security protocols

I Security Research in various areas

I Writing Security Tools

I Cryptography

Page 5: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

What is this talk about?

I A introduction to NFC

I Security of the girogo system

I Security of Credit Cards

I How doors get open with replay attacks

I Securing NFC applications

I The NFC hackers toolbox

Page 6: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

What is this talk about?

I A introduction to NFC

I Security of the girogo system

I Security of Credit Cards

I How doors get open with replay attacks

I Securing NFC applications

I The NFC hackers toolbox

Page 7: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

What is this talk about?

I A introduction to NFC

I Security of the girogo system

I Security of Credit Cards

I How doors get open with replay attacks

I Securing NFC applications

I The NFC hackers toolbox

Page 8: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=?

Page 9: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=?

Page 10: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=. . .

I Near Field Communication

I Few cm communication distance

I Power supply by reader

I 13,56 MHz, 424kBit/sI ISO standards

I 14443: Physical layer, frequency, transmitting power,initialisation, anti-collision, bit transfer

I 15693: Increased communication distance up to 1,5mI 18092, 21481: NFCIP - NFC Interface and Protocol

Page 11: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=. . .

I Near Field Communication

I Few cm communication distance

I Power supply by reader

I 13,56 MHz, 424kBit/sI ISO standards

I 14443: Physical layer, frequency, transmitting power,initialisation, anti-collision, bit transfer

I 15693: Increased communication distance up to 1,5mI 18092, 21481: NFCIP - NFC Interface and Protocol

Page 12: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=. . .

I Near Field Communication

I Few cm communication distance

I Power supply by reader

I 13,56 MHz, 424kBit/s

I ISO standards

I 14443: Physical layer, frequency, transmitting power,initialisation, anti-collision, bit transfer

I 15693: Increased communication distance up to 1,5mI 18092, 21481: NFCIP - NFC Interface and Protocol

Page 13: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC=. . .

I Near Field Communication

I Few cm communication distance

I Power supply by reader

I 13,56 MHz, 424kBit/sI ISO standards

I 14443: Physical layer, frequency, transmitting power,initialisation, anti-collision, bit transfer

I 15693: Increased communication distance up to 1,5mI 18092, 21481: NFCIP - NFC Interface and Protocol

Page 14: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Other systems

I 125 kHz Proximity Cards: Access Control

I Legic Prime: Proprietary in 13,56MHz, Access Control,Company Cards

I iClass, . . .

I NFC ⊂ RFID

Page 15: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Other systems

I 125 kHz Proximity Cards: Access Control

I Legic Prime: Proprietary in 13,56MHz, Access Control,Company Cards

I iClass, . . .

I NFC ⊂ RFID

Page 16: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Other systems

I 125 kHz Proximity Cards: Access Control

I Legic Prime: Proprietary in 13,56MHz, Access Control,Company Cards

I iClass, . . .

I NFC ⊂ RFID

Page 17: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Other systems

I 125 kHz Proximity Cards: Access Control

I Legic Prime: Proprietary in 13,56MHz, Access Control,Company Cards

I iClass, . . .

I NFC ⊂ RFID

Page 18: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Other systems

I 125 kHz Proximity Cards: Access Control

I Legic Prime: Proprietary in 13,56MHz, Access Control,Company Cards

I iClass, . . .

I NFC ⊂ RFID

Page 19: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Use Cases

I Access Control

I Payment

I Tickets in Public Transportation

I Determination of Position

I Verification of Ownership

I “Smart Posters”

I Business Cards

I Personalized Key

I Generally: Storage

Page 20: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards
Page 21: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Power Supply & Communication Basics

I Power supply via induction field

I Two transmission modes: passive and activeI Passive

I ConnectionlessI Roles: Initiator (Reader) and Target (Tag/Card)I Request/Response communication

I Active

I Connection-orientedI Equal communication partnersI Unusual

Page 22: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Power Supply & Communication Basics

I Power supply via induction field

I Two transmission modes: passive and active

I Passive

I ConnectionlessI Roles: Initiator (Reader) and Target (Tag/Card)I Request/Response communication

I Active

I Connection-orientedI Equal communication partnersI Unusual

Page 23: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Power Supply & Communication Basics

I Power supply via induction field

I Two transmission modes: passive and activeI Passive

I ConnectionlessI Roles: Initiator (Reader) and Target (Tag/Card)I Request/Response communication

I ActiveI Connection-orientedI Equal communication partnersI Unusual

Page 24: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Power Supply & Communication Basics

I Power supply via induction field

I Two transmission modes: passive and activeI Passive

I ConnectionlessI Roles: Initiator (Reader) and Target (Tag/Card)I Request/Response communication

I ActiveI Connection-orientedI Equal communication partnersI Unusual

Page 25: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Low Level Communication

I ISO 14443-3: Initialization and AnticollisionI 8 Bit + 1 Parity BitI Basic Protocol: Command + Parameter + Data + CRC

I ISO 14443-4: Transmission Protocol

I Length + Format + Interface Bytes + Historical Bytes + Data+ CRC

I Interface Bytes: communication options (optional)I Historical Bytes: misc. infos (optional, ISO 7816-4)

Page 26: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Low Level Communication

I ISO 14443-3: Initialization and AnticollisionI 8 Bit + 1 Parity BitI Basic Protocol: Command + Parameter + Data + CRC

I ISO 14443-4: Transmission ProtocolI Length + Format + Interface Bytes + Historical Bytes + Data

+ CRCI Interface Bytes: communication options (optional)I Historical Bytes: misc. infos (optional, ISO 7816-4)

Page 27: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

I Usual Question: what happens if multiple cards are in therange of a reader?

I Solution: Anticollision Protocol

I Initiator chooses target by unique target identifiers (UIDs)

I Some kind of binary search: targets send UID prefixes,initiator chooses

I Negotiation of higher level protocols

Page 28: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

I Usual Question: what happens if multiple cards are in therange of a reader?

I Solution: Anticollision Protocol

I Initiator chooses target by unique target identifiers (UIDs)

I Some kind of binary search: targets send UID prefixes,initiator chooses

I Negotiation of higher level protocols

Page 29: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

I Usual Question: what happens if multiple cards are in therange of a reader?

I Solution: Anticollision Protocol

I Initiator chooses target by unique target identifiers (UIDs)

I Some kind of binary search: targets send UID prefixes,initiator chooses

I Negotiation of higher level protocols

Page 30: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

I Usual Question: what happens if multiple cards are in therange of a reader?

I Solution: Anticollision Protocol

I Initiator chooses target by unique target identifiers (UIDs)

I Some kind of binary search: targets send UID prefixes,initiator chooses

I Negotiation of higher level protocols

Page 31: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

CC BY-NC-SA 2.0 libnfc.org

Page 32: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

Any security here?

Page 33: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

Page 34: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

Page 35: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anti Collision Protocol

Nope!

I No transport encryption

I Overwritten data visible

Page 36: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 37: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 38: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 39: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 40: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 41: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Anticollision Protocol Example

1. R: 26 ⇒ Welcome (REQA)

2. T: 44 03 ⇒ Respond (ATQA)

3. R: 93 20 ⇒ Select cascade 1 (SEL)

4. T: 88 04 34 74 cc ⇒ CT, UID(byte 1,2,3), BCC

5. R: 93 70 88 04 34 74 cc 0e 05 ⇒ Select available tag (SEL)

6. T: 24 d8 36 ⇒ Select Acknowledge (SAK)

7. R: 95 20 ⇒ Select cascade 2 (SEL)

8. T: e1 e3 1c 80 9e ⇒ UID(byte 4,5,6,7), BCC

9. R: 95 70 e1 e3 1c 80 9e b9 e1 ⇒ Finish select (SEL)

10. T: 20 fc 70 ⇒ SAK without cascade bit set

11. R: e0 50 bc a5 ⇒ Request Answer to Select (RATS)

12. T: 06 75 77 81 02 80 ⇒ ATS (DESFire EV1)

13. R: 50 00 57 cd ⇒ Disable (HALT)

CC BY-NC-SA 2.0 libnfc.org

Page 42: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets talk about security!

I NFC itself was made to be contactless, not secure.

I There is no security at lower protocol layers!

I Security is implemented at the application layer

I . . . if it is implemented.

Page 43: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets talk about security!

I NFC itself was made to be contactless, not secure.

I There is no security at lower protocol layers!

I Security is implemented at the application layer

I . . . if it is implemented.

Page 44: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets talk about security!

I NFC itself was made to be contactless, not secure.

I There is no security at lower protocol layers!

I Security is implemented at the application layer

I . . . if it is implemented.

Page 45: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets talk about security!

I NFC itself was made to be contactless, not secure.

I There is no security at lower protocol layers!

I Security is implemented at the application layer

I . . . if it is implemented.

Page 46: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC in EC Cards

I Since end of 2011, Sparkassen in Germany started to issuecards with a contactless payment system.

I Somewhere in 2012 it was rebranded to girogo

I Basically it is the GeldKarte system with a radio interface.I There’s an app for reading these cards (S-Reader)

I Loaded amount of moneyI Validity of cardI Charging and Payments

I Is this all data?

Page 47: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC in EC Cards

I Since end of 2011, Sparkassen in Germany started to issuecards with a contactless payment system.

I Somewhere in 2012 it was rebranded to girogo

I Basically it is the GeldKarte system with a radio interface.I There’s an app for reading these cards (S-Reader)

I Loaded amount of moneyI Validity of cardI Charging and Payments

I Is this all data?

Page 48: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC in EC Cards

I Since end of 2011, Sparkassen in Germany started to issuecards with a contactless payment system.

I Somewhere in 2012 it was rebranded to girogo

I Basically it is the GeldKarte system with a radio interface.I There’s an app for reading these cards (S-Reader)

I Loaded amount of moneyI Validity of cardI Charging and Payments

I Is this all data?

Page 49: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC in EC Cards

I Since end of 2011, Sparkassen in Germany started to issuecards with a contactless payment system.

I Somewhere in 2012 it was rebranded to girogo

I Basically it is the GeldKarte system with a radio interface.I There’s an app for reading these cards (S-Reader)

I Loaded amount of moneyI Validity of cardI Charging and Payments

I Is this all data?

Page 50: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information?

Yes:I a leaked spec from 1997:

http://koeln.ccc.de/archiv/doku/geldkarte.pdfI EMV specs, publicly available:

https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the data

I It reads everything that the official app reads

andadditionally. . .

I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 51: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the data

I It reads everything that the official app reads

andadditionally. . .

I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 52: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the data

I It reads everything that the official app reads

andadditionally. . .

I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 53: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo

Page 54: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the data

I It reads everything that the official app reads

andadditionally. . .

I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 55: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo

Page 56: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the dataI It reads everything that the official app reads and

additionally. . .

I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 57: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the dataI It reads everything that the official app reads and

additionally. . .I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)

I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 58: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Reverse Engineering of girogo1. Is there existing information? Yes:

I a leaked spec from 1997:http://koeln.ccc.de/archiv/doku/geldkarte.pdf

I EMV specs, publicly available:https://www.emvco.com/specifications.aspx

2. Decompilation of the appI dex2jarI jd-gui

3. Built a fuzzer that tries to access further records

4. Built an app that extracts the dataI It reads everything that the official app reads and

additionally. . .I The date of activation (boring)I bank code number (hmmm)I an unique card identifier (privacy)I the card number (privacy)I an account number, but not the customers (what???)I for each transaction: the identifier of the counterpart (privacy!)

Page 59: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Screenshots

Page 60: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Screenshots

Page 61: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Screenshots

Page 62: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Screenshots

Page 63: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

I Payment is secured cryptographically, at least nothing that isbreakable in few days.

I Kasse2Go (the payment app, very short analysis withoutretailer card)

I online verification of retailer card - no possibility was found toconvince the backend that I’m a retailer.

I communication with backend is authenticated and encrypted.

I No obvious possibilities to interfere the payment process fromthe network.

I Payment runs on a smartphone, software under control ofpotentially malicious merchants.

I Some privacy-relevant information is available via NFC.

I How widespread is this app?

Page 64: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

I Payment is secured cryptographically, at least nothing that isbreakable in few days.

I Kasse2Go (the payment app, very short analysis withoutretailer card)

I online verification of retailer card - no possibility was found toconvince the backend that I’m a retailer.

I communication with backend is authenticated and encrypted.

I No obvious possibilities to interfere the payment process fromthe network.

I Payment runs on a smartphone, software under control ofpotentially malicious merchants.

I Some privacy-relevant information is available via NFC.

I How widespread is this app?

Page 65: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

I Payment is secured cryptographically, at least nothing that isbreakable in few days.

I Kasse2Go (the payment app, very short analysis withoutretailer card)

I online verification of retailer card - no possibility was found toconvince the backend that I’m a retailer.

I communication with backend is authenticated and encrypted.

I No obvious possibilities to interfere the payment process fromthe network.

I Payment runs on a smartphone, software under control ofpotentially malicious merchants.

I Some privacy-relevant information is available via NFC.

I How widespread is this app?

Page 66: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

I Payment is secured cryptographically, at least nothing that isbreakable in few days.

I Kasse2Go (the payment app, very short analysis withoutretailer card)

I online verification of retailer card - no possibility was found toconvince the backend that I’m a retailer.

I communication with backend is authenticated and encrypted.

I No obvious possibilities to interfere the payment process fromthe network.

I Payment runs on a smartphone, software under control ofpotentially malicious merchants.

I Some privacy-relevant information is available via NFC.

I How widespread is this app?

Page 67: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

I Payment is secured cryptographically, at least nothing that isbreakable in few days.

I Kasse2Go (the payment app, very short analysis withoutretailer card)

I online verification of retailer card - no possibility was found toconvince the backend that I’m a retailer.

I communication with backend is authenticated and encrypted.

I No obvious possibilities to interfere the payment process fromthe network.

I Payment runs on a smartphone, software under control ofpotentially malicious merchants.

I Some privacy-relevant information is available via NFC.

I How widespread is this app?

Page 68: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of the (short) girogo analysis

Page 69: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

EMV

I Communication is defined in the EMV standardI APDU: CLA + INS + P1 + P2 + Ld + Data + LeI EMV further defines a structure somewhat similar to folders

(Application IDs) and files

I Activation of the GeldKarte/girogo AID: 00 A4 04 0C 09 D276 00 00 25 45 50 02 00

I 00 B2 01 xx 00 reads a data recordI C4: EF BETRAG (amount of loaded money)I CC: EF BOERSE (bank id, account number)

I 00 B2 xx EC 00: read transactions

I Data is clear-text (ASCII) or BCD encoded (25,00 EUR =0x25 0x00)

Page 70: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

EMV

I Communication is defined in the EMV standardI APDU: CLA + INS + P1 + P2 + Ld + Data + LeI EMV further defines a structure somewhat similar to folders

(Application IDs) and files

I Activation of the GeldKarte/girogo AID: 00 A4 04 0C 09 D276 00 00 25 45 50 02 00

I 00 B2 01 xx 00 reads a data recordI C4: EF BETRAG (amount of loaded money)I CC: EF BOERSE (bank id, account number)

I 00 B2 xx EC 00: read transactions

I Data is clear-text (ASCII) or BCD encoded (25,00 EUR =0x25 0x00)

Page 71: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

EMV

I Communication is defined in the EMV standardI APDU: CLA + INS + P1 + P2 + Ld + Data + LeI EMV further defines a structure somewhat similar to folders

(Application IDs) and files

I Activation of the GeldKarte/girogo AID: 00 A4 04 0C 09 D276 00 00 25 45 50 02 00

I 00 B2 01 xx 00 reads a data recordI C4: EF BETRAG (amount of loaded money)I CC: EF BOERSE (bank id, account number)

I 00 B2 xx EC 00: read transactions

I Data is clear-text (ASCII) or BCD encoded (25,00 EUR =0x25 0x00)

Page 72: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

EMV

I Communication is defined in the EMV standardI APDU: CLA + INS + P1 + P2 + Ld + Data + LeI EMV further defines a structure somewhat similar to folders

(Application IDs) and files

I Activation of the GeldKarte/girogo AID: 00 A4 04 0C 09 D276 00 00 25 45 50 02 00

I 00 B2 01 xx 00 reads a data recordI C4: EF BETRAG (amount of loaded money)I CC: EF BOERSE (bank id, account number)

I 00 B2 xx EC 00: read transactions

I Data is clear-text (ASCII) or BCD encoded (25,00 EUR =0x25 0x00)

Page 73: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

Page 74: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

I Mastercard PayPass

I Visa PayWave

I Again looked with the NFC Fuzzer at it. . .

Page 75: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

I Mastercard PayPass

I Visa PayWave

I Again looked with the NFC Fuzzer at it. . .

Page 76: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

Page 77: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

Page 78: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

But there is the CVC!!1 The shops must verify it!!!

Page 79: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Lets look at credit cards

Really?

Page 80: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Implementation Details

I AIDs depend on card, they are printed on receipts andavailable from public sources, e.g.https://www.eftlab.com.au/index.php/site-map/

knowledge-base/211-emv-aid-rid-pix

I AIDs differ even between countries

I Examples for application selection sequences:I VISA: 00 A4 04 0C 07 A0 00 00 00 03 10 10 00I MasterCard: 00 A4 04 0C 07 A0 00 00 00 04 99 99 00

I The interesting file is requested with: 00 B2 01 0C 00

I ASCII encoding

I Implementation (girogo + MasterCard/VISA): https://github.com/thomaspatzke/android-nfc-paycardreader

Page 81: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Implementation Details

I AIDs depend on card, they are printed on receipts andavailable from public sources, e.g.https://www.eftlab.com.au/index.php/site-map/

knowledge-base/211-emv-aid-rid-pix

I AIDs differ even between countriesI Examples for application selection sequences:

I VISA: 00 A4 04 0C 07 A0 00 00 00 03 10 10 00I MasterCard: 00 A4 04 0C 07 A0 00 00 00 04 99 99 00

I The interesting file is requested with: 00 B2 01 0C 00

I ASCII encoding

I Implementation (girogo + MasterCard/VISA): https://github.com/thomaspatzke/android-nfc-paycardreader

Page 82: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Implementation Details

I AIDs depend on card, they are printed on receipts andavailable from public sources, e.g.https://www.eftlab.com.au/index.php/site-map/

knowledge-base/211-emv-aid-rid-pix

I AIDs differ even between countriesI Examples for application selection sequences:

I VISA: 00 A4 04 0C 07 A0 00 00 00 03 10 10 00I MasterCard: 00 A4 04 0C 07 A0 00 00 00 04 99 99 00

I The interesting file is requested with: 00 B2 01 0C 00

I ASCII encoding

I Implementation (girogo + MasterCard/VISA): https://github.com/thomaspatzke/android-nfc-paycardreader

Page 83: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Implementation Details

I AIDs depend on card, they are printed on receipts andavailable from public sources, e.g.https://www.eftlab.com.au/index.php/site-map/

knowledge-base/211-emv-aid-rid-pix

I AIDs differ even between countriesI Examples for application selection sequences:

I VISA: 00 A4 04 0C 07 A0 00 00 00 03 10 10 00I MasterCard: 00 A4 04 0C 07 A0 00 00 00 04 99 99 00

I The interesting file is requested with: 00 B2 01 0C 00

I ASCII encoding

I Implementation (girogo + MasterCard/VISA): https://github.com/thomaspatzke/android-nfc-paycardreader

Page 84: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 85: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 86: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 87: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 88: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 89: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 90: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 91: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Summary of Credit Card Vulnerabilities

I No authentication and authorization before access to sensibledata.

I No transport encryption - data can be sniffed over the air.

I The insecure magstripe mode shown here is implemented forcompatibility reasons. There is a secure EMV mode (akaChip&PIN)

Payment process:

1. Salesperson enters amount

2. Customer puts card on payment terminal

3. After a short time the payment is done

I Where is the authorization (PIN entry) gone?

I The card companies say: putting the card on the terminal is aconsent of the card owner!

I This is secure the say!

Page 92: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Secure?

Is the card moved to the payment terminal?

. . . or is the terminal moved to the card?And then there are relaying attacks

Page 93: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Secure?

Is the card moved to the payment terminal?

. . . or is the terminal moved to the card?

And then there are relaying attacks

Page 94: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Secure?

Is the card moved to the payment terminal?

. . . or is the terminal moved to the card?And then there are relaying attacks

Page 95: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Access Control

I Access control systems are often based on dumb 125kHz tags

I Dumb? Yes, because of this:

Page 96: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Access Control

I Access control systems are often based on dumb 125kHz tags

I Dumb? Yes, because of this:

Page 97: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Access Control

I Access control systems are often based on dumb 125kHz tags

I Dumb? Yes, because of this:

Page 98: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?

I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 99: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?

I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 100: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigated

I Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 101: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channels

I Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 102: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacks

I Identify sensible data and require authentication/authorizationfor access, write protection

I Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 103: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protection

I Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 104: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.

I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 105: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5m

I Monitor the usage, e.g. one tag used at the same time indifferent locations.

Page 106: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Securing NFC SystemsI Personal protection

I Put your card in sleevesI Cut the antenna

I Building a product?I Don’t use known insecure systemsI If you’re nailed on an insecure system: under certain

conditions, vulnerabilities can be mitigatedI Encrypt the communication, ensure integrityI Consider side channelsI Consider replay and relay attacksI Identify sensible data and require authentication/authorization

for access, write protectionI Don’t rely on availability: tags can be destroyed or replacedI Tags can be moved: don’t believe that someone scans the tag

where you placed it.I Transmissions can be sniffed up to 10m awayI Communication can possibly be initiated at bigger ranges,

than just some cm - consider at least 1,5mI Monitor the usage, e.g. one tag used at the same time in

different locations.

Page 107: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC Hacking - Android

I Android DevicesI Android Framework: the android.nfc.* API offers interesting

possibilities. NfcAdapter, NfcManager, NdefMessage,NdefRecord.

I http://developer.android.com/guide/topics/

connectivity/nfc/index.htmlI Supports SO 14443-3A, 14443-3B, 14443-4, NDEF, Mifare

Classic+Ultralight and few other systems.I Communication with smartcards, reading/writing NDEF tags

etc.

I But: no proprietary systems, no low-level access, restrictedcard simulation, restricted timing control

I Several 100EUR. Possibly a bit expensive, if you don’t need anew phone/tablet.

Page 108: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC Hacking - Android

I Android DevicesI Android Framework: the android.nfc.* API offers interesting

possibilities. NfcAdapter, NfcManager, NdefMessage,NdefRecord.

I http://developer.android.com/guide/topics/

connectivity/nfc/index.htmlI Supports SO 14443-3A, 14443-3B, 14443-4, NDEF, Mifare

Classic+Ultralight and few other systems.I Communication with smartcards, reading/writing NDEF tags

etc.I But: no proprietary systems, no low-level access, restricted

card simulation, restricted timing controlI Several 100EUR. Possibly a bit expensive, if you don’t need a

new phone/tablet.

Page 109: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC Hacking - Android Apps

I NXP NFC TagInfo: https://play.google.com/store/apps/details?id=com.nxp.taginfolite

I NXP TagWriter: https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter

I NFC TagInfo: https://play.google.com/store/apps/details?id=at.mroland.android.apps.nfctaginfo

I Banking Card Reader NFC (EMV):https://play.google.com/store/apps/details?id=

com.github.devnied.emvnfccard

I . . . and its API: https://github.com/devnied/EMV-NFC-Paycard-Enrollment

I CardTest: https://play.google.com/store/apps/details?id=com.samj.CardTest

Page 110: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC Hacking - NFC Readers

I NFC ReadersI Tikitag, OpenPCDI libnfc: http://nfc-tools.orgI Live RFID Hacking System:

http://www.openpcd.org/Live_RFID_Hacking_SystemI Price: <50EURI Same drawbacks as above

I Proxmark3I SDR-based, can principally support very much in 13,56MHz

and 125-134kHz.I FPGA: precise timing, for attacks like MIFARE breaking.I Expensive: 230-500EURI a bit “hacky”

Page 111: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

NFC Hacking - NFC Readers

I NFC ReadersI Tikitag, OpenPCDI libnfc: http://nfc-tools.orgI Live RFID Hacking System:

http://www.openpcd.org/Live_RFID_Hacking_SystemI Price: <50EURI Same drawbacks as above

I Proxmark3I SDR-based, can principally support very much in 13,56MHz

and 125-134kHz.I FPGA: precise timing, for attacks like MIFARE breaking.I Expensive: 230-500EURI a bit “hacky”

Page 112: Near Field Communication Securitydemo.skora.net/NFC_Talk.pdf · I Near Field Communication I Few cm communication distance I Power supply by reader I 13,56 MHz, 424kBit/s I ISO standards

Questions?

Web: http://patzke.orgMail: [email protected]: @blubbfiction