DEFCON Presentation

  • View
    221

  • Download
    0

Embed Size (px)

Text of DEFCON Presentation

  • 8/6/2019 DEFCON Presentation

    1/116

    Bypassing Smart-Card

    Authentication and Blocking

    Debiting:

    Jonathan LeeNeil Pahl

    Vulnerabilities in Atmel Cryptomemory basedStored-Value Systems

  • 8/6/2019 DEFCON Presentation

    2/116

    Primer

    Who are we?

    Jonathan Lee UBC Computer Engineeringstudent

    Neil Pahl UBC Electrical Engineering, recentgraduate

  • 8/6/2019 DEFCON Presentation

    3/116

    Disclaimer !

    - We are not (yet) security industry

    professionals or 1337 code-breaking hackers

    - We did not break Smart Card Security

    - But, we can show that even with introductorysecurity knowledge, we were able to find

    vulnerability in a secure systems

    implementation

  • 8/6/2019 DEFCON Presentation

    4/116

    Primer

    What do we know about Security?

    EECE 412: Intro to Computer Security Fundamental Security Principles

    Cryptography

    Authentication

    Access Control

    Secure Design

  • 8/6/2019 DEFCON Presentation

    5/116

    Primer

    What Was Our Motivation For this Project?

    Term Project to Perform a Security Analysis(Opportunity to Legitimately try Cool Hacks)

    Smart Cards are synonymous with Security

    We hoped to emulate known replay attacks on anearby Smart Card laundry system

  • 8/6/2019 DEFCON Presentation

    6/116

    Primer

    Why should anyone care about our Hack?

    Companies spend time and money to add more

    security functions to their products

    However, security functions cannot protect the

    system if they are not implemented thoughtfully

  • 8/6/2019 DEFCON Presentation

    7/116

    History?

    The need for Authentication + Encryption

    Joe Grand (2009) SF parking meters, vulnerable

    to replay attack

    Strom Carlson (2006) Fedex Kinkos SLE4442,

    vulnerable to simple password replay

  • 8/6/2019 DEFCON Presentation

    8/116

    Early Efforts

    Smart card laundry machine (stored value card)

  • 8/6/2019 DEFCON Presentation

    9/116

    Early Efforts

    We were thinking of trying some of the usualattacks:

    Could we simply read and modify monetary valuesdirectly on the card?

    Could we sniff out read/write passwords?

    Could we perform replay attacks?

    But, the success of these attacks depend on thesecurity measures in place

  • 8/6/2019 DEFCON Presentation

    10/116

    Early Efforts

    A few Google searches lead us to an interestingblog of someone attempting to hack a laundrysystem (http://tinyurl.com/2csk6dr)

    Their success was limited to reading theconfiguration settings from the card.

    We couldnt confirm it yet, but we decided to startwith the assumption that our system used thesame chip.

    http://tinyurl.com/2csk6drhttp://tinyurl.com/2csk6dr
  • 8/6/2019 DEFCON Presentation

    11/116

    Early Efforts

    Atmel CryptoMemory AT88SC0404 Smart-card

    ATR: 3B B2 11 00 10 80 00 04

  • 8/6/2019 DEFCON Presentation

    12/116

    Early Efforts

    High Security Features:

    64-bit Mutual Authentication Protocol (under license

    of ELVA)

    Encrypted Checksum

    Stream Encryption

    Four Key Sets for Authentication and Encryption

    Eight Sets of Two 24-bit Passwords

    Anti-tearing Function

    Voltage and Frequency Monitor

  • 8/6/2019 DEFCON Presentation

    13/116

    Early Efforts

    Security Modes:

    Standard/password mode is Default

    Command sequences are needed to enter othersecurity modes

  • 8/6/2019 DEFCON Presentation

    14/116

    Atmel CryptoMemory AT88SC0404

  • 8/6/2019 DEFCON Presentation

    15/116

    Atmel CryptoMemory AT88SC0404

  • 8/6/2019 DEFCON Presentation

    16/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

  • 8/6/2019 DEFCON Presentation

    17/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    Addresses

  • 8/6/2019 DEFCON Presentation

    18/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    Addresses

    Status - Access Granted

  • 8/6/2019 DEFCON Presentation

    19/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    Addresses

    Status - Access Granted

    Status - Access Denied

  • 8/6/2019 DEFCON Presentation

    20/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    DCR Data Config Reg

  • 8/6/2019 DEFCON Presentation

    21/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    DCR Data Config Reg

    1011 1111

  • 8/6/2019 DEFCON Presentation

    22/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    DCR Data Config Reg

    1011 1111

    4 Authen. Attempts Allowed

  • 8/6/2019 DEFCON Presentation

    23/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    DCR Data Config Reg

    1011 1111

    4 Authen. Attempts Allowed

    Authen. Attemps Counter Enabled

  • 8/6/2019 DEFCON Presentation

    24/116

  • 8/6/2019 DEFCON Presentation

    25/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    ARn Access Registers

    1101 1111

  • 8/6/2019 DEFCON Presentation

    26/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    ARn Access Registers

    1101 1111

    Encryption not necessary

  • 8/6/2019 DEFCON Presentation

    27/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    ARn Access Registers

    1101 1111

    Encryption not necessary

    no read/write passwords

  • 8/6/2019 DEFCON Presentation

    28/116

    Atmel CryptoMemory AT88SC0404

    Interpreting the Memory Dump:

    ARn Access Registers

    1101 1111

    Encryption not necessary

    no read/write passwords

    Authentication required for

    read/write command use

  • 8/6/2019 DEFCON Presentation

    29/116

    Atmel CryptoMemory AT88SC0404

    We Now Know: What it Tells Us:

  • 8/6/2019 DEFCON Presentation

    30/116

    Atmel CryptoMemory AT88SC0404

    We Now Know: Authentication Attempts

    Counter Enabled

    4 Authentication AttemptsAllowed

    What it Tells Us:

    Brute force key cracking is

    impossible

  • 8/6/2019 DEFCON Presentation

    31/116

    Atmel CryptoMemory AT88SC0404

    We Now Know: Authentication Attempts

    Counter Enabled

    4 Authentication AttemptsAllowed

    Encryption not necessary

    What it Tells Us:

    Brute force key cracking is

    impossible

    Might be able to sniff

    read/write passwords

  • 8/6/2019 DEFCON Presentation

    32/116

    Atmel CryptoMemory AT88SC0404

    We Now Know: Authentication Attempts

    Counter Enabled

    4 Authentication AttemptsAllowed

    Encryption not necessary

    No read/write passwords

    What it Tells Us:

    Brute force key cracking is

    impossible

    Might be able to sniff

    read/write passwords

    No Passwords to sniff

  • 8/6/2019 DEFCON Presentation

    33/116

    Atmel CryptoMemory AT88SC0404

    We Now Know: Authentication Attempts

    Counter Enabled

    4 Authentication AttemptsAllowed

    Encryption not necessary

    No read/write passwords

    Authentication required

    for read/write command

    use

    What it Tells Us:

    Brute force key cracking is

    impossible

    Might be able to sniff

    read/write passwords

    No Passwords to sniff

    System will be run

    under Authentication Mode

    mode

  • 8/6/2019 DEFCON Presentation

    34/116

    Atmel CryptoMemory AT88SC0404

    Recall the Security Modes:

    MAC Value used for data integrity check is a

    checksum encrypted by a session key

    This rules out Replay Attack!

  • 8/6/2019 DEFCON Presentation

    35/116

    Early Findings

    A simple replay attack isnt possible

    And we have no expertise or time for crypto-

    analysis of authentication procedure either

    (6 weeks!!)

    Whats left?

  • 8/6/2019 DEFCON Presentation

    36/116

  • 8/6/2019 DEFCON Presentation

    37/116

    A HypothesisWhat would be the most logical implementation of this

    type of system?

  • 8/6/2019 DEFCON Presentation

    38/116

    A HypothesisWhat would be the most logical implementation of this

    type of system?

    Would there be a MiM opportunity here?

  • 8/6/2019 DEFCON Presentation

    39/116

    Alice, Bob and Trudy

    Man in the middle concept

    Can we apply this in hardware?

  • 8/6/2019 DEFCON Presentation

    40/116

    MACHINE-TO-CARD

    COMMUNICATION

  • 8/6/2019 DEFCON Presentation

    41/116

    Machine-to-Card Communication

    Sniffing Tools:

    Modified Smart Card

    RESET

    GROUND

    DATA IO

    CLOCK

  • 8/6/2019 DEFCON Presentation

    42/116

    Machine-to-Card Communication

    Sniffing Tools:

    Modified Smart Card

    Logic Analyzer

  • 8/6/2019 DEFCON Presentation

    43/116

  • 8/6/2019 DEFCON Presentation

    44/116

    Machine-to-Card Communication

    Communication Flow(Before Pressing Start): Card Sends Answer To Reset (ATR)

    Machine Reads 8-Byte Cryptogram and 7-Byte IDo Machine uses Cryptogram to compute challenge value

    Machine Sends Authentication Re