Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds:...

41
Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer: Dr. Tom Chothia Flavio D. Garcia Roel Verdult Josep Balasch University of Birmingham

Transcript of Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds:...

Page 1: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Gone in 360 Seconds: Hijacking with Hitag2

Internet Security Seminar 2013

Presenter: Evgeny ZhavoronkovLecturer: Dr. Tom Chothia

Flavio D. GarciaRoel Verdult

Josep Balasch

University of Birmingham

Page 2: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

How this car can be stolen?

Page 3: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Contents

Introduction

Hardware

Hitag2

Weaknesses

Attacks

Start a car

Mitigation

Conclusion

Page 4: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Introduction

Page 5: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Introduction

Vehicle engine protection mechanisms nowadays:

Mechanical keys

Electronic immobilizer

Different third-party or hand-made protection

systems

The most popular protection is immobilizer

From 1995 immobilizer is mandatory in EU

European directive 95/56/EC

Also in Australia, New Zealand, Canada etc.

Page 6: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Electronic immobilizer

Electronic vehicle immobilizer is an anti-theft device which prevents the engine of the vehicle from starting unless the corresponding transponder is present.

Page 7: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Electronic immobilizer

Page 8: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hitag2

Hitag2 , introduced in 1996 is currently the most widely used transponder

Page 9: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hitag2

Not only engines, but even doors use Hitag2 transponder in modern cars using hybrid keys

Page 10: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hitag2 notes

Hitag 2 transponders produced by NXP Semiconductors (foremly Philips Simiconductors) which leads immobilizer market

NXP boosts “Unbreakable security levels using mutual authentication, challenge-response and encrypted data communication”

Hitag2 is also used as a backup mechanism for opening the doors when the battery of the remote is depleted

Hitag2 cipher uses a shared key of 48 bits

Page 11: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

MakeMake ModelModel

Acura CSX, MDX, RDX, TL, TSX

Alfa Romeo 156, 159, 166, Brera, Giulietta, Mito, Spider

Audi A8

Bentley Continental

BMW Series 1, 5, 6, 7, all bikes

Buick Enclave, Lucerne

Cadillac BLS, DTS, Escalade, SRX, STS, XLR

Chevrolet Avanlache, Caprice, Captiva, Cobalt, Equinox, Express, HHR, Impala, Malibu, Montecarlo, Silverado, Suburban, Tahoe, Trailblazer, Uplander

Chrysler 300C, Aspen, Grand Voyager, Pacifica, Pt Cruiser, Sebring, Town Country, Voyager

Citroen Berlingo, C-Crosser, C2, C3, C4, C4 Picasso, C5, C6, C8, Nemo, Saxo, Xsara, Xsara Picasso

Dacia Duster, Logan, Sandero

Daewoo Captiva, Windstorm

Dodge Avenger, Caliber, Caravan, Charger, Dakota, Durango, Grand Caravan, Journey, Magnum, Nitro, Ram

Fiat 500, Bravo, Croma, Daily, Doblo, Fiorino, Grande Punto, Panda, Phedra, Ulysse, Scudo

GMC Acadia, Denali, Envoy, Savana, Siera, Terrain, Volt, Yukon

Honda Accord, Civic, CR-V, Element, Fit, Insight, Stream, Jazz, Odyssey, Pilot, Ridgeline, most bikes

Continue...

Page 12: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

MakeMake ModelModel

Hummer H2, H3

Hyundai 130, Accent, Atos Prime, Coupe, Elantra, Excel, Getz, Grandeur, I30, Matrix, Santafe, Sonata, Terracan, Tiburon, Tucoson, Tuscanti

Isuzu D-Max

Iveco 35C11, Eurostar, New Daily, S-2000

Jeep Commander, Compass, Grand Cherokee, Liberty, Patriot, Wrangler

Kia Carens, Carnival, Ceed, Cerato, Magentis, Mentor, Optima, Picanto, Rio, Sephia, Sorento, Spectra, Sportage

Lancia Delta, Musa, Phedra

Mini Cooper

Mitsubishi 380, Colt, Eclipse, Endeavor, Galant, Grandis, L200, Lancer, Magna, Outlander, Outlander, Pajero, Raider

Nissan Almera, Juke, Micra, Pathfinder, Primera, Qashqai, Interstar, Note, Xterra

Opel Agila, Antara, Astra, Corsa, Movano, Signum, Vectra, Vivaro, Zafira

Peugeot 106, 206, 207, 307, 406, 407, 607, 807, 1007, 3008, 5008, Beeper, Partner, Boxer, RCZ

Pontiac G5, G6, Pursuit, Solstice, Torrent

Porsche Cayenne

Renault Clio, Duster, Kangoo, Laguna II, Logan, Master, Megane, Modus, Sandero, Trafic, Twingo

Saturn Aura, Outlook, Sky, Vue

Suzuki Alto, Grand Vitara, Splash, Swift, Vitara, XL-7

Volkswagen Touareg, Phaeton

