36
DefCon 27, Las Vegas 2019 Breaking the back end!

Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

DefCon 27, Las Vegas 2019

Breaking the back end!

Page 2: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Gregory Pickett, CISSP, GCIA, GPENChicago, Illinois

[email protected]

Hellfire Security

Page 3: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Overview

Transit SystemReverse EngineeringMy DiscoveriesThe ExploitThe Lessons

Page 4: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

How This Is Different

This is not illegalWe aren’t sneaking into the stationWe aren’t hacking their terminalsWe aren’t social engineering anyone or attacking their wired/wireless network

This is not about the hardwareWe aren’t cracking anyone’s encryptionWe aren’t cloning the magstripe, RFID, or NFC

Page 5: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

How This Is Different

This Is AboutFlaws in the Application LogicOK. Cloning is involved but it is not the vulnerability exploitedUsing AppSec to attack Complex Multi-Layered Real World Solutions

Page 6: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Elevated Train

Bangkok Mass Transit System (BTS)Elevated rapid transit system in Bangkok, ThailandServes Greater Bangkok AreaOperated by Bangkok Mass Transit System PCL (BTSC)43 stations along two lines

Page 7: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Tickets

Stored-Value Card (NFC)All Day Pass (Magstripe) and Single Journey (Magstripe)

Page 8: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Two magstripesHole through one magstripeOnly 0.27mm thick

Tickets

Page 9: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Tickets

Page 10: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Tickets

Page 11: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

The Equipment

Standard Reader/WriterManufactured in ChinaStandards or Raw ReadErrors RareReliable Performance

Page 12: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Lab Work

Attempted Decode Using StandardsInternational Organization for Standardization6-bit Character sets and 4-bit Character setsSome With Parity and Some Without

Attempted Decode both forwards and backwardsIt wasn’t using the standards

Page 13: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Lab Work

There is no encryption.There are no parity checksThere was no longitudinal redundancy check (LRC)There are no timestamps

Page 14: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Field Work

* The section “7826”” is the Ticket Type* The section “00FF74” is always 100 + the price of the ticket* For all day passes, the section “00FF74” is used to track trips taken

Page 15: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Field WorkGUID

GUID

GUID

StationDispenser

StationTurn-style

Page 16: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Field Work

Page 17: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Handling Rules

To Enter,Ticket must have previously been in “Collected” StateTicket Must Be Now Be In “Issued” State

To Exit, Ticket Must Be In “Used” State

Page 18: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Exploiting This System

What We Have Learned So FarSystem SafeguardsTheir AssumptionsAttacks Against Their AssumptionsEpic Fail!

Page 19: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

What We Have Learned So Far

Object BasedPhysical ObjectDatabase Object

PropertiesIdentificationTypeValueLocation

Page 20: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

What We Have Learned So Far

StatesIssuedUsedCollected

History

Page 21: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

System Safeguards

Ticket Composition and Ticket DesignMirror Physical Object and Database ObjectHandling Rules Define Valid Use of The ObjectsLifecycle limited to Twenty-Four HoursCollection of Ticket After Use

Page 22: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Their Assumptions

No One Will Be Able to Reproduce Our TicketOur System Has The Only Valid ObjectsHandling Rules Will Prevent Concurrent UseDamage is limited by LifecycleAfter Use, Ticket Will Be In Our Possession

Page 23: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Attacks Against Assumptions

Acquire Suitable TicketCapture Valid ObjectBypass RulesExtend the Attack to Increase the Damage

Page 24: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Epic Fail!

Found Someone to Make Blank TicketsCopied Shit Ton of Objects in “Issued” StateFound Flaw In the Handling Rules

“Collected” State found in Current Lifecycle Overrides all other states!Object Always Seen Recently “Collected”Run The Original TicketAll Copies Immediately Become Valid

Page 25: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Epic Fail!

X X X

Page 26: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Epic Fail!

√√ √

Page 27: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Epic Fail!

Page 28: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Epic Fail! (Demonstration)

Page 29: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Turning The Exploit Into An Attack

TicketsPlan

Page 30: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Tickets

Page 31: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

The Plan

Buy Ticket (Daily Pass)Copy TicketUse OriginalHand Out CopiesHave Fun!Repeat Tomorrow!

Page 32: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Results of The Attack

Extend the attack!

Page 33: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Test All Layers of a SolutionTest for Application IssuesCheck Your AssumptionsUse Compensating and Mitigating Controls

Avoiding Their Fate

Page 34: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Linkshttps://wikileaks.org/wiki/Anatomy_of_a_Subway_Hack_2008https://file.wikileaks.org/file/anatomy-of-a-subway-hack.pdfhttps://defcon.org/images/defcon-16/dc16-presentations/anderson-ryan-chiesa/47-zack-reply-to-mbta-oppo.pdfhttps://www.computerworld.com/article/2597509/def-con--how-to-hack-all-the-transport-networks-of-a-country.htmlhttps://www.cio.com/article/2391654/android-nfc-hack-enables-travelers-to-ride-us-subways-for-free--researchers-say.htmlhttps://www.youtube.com/watch?v=-uvvVMHnC3chttps://www.blackhat.com/docs/asia-17/materials/asia-17-Kim-Breaking-Korea-Transit-Card-With-Side-Channel-Attack-Unauthorized-Recharging-wp.pdf

Page 35: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”

Links

https://www.msrdevice.comhttps://www.msrdevice.com/product/misiri-msr705x-hico-magnetic-card-reader-writer-encoder-msr607-msr608-msr705-msr706https://www.alibaba.com/https://nexqo.en.alibaba.comhttp://www.nexqo.com/https://www.bts.co.th/http://www.btsgroup.co.th

Page 36: Breaking the back end! - DEF CON CON 27/DEF CON 27 presentations/DEFCON-27-Gregory-Pickett...Epic Fail! Found Someone to Make Blank Tickets Copied Shit Ton of Objects in “Issued”