shopshifting warning about potential payment system abuse

29
Shopshifting Warning about potential payment system abuse Fabian Bräunlein <[email protected]> Philipp Maier <[email protected]> Karsten Nohl <[email protected]>

Upload: andrey-apuhtin

Post on 13-Feb-2017

354 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Shopshifting Warning about potential payment system abuse

SRLabsTemplatev12

ShopshiftingWarningaboutpotentialpaymentsystemabuse

FabianBräunlein<[email protected]>PhilippMaier<[email protected]>

KarstenNohl<[email protected]>

Page 2: Shopshifting Warning about potential payment system abuse

Card-basedpaymentreliesontwoprotocols

Cashierstation

Paymentprocessor

LAN Internet

ZVTorOPIprotocol ISO8583/Poseidonprotocol

Authorizationrequest

ConfirmationConfirmation

Sendencryptedpaymentdetails

§ ReadmagstripeorstartEMVtransaction

§ AskforPIN

Paymentterminal

2

Thistalkinvestigatesthesecurityoftheprotocolsusedtomakecashlesspaymenthappen

Page 3: Shopshifting Warning about potential payment system abuse

Agenda

§ Localpaymentabuse

§ Poseidonshopshifting

§ Evolutionneed

3

Page 4: Shopshifting Warning about potential payment system abuse

ZVTallowsunauthenticatedaccesstomagstripedata

ZVTprotocol§ Configuresandcontrolspaymentterminals

§ Designed forserial,nowTCP-based,unencrypted

§ OriginallydesignedbyG+Din1990s

§ Nowactivelyusedby~80%ofpaymentterminalsinGermany

Cashierstation Attacker Payment

terminal

ARPspoofing tobecomeMITM

Authorization_ReqReadcard

Magstripeandchipdetails

Authorization_Reqincludingmagstripe

Confirmation

4

Page 5: Shopshifting Warning about potential payment system abuse

AccesstoPINrequirescryptographicMAC

HowPINentryusuallyworks

ZVT:AuthorizewithPIN

Paymentterminal

Poseidon:Encryptedtransactionw/PIN

Requestnumber

PIN

MainCPU Display&PINpadHSM

DoPINtransaction

EncryptedPIN

UnencryptedPIN

ZVT:Textdisplaywithnumericalinput,MAC

PINPoseidon:TransactionwithnoPIN(“Lastschrift”)

AuthorizewithoutPIN

Attackershould notbeabletocreatevalidMACsinceMACkeyisprotectedwithinHSM

Isit?

Displaytext,MAC

5

RequestPIN

PIN

AttackerswouldneedMACtostealPINfromZVT

Page 6: Shopshifting Warning about potential payment system abuse

MainCPUsendsMAC

HSMleaksMACthroughtimingsidechannel

HSMCPUcomparesMAC

Response ResponsetimeFail

Fail

Fail

Fail

Fail

Fail

Ok

26.000

26.000

26.000

26.005

26.005

26.010

26.040

MAC00…

01…

02…

03…

0301…

0302…

0302AF…05

MainCPUiseasilyhackable:ActiveJTAG,RCE,…

HSMprotectssecretsandshouldbemuchbettersecured

§ MACcomparisonisdonebyte-by-byte

§ ResponsetimeleakscompleteMACwithinminutes

§ MACisnotterminal-specific:Worksacrossmanydifferentterminals

6

Page 7: Shopshifting Warning about potential payment system abuse

MagstripeandPINtheftviaZVToverLAN

Demo1

7

Page 8: Shopshifting Warning about potential payment system abuse

ZVTalsoallowslocalterminalhijacking

Paymentterminal Attacker Payment

processor

Attackpreparation

ARPspoofingtobecomeMITM

ZVT:SetterminalID

ZVT:Extendeddiagnose

Poseidon:Extendeddiagnose

Limits,merchantbanner,…Swapbanner

StayMITM,changeport

Ifterminalwasalreadyconfiguredtotherightport:

TransactionsaredoneundernewterminalID,moneygoestoattackerTransactionhijacking

Requiresstaticpassword,whichisthesameforallterminalsofaprocessor

Otherwise:

8

Page 9: Shopshifting Warning about potential payment system abuse

RedirectmerchanttransactionstoattackeraccountviaZVT

Demo2

Smallcomplication:Attackersneedtheirownmerchantaccounts

9

Page 10: Shopshifting Warning about potential payment system abuse

Agenda

§ Localpaymentabuse

§ Poseidonshopshifting

§ Evolutionneed

10

Page 11: Shopshifting Warning about potential payment system abuse