Page 13: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

In paper

Several vulnerabilities in the Hitag2

Three attacks

More than 20 vehicles were tested

On all vehicles the engine was started

successfully

Page 14: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Vulnerabilities

No PRNG in transponder.Authentication vulnerable to replay attacks. Moreover, the transponder provides known data for a read command

1/4 authentication attempts leaks one bit of information about the secret key

48-bits internal state of the cipher is only randomized by a nonce of 32-bits. 16 bits of the secret key are persistent throughout different sessions

Page 15: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hardware

Page 16: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hardware Setup

Proxmark III board

200 USD

125 kHz – 13.56MHz

FPGA for modulation

and demodulation

ARM for encryption

and decryption

Page 17: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Modulation

Communication from reader to transponder is encoded using Binary Pulse Length Modulation (BPLM)

Page 18: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Modulation

From transponder to reader: Manchester or Biphase coding

Page 19: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Hitag2

Page 20: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Functionality

Hitag2 transponders offer up to three different modes of operation:

In public mode the contents of the user data pages are simply broadcastIn password mode reader and transponder authenticate each other by interchanging their passwordsIn crypto mode the reader and the transponder per form a mutual authentication by means of a 48-bit shared key. Communication between reader and transponder is encrypted using a proprietary stream cipher.

Page 21: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Memory

Hitag2 transponders have a total of 256 bits EEPROM organized in 8 blocks of 4 bytesAccess to any of the blocks in crypto mode is only granted after authentication

Page 22: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Communication

A redundancy message is the bit-complement of the last five bits of the command

Page 23: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Stream Cipher

Hitag2 Stream Cipher is used in crypto modeThe cipher consists of:

48-bit linear feedback shift register (LFSR)Non-linear filter function f

Each clock tick 20 bits of LFSR go through f = 1 bit of keystreamLFSR shifts 1 bit left, using the generating polynomial to generate a new bit on the right

Page 24: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Authentication protocol

Revered engineered in 2007After authentication communication is encrypted: XOR-ed with keystream

Page 25: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Cipher Initialization

During the authentication protocol, the internal state of stream cipher is initialized

32-bit identifier + the first 16-bits of the key

Nr XOR-ed with the last 32-bits of the key is shifted in

LFSR feedback is disabled

Page 26: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Rollback

It is possible to recover the key

LFSR can be rolled back to time zero

Since ID and Nr are known

Page 27: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Weaknesses

Page 28: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Arbitrary length keystream oracle

Protocol flow

It's possible to gather an arbitrary length of keystream bits from the transponder

Since there is no challenge from the transponder it is possible to replay any valid {Nr}{Ar}

There are 2^10 possibilities

Page 29: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Dependencies between sessions

Weakness in cipher's design

At a specific state the cipher is fully initialized and from there on it only produces keystreams

48-bit internal state of the cipher is randomized by a reader nonce Nr of only 32 bits

At that state, only LFSR bits 16 to 47 are affected by the reader nonce

LFSR bits 0 to 15 remain constant throughout different session which gives a strong dependency between them

Page 30: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Low degree determination of the f

Weakness in cipher's designThe filter function consists of three building blocks arranged in a 2 layer structureSpecific Input bits only affect the rightmost input bit of the third function building blockIn 8 out of 32 configurations of the input bits, the rightmost input bit has no influence on the outputThe output is determined by its 4-leftmost input bitsWith probability 1/4 the filter function f is determined by the 34-leftmost bits of the internal state

Page 31: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Attacks

Page 32: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Malleability attack

During the authentication algorithm the

transponder does not provide any challenge to

the reader

An adversary can recover the keystream and

then to read or write any memory block

Sometimes Memory is read-protected

Page 33: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Time/memory tradeoff atttack

The Attack against any LFSR-based stream

ciphers

The linear difference between state S and its

N-th successor is a combination of the linear

differences generated by each bit

1 minute in total to execute the attack from

begin to end

Page 34: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Cryptanalytic attack

Gather a few authentication attempts from a car

Requires to obtain a valid transponder ID

The dependencies between sessions allow the

attacker to perform the test many times

decreasing drastically the amount of candidate

keys

The whole attack can be performed in less than

360 seconds

Page 35: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Start a car

Page 36: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Start!

http://www.youtube.com/watch?v=S8z9mgIkqBA

Page 37: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Mitigation

Page 38: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Mitigation

AES in CBC modeExtend the transponder passwordDelay authentication after failure

Page 39: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Conclusion

Page 40: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Conclusion

Secure transponder price: < 1 USD

vs car price: ~50 000 USD

NXP produces AES version of Hitag2

There are secure solutions in the market

Page 41: Gone in 360 Seconds: Hijacking with Hitag2tpc/isecsem/talks/EZ.pdf · Gone in 360 Seconds: Hijacking with Hitag2 Internet Security Seminar 2013 Presenter: Evgeny Zhavoronkov Lecturer:

Thanks for your time!