mobile nfc 101 - owasp · pdf filemobile nfc 101. company overview company – lateral...

26
Presenter: Nick von Dadelszen Date: 31st August 2012 Company: Lateral Security (IT) Services Limited Mobile NFC 101

Upload: phungcong

Post on 31-Jan-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Presenter: Nick von DadelszenDate: 31st August 2012Company: Lateral Security (IT) Services Limited

Mobile NFC 101

Page 2: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Company OverviewCompany

– Lateral Security (IT) Services Limited– Founded in April 2008 by Nick von Dadelszen and Ratu Mason (both directors)– Staff - AKL - 6 people, WGTN - 7 people, Hong Kong - 1 person

Services– Security testing (design & architecture, penetration testing, configuration, code reviews,

security devices & controls, mobile apps) – Security advisory (Lifecycle compliance & audit – ISO, PCI-DSS, NZISM, policy process

development, threat modelling and risk assessment) – Regular ongoing technical testing and assurance programs

Differentiators– True vendor independence– Security testing and advisory are our niche specialties– Highly experienced and skilled staff

Page 3: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Objectives

This talk has the following goals:

Provide you with an understanding of the technology behind NFC on mobile phones

How it integrates with the hardware and application layers

Discuss the security considerations for NFC on Mobi le and how it differs from standard NFC implementations

Page 4: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

How NFC Fits

Page 5: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

NFC Protocols

Page 6: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

NFC On Mobiles

Samsung Nexus S first Android phone to get NFC chip

Android, Blackberry, Nokia phones with NFC availabl eSamsung Galaxy SIIISeveral Snapper phones

iPhone cases with NFC

Rumoured for the iPhone 5

Huge increase in distribution from last year

Page 7: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Mobile Architecture

Page 8: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

NFC Types In Mobiles

Reader/Writer mode

Phone can read passive tagsDefault on Android with NFCAndroid APIs available for easy useMany apps in the marketMy own RFIDiot app is an example of this

Page 9: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Reader/Writer Sample Code

if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)) {

Parcelable nfcTag = intent.getParcelableExtra("android.nfc.extra.TAG");Tag t = (Tag)nfcTag;IsoDep myTag = IsoDep.get(t);

if( !myTag.isConnected() ){myTag.connect();

byte[] hexAPDU = HexToList(APDU);byte[] response = myTag.transceive(hexAPDU);String hexResponse = ListToHex(response);

Page 10: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

NFC Types In Mobiles

Peer-to-Peer Mode

Allows two devices to talk directly to each otherAndroid Beam is an example of thisCan send URLs, Contacts, Apps etc between phonesCan be used to pair bluetooth devices

In both reader/writer and Peer-to-peer mode, Androi d OS has direct access to NFC reader hardware

Page 11: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

NFC Types In Mobiles

Card Emulation

Allows a phone to act as a tagMultiple examples available now

Google WalletSnapper Touch2PayBNZ/Vodafone NFC trial

This is where things aren’t quite so straightforwar d

Page 12: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Card Emulation Difficulties

In order to emulate a card you need a secure elemen t (SE) to hold the applet

SE can be multiple places:

EmbeddedOn a SIMOn an SD

Phone hardware must allow communication between NFC controller and SE

For SIM cards this is SWP

Page 13: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Card Emulation Difficulties

To develop using Card Emulation you must have acces s to the SE to install the applet

Google holds the keys to the embedded SE on Nexus p honesMobile Carriers hold the keys to the SIM SEAlmost no phones support SD-SE

• Extremely difficult for the average developer to pe rform card emulation

Page 14: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

SWP Card Emulation

Multiple phones now support SWP

Samsung Galaxy SIIIAny phone supporting Snapper Touch2PayPretty much any other NFC phone except Google brand ed phones

SWP enables applet on SIM to access NFC controller

SWP does not allow the mobile OS to access the appl et

SWP provides access over wireless interface only

Page 15: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

To Access Applet From OS

To access applet from OS app, two options:

Use Mobile OTA network to access SIM from carrier a nd remote call to mobile app

Enable access to SIM from OS

Access to SIM is through baseband processor, not ap plication processorBB must provide AT commands to enable transparent A PDU exchangeOnly Touch2Pay phones have these modifications

Page 16: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Security Considerations

Mobile NFC as a delivery platform

Mobile RFIDiotMITMMalicious apps

Mobile NFC as a target

Mobile payment appsNFC stackAndroid Beam

Page 17: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Mobile RFIDiot

I presented my Mobile RFIDiot code at Kiwicon last y ear

Allows you to use a phone as an RFIDiot reader

Includes ability to read cards such as credit cards and passports

Can be used to perform MITM

New version (A “Nick Special”) to be released at Ki wicon this year

Page 18: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

MITM Theory

Page 19: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Malicious Apps

A malicious NFC app could be installed on numerous phones

The app could read any nearby NFC tag and send the data to the attacker

Now your phone could be sniffing your credit cards without you knowing

Page 20: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Attacking Payment Apps

Apps in phones are the same apps as in cards:

Credit cardsSnapper

However, now it is connected permanently to a compu ter with internet access

Mobile malware etc can now attack payment apps with out being in the vicinity

Page 21: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Attacking The NFC Stack

Charlie Miller presented excellent research at Blac khat 2012

He fuzzed the NFC stack on a Nexus S using an ACR12 2U

Results:

Multiple crashesFound a vulnerability that enabled him to gain full control of the phone

Page 22: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Charlie Miller’s Fuzzing Setup

Page 23: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Android Beam

Android Beam can be used to pass info between devic es, or from a tag to a device

ContactsURLsApps

There is no confirmation on the receiving side

Automatically runs the associated app

Combined with a browser bug this could be pretty da ngerous

Page 24: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Bluetooth Pairing

Nokia phones can use NFC to automatically pair blue tooth devices

No requirement to enter a PIN

No other confirmation by default

Once paired, can use tools such as obexfs to gain ac cess to the device

Page 25: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Roundup

Mobile NFC use is increasing significantly

As with any new tech, there is a security learning curve

If you are developing NFC apps, make sure you under stand the threat model

If you are attacking NFC apps, go have fun (with th e usual disclaimers)

Page 26: Mobile NFC 101 - OWASP · PDF fileMobile NFC 101. Company Overview Company – Lateral Security ... NFC Types In Mobiles Reader/Writer mode Phone can read passive tags Default on Android

Lateral Security (IT) Services Limited

Wellington

38-42 Waring Taylor Street (level 7, Petherick Tower)PO Box 8093, Wellington 6143, New ZealandPhone: +64 4 4999 756Email: [email protected]@lateralsecurity.com

Auckland

187 Queen Street (level 8, Landmark House)PO Box 7706, Auckland, New ZealandPhone: +64 9 3770 700Email: Email: [email protected]@lateralsecurity.com

Contact Details