Poseidon’sauthenticationmodelissimplywrong

Poseidonprotocol§ DialectofglobalpaymentstandardISO8583

§ De-factostandardinGermany

§ Strongmonoculture:Onlyonebackendimplementation,usedbyallprocessors

§ ApparentlyalsousedinFrance,Lux,andIceland

Paymentterminal

Paymentprocessor

11

TerminalID

Terminalconfiguration,encryptedwithterminalkey

Poseidoninitialization:

Poseidonauthenticationusespre-sharedkeys,similartoVPNs.However, thekeyisthesameformanyterminals!Thiscannotbesecure.

Page 12: Shopshifting Warning about potential payment system abuse

FewparametersareneededforPoseidoninitialization

Orbrute-forceoverZVT,orreadthroughJTAG,…

TASK Technology GmbH

RETAIL AUTOMATION SYSTEMS

Kurt Kastner

Seite 1 / 2

TASK Technology GmbH, Nobelstraße 9 - 13, 76275 Ettlingen, Germany

Inbetriebnahme Artema hybrid TeleCash TA 7.0

Version 0,8 (vorläufig) – 3. Dezember 2009

Vertraulich – nur für internen Gebrauch

Versionen

Für den Betrieb an der Tankstelle ist zumindest die Version 55.03 der Terminalsoftware nötig.

TaskSTAR POS benötigt mindestens V3.05.00 SP2 Hotfix TA 7.0.

Kennwörter

Kassierer: 000000

Servicetechniker: 210888

IP-Adressierung

Sofern durch den DSL-Anschluss oder das vorhandene Hausnetz nichts anderes erzwungen wird, werden feste IP-Adressen mit Subnetzmaske 255.255.255.000 verwendet. Die Terminals bekommen dann folgende Adressen:

Terminal 1: 192.168.001.101,

Terminal 2: 192.168.001.102,

Terminal 3: 192.168.001.103,

usw.

DHCP: in der Regel NEIN.

Die IP-Adressen für DSL-Zugang TeleCash-Zahlungshost lauten 217.073.032.104 und 217.073.032.105. Die Portnummer ergibt sich bei Hypercom-Geräten aus folgender Formel:

51500 + PU-Nummer.

Beispielsweise lautet die Port-Nummer der PU 16 : 51516. Bitte beide Hosts eintragen, damit beim Ausfall eines der Hosts der andere erreicht werden kann.

Einen DSL-Zugang zum Testhost (PU 99) gibt es Stand 3.11.2009 nicht.

Das Terminal fragt bei der Inbetriebnahme, ob ein IP-Längenbyte verwendet werden soll. Im Normalfall ist das nicht sinnvoll. Sollte die Initialisierung nicht klappen, bitte auch mal mit Längenbyte versuchen.

Die IP-Adressen des TeleCash-Wartungshosts sind Stand 19.11.2009 nicht bekannt. Im Gerät verbleiben die werksseitig eingestellten Werte. TeleCash wird diese im Laufe 2010 per TKM-Update automatisiert überschreiben.

1.Google

12

Page 13: Shopshifting Warning about potential payment system abuse

FewparametersareneededforPoseidoninitialization

2.Goshopping

OrsimplyguessTIDs:Theyareassignedincrementally.

13

Page 14: Shopshifting Warning about potential payment system abuse

FewparametersareneededforPoseidoninitialization

3.BruteforceTCPport

14

Page 15: Shopshifting Warning about potential payment system abuse

ShopshiftingovertheInternet:Issuingarefundtransaction

Demo3

15

Page 16: Shopshifting Warning about potential payment system abuse

Shopshiftingattackputsmerchantsatsignificantfraudrisk

Worstcasescenario

1. AttackerguessesterminalIDs.(Theyareassignedincrementally)

2. Shopshifts terminals,anonymously overtheinternet

3. Receivesinbound banktransactions(ortop-upvouchers)fromuptohundreds ofthousandsofmerchants

4. (PerhapsextendsattacktootherISO8583dialectstoscaleglobally)

Shop-shifting

Merchantterminal

Poseidonbackendatpaymentprocessor

MerchantBank

Registers

Alsoregisterswithspoofed terminalID

CreatesSIMcardtop-upvouchersIssuesrefunds toarbitrarybankaccountsAttacker

terminal

16

Page 17: Shopshifting Warning about potential payment system abuse

Customersandmerchantsarevulnerabletovariouspaymentabusescenarios

AttackvictimCustomer Merchant

FromLAN

§ MagstripeandPINtheftthrough ZVT

§ MerchanttransactionredirectthroughZVTMITM

§ (VariantofZVTabusewithoutMITMagainsthundreds ofInternet-exposedterminals)

§ Shopshifting overPoseidon

Overtheinternet

Commonvulnerabilitycause:Missingauthenticationorauthenticationwithsymmetricsystem-widekeys(inHSM)

17

Page 18: Shopshifting Warning about potential payment system abuse

Agenda

§ Localpaymentabuse

§ Poseidonshopshifting

§ Evolutionneed

18

Page 19: Shopshifting Warning about potential payment system abuse

19

HSMHackingChallenge–Secretsarestoredinabattery-backedRAMunderaplasticcover.

Whenametalmeshinthisplasticcoverisbreached,thesecretsareerased.

Toolofchoice–TheHackingNeedle

Page 20: Shopshifting Warning about potential payment system abuse

Needlefitsunderneathmesh,overwritesmeshcheck

20

Page 21: Shopshifting Warning about potential payment system abuse

Withsecuritycheckdeactivated,RAMinsideHSMcanberead

21

Page 22: Shopshifting Warning about potential payment system abuse

Flash content is read with Arduino

22

Page 23: Shopshifting Warning about potential payment system abuse

ActiveJTAGinHSMallowsfordebugging

23

Page 24: Shopshifting Warning about potential payment system abuse

HSMcompromiseaffectskeysforZVT,Poseidon,EMVandothers

24

ZVTMACcomputationinsideHSM:

Page 25: Shopshifting Warning about potential payment system abuse

Agenda

§ Localpaymentabuse

§ Poseidonshopshifting

§ Evolutionneed

25

Page 26: Shopshifting Warning about potential payment system abuse

ZVTandPoseidonarenotsecurebydesign

26

Vulnerabilityrootcauses

ZVT Poseidon

Usedwithsymmetriccrypto

System-widesignaturekeys

System-wideauth keys

Also,butnotmakingmattersworse:

StoredininsecureHSMs

StoredininsecureHSMs

Bothprotocolsmix“securitythroughobscurity”(system-widekeys)with“securitycertification”(HSMs).Neitherimplements“securitybydesign”

Page 27: Shopshifting Warning about potential payment system abuse

Heuristicdefensesareneededintheshortterm

27

Deactivateunnecessaryfunctions

ZVT

§ Remotemanageabilitywithstaticpassword– Shouldrequireaconfirmationonterminalinstead

§ MagstripetransactionfromEMV- capablecard(mustbecheckedonlinesincecarddatacannotbetrusted)

Poseidon

§ Refund(activatedbydefault!)§ SIMcardtop-up(deactivatedbydefault)

§ TerminalIDsconnecting towrongport(alreadyimplemented insomeplaces)

§ SerialnumberchangesforaterminalID(noteffectivewhenHSMishacked)

§ Refundsthatdonotcorrespond totransactionincashregister(double-entry accounting)

Detectsuspiciousbehavior

Paymentsystemneedbetterprotocolsandmoresecurehardware!Whilethesearebeingdeveloped,afewstop-gapmeasuresareavailable:

Page 28: Shopshifting Warning about potential payment system abuse

Otherpaymentstandardsappearequallyvulnerable

28

§ OpenPaymentInitiativeprotocol ismoremodern thanZVT:XML-based,2003

§ Stilllacksauthenticationandencryption

§ Missessomeofthefunctionality thatcanbeabused inZVT(good!)

§ Vendorsuseproprietaryextensionstobringbacksuchvulnerablefunctionality inOPI(bad!), includingremotemaintenance

MainZVTalternative:OPI

§ Poseidon isoneofmanyISO8583dialects

§ System-widesymmetrickeys,Poseidon’sAchillesheel,arenotmandatory inISO8583

§ Itdoesnotappearthatcurrentterminalsgothrough keyexchangesaspartoftheirinitialization, suggesting thatother ISO8583dialectsalsosufferfromPoseidon’s securityissues

§ Internationalsecurityresearchcommunity:Yourhelpisneeded

Poseidon’sfamily:ISO8583

Page 29: Shopshifting Warning about potential payment system abuse

Takeaways

Questions?

FabianBräunlein<[email protected]>PhilippMaier<[email protected]>KarstenNohl<[email protected]>

§ Paymentsystemsallowformagstripe/PINtheftandremoteattacksonmerchants

§ Victimsofcardabuseshouldfighttheirbanks,researchersshouldhelp

§ Paymentprotocolsneedactualauthenticationusingindividualkeys

29