NFCulT. An easy a nice tool that will make you have fun, or... make profit!



Similar documents
OTP circumventing in MIFARE ULTRALIGHT: Who says free rides?

Electronic Access Control Security. Matteo Beccaro HackInTheBox Amsterdam, May 27 th, 2016

MIFARE CONTACTLESS CARD TECHNOLOLGY AN HID WHITE PAPER

Exercise 1: Set up the Environment

Secure recharge of disposable RFID tickets

RFID MODULE Mifare Reader / Writer SL031 User Manual Version 2.7 Nov 2012 StrongLink

NACCU Migrating to Contactless:

RFID MODULE Mifare Reader / Writer SL030 User Manual Version 2.6 Nov 2012 StrongLink

Security Evaluation of the disposable OV-chipkaart v1.6

RFID MODULE Mifare Reader / Writer SL032 User Manual Version 1.5 Nov 2012 StrongLink

AN mifare Ultralight Features and Hints. Document information. Multiple ticketing, secured data storage, implementation hints

RFID MODULE Mifare Reader / Writer SL025B User Manual Version 1.4 Nov 2012 StrongLink

The Impact of Emerging Payment Technologies on Retail and Hospitality Businesses. National Computer Corporation

MTP: Continuous User Authentication on Android Using Face Recognition

NTAG213/215/216. The mechanical and electrical specifications of NTAG21x are tailored to meet the requirements of inlay and tag manufacturers.

How to Install Applications (APK Files) on Your Android Phone

AN1305. MIFARE Classic as NFC Type MIFARE Classic Tag. Application note COMPANY PUBLIC. Rev October Document information

Hacking Mifare Classic Cards. Márcio Almeida

IP Card Reader Interface User Manual

Client Training Manual

Training MIFARE SDK. Public. MobileKnowledge June 2015

NFC TagWriter by NXP

Dirty use of USSD codes in cellular networks

Securing Host Operations with a Dedicated Cryptographic IC - CryptoCompanion

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

Business Mobile Banking Features

MF0ICU2. 1. General description. MIFARE Ultralight C. 1.1 Contactless energy and data transfer. 1.2 Anticollision. Rev May

AN1304. NFC Type MIFARE Classic Tag Operation. Application note PUBLIC. Rev October Document information

Two-Step Authentication FAQ

New Online Banking Guide for FIRST time Login

Attacking the Traveling Salesman Point-of-sale attacks on airline travelers DEFCON 2014

New Student Orientation Information Technology Packet

RIDICULOUSLY EASY GUIDE TO SOCIAL MEDIA TWITTER

Novell Filr. Mobile Client

UM0853 User manual. 1 Introduction. M24LRxx application software user guide

UM0109 USER MANUAL. Public Transport Ticketing Demo

OneNote 2013 Tutorial

How to configure Mac OS X Server

2015 MDRT Annual Meeting e Handout Material. What is Your Smartphone Leaking?

How to pull content from the PMP into Core Publisher

ACR122 NFC Contactless Smart Card Reader

GETTING TO KNOW YOUR TELSTRA PRE-PAID 3G WI-FI

How To Send Mail From A Macbook Access To A Pc Or Ipad With A Password Protected Address (Monroe Access) On A Pc (For Macbook) Or Ipa (For Ipa) On Pc Or Macbook (For

Moving BidMagic to a new system (Backup / Restore Utility)

Welcome Guide for MP-1 Token for Microsoft Windows

How To Set Up A Macintosh With A Cds And Cds On A Pc Or Macbook With A Domain Name On A Macbook (For A Pc) For A Domain Account (For An Ipad) For Free

Handout: Creating Forms in Word 2010

Binary Numbers. Binary Octal Hexadecimal

User s manual for Android Application

Training. MIFARE4Mobile. Public. MobileKnowledge April 2015

RFID READER 13.56MHz Reader / Writer SL500 User Manual Version 2.6 Nov 2011 StrongLink

Colorfly Tablet Upgrade Guide

SL2 ICS53/SL2 ICS General description I CODE SLI-S/I CODE SLI-S HC. 1.1 Anticollision. 1.2 Contactless energy and data transfer

Mobile Banking FAQ for Business

Country Club Bank- Mobile Banking FAQs

EASTPOINTE SECURE E MAIL SYSTEM SETUP INSTRUCTIONS

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

Introduction to UNIX and SFTP

Device Enrollment Guide

Why should I back up my certificate? How do I create a backup copy of my certificate?

Contents. Before You Install Server Installation Configuring Print Audit Secure... 10

CASQUE SNR Presentation 16 th April 2015

Spring Hill State Bank Mobile Banking FAQs

INTEGRATED CIRCUITS I CODE SLI. Smart Label IC SL2 ICS20. Functional Specification. Product Specification Revision 3.1 Public. Philips Semiconductors

How to Remotely Track Any Lost Smartphone, Tablet, or PC

Zimbra to Gmail Migration

Receiving Secure from Citi For External Customers and Business Partners

HOW TO CONFIGURE SQL SERVER REPORTING SERVICES IN ORDER TO DEPLOY REPORTING SERVICES REPORTS FOR DYNAMICS GP

Setting Up groov Mobile Apps. Introduction. Setting Up groov Mobile Apps. Using the ios Mobile App

GadgetTrak Mobile Security Android & BlackBerry Installation & Operation Manual

ANDROID GUEST GUIDE. Remote Support & Management PC Tablet - Smartphone. 1. An Introduction. Host module on your PC or device

INSTRUCTION. The smallest GPS watch locator in the country

Event2CRM Quick Start User Guide

Single Sign-on Frequently Asked Questions

SQL EXPRESS INSTALLATION...

Generate Android App

Multi Factor Authentication API

USB Card Reader Configuration Utility. User Manual. Draft!

Creating an e mail list in YahooGroups

Ciphermail Gateway PDF Encryption Setup Guide

1. Introduction Activation of Mobile Device Management How Endpoint Protector MDM Works... 5

Google Drive: Access and organize your files

Using NetCrunch for compliance and security audits

Implementation Guide for protecting

Password Depot for Android

Guide to Installing BBL Crystal MIND on Windows 7

iii. You will not be able to access their iocbc account without a valid OTP token from 1 Nov 2012 onward.

Country Club Bank- Intro to Mobile Banking- Android & iphone Apps

Store & Share Quick Start

1. Scope of Service. 1.1 About Boxcryptor Classic

IT Information Packet

How to install and use the File Sharing Outlook Plugin

Outlook Data File navigate to the PST file that you want to open, select it and choose OK. The file will now appear as a folder in Outlook.

Karsten Nohl University of Virginia. Henryk Plötz HU Berlin

Kaspersky Lab Mobile Device Management Deployment Guide

Transcription:

NFCulT An easy a nice tool that will make you have fun, or... make profit

Matteo Beccaro ( aka bughardy ) Student at Politecnico di Torino Computer Engineering Security Engineer and researcher at Secure Network S.r.l. Contacts: bughardy@cryptolab.net @_bughardy_ https://bughardy.me Speaker at: DefCon 21 - «OPT it won t save you from free rides» 30C3 - «How to builda safe NFC ticketing system» BlackHat US 14 s Arsenal DefCon 22 SkyTalks And now here at BlackHat EU 14 s Arsenal Who I am

What we are dealing with MIFARE ULTRALIGHT tags as tickets Designed to work @13.56 MHz Manufactured by NXP semiconductors Worldwide largest installed platform More than 50 million MIFARE reader core components More than 5 billion ICs Image source: Google images

Use of NFC on transportation systems Ticketing systems that work at very high speeds to reduce queues at tube and train stations Usually, absolutely not safe Why? Image source: Google images

Memory Layout 512 bits of memory (64 bytes) arranged in 16 pages of 4 bytes Different memory areas: UID and Internal The s OTP Area Data Area Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

UID and Internal s 7 bytes for Serial Number SN0 to SN6 1 byte for Internal 2 Check bytes as a result of XOR operations CB0 and CB1 All of them are programmed by the manufacturer: read only Page Address # DEC HEX 0 1 2 3 0 0x00 SN0 SN1 SN2 CB0 1 0x01 SN3 SN4 SN5 SN6 2 0x02 CB1 Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

UID and Internal s How CB0 and CB1 are evaluated? CB0 = 0x88 SN0 SN1 SN2 CB1 = SN3 SN4 SN5 SN6 Page Address # DEC HEX 0 1 2 3 0 0x00 SN0 SN1 SN2 CB0 1 0x01 SN3 SN4 SN5 SN6 2 0x02 CB1 Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

s 2 bytes msb lsb msb lsb L - 7 L - 6 L - 5 L - 4 L - OTP BL-10 to 15 BL 4 to 9 Possibility of making a whole page (4 bytes) read-only Possibility of making the s themselves read-only BL - OTP L - 15 L - 14 L - 13 L - 12 L-11 L - 10 L - 9 L - 8 Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

s They cannot be edited as you want What you are about to write is simply bitwise ORed with the present data OR 0 1 0 0 1 1 1 1 One bit in state 1 cannot be turned into 0 anymore Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

OTP s The only security function in MIFARE ULTRALIGHT tags 4 bytes, 0x00 by default As the s, what you are about to write is ORed with the present data One-Time Programmable Not One-Time Password Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

Data Sector Largest sector 48 bytes, arranged in 12 pages Read / Write mode For transportation system applications this sector will store Time of last stamp Validator Machine ID Bus line or underground stop Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

Pros & Cons Pros Cheap Possibility of creating limited tickets Expiration after a finite number of times Good for public transportation systems Cons No hardware encryption Usually not well implemented on public transportation systems: Reset Attack [2012] Attack [2013] Time Attack [2013] Replay Attack [2014] How easily is to exploit the related vulnerabilities? Here comes NFCulT

Attack 1 - Attack msb lsb msb lsb L - 7 L - 6 L - 5 L - 4 L - OTP BL-10 to 15 BL 4 to 9 Attack Mostly overcome Extremely easy task to perform Step 1: set the correct lock bit Step 2: have fun BL - OTP L - 15 L - 14 L - 13 L - 12 L-11 L - 10 L - 9 L - 8 Page Address # DEC HEX 0 1 2 3 0 0x00 UID 1 0x01 UID 2 0x02 UID Internal 3 0x03 OTP From 4 to 15 0x04 to 0x0F Data

Acting on the lock bits We can make a sector of the ticket readonly Just turn a bit from 0 into 1 (L-OTP) attack with our app just press a button The stamping machine tries to validate the ticket No feedback for the (failed) write operation The number of rides is freezed Attack 1 - Attack

Attack 1 - Attack Check if last time stamp is older than n minutes: No the ticket is still valid Type of multiple ride ticket: 5 rides ticket Yes let s stamp the ticket Check if there are rides left: No the ticket is useless Yes let s stamp it» Write Timestamp OK» Write other stuff OK» Write the new number of rides left KO Ticket is valid. 5 Rides left No feedback WIN Do not forget to take one ride off Easily fixable Just check the state of L-OTP bit and decide whether to validate the ticket or not

Attack 2 - Time Attack Time Attack Attacker is required to understand the format of the timestamp The location where the timestamp is stored must be identified as well The timestamp is not encrypted Four (4) simple steps to own the ticket system Set the right page Set the starting timestamp s date Set your desired timestamp s time Have fun with your band new ticket OTP WRITE FREE

Attack 2 - Time Attack 1 1. Set the date of the timestamp 2. Choose the right data page 4 3. Setting the desired time of timestamp 4. Write data to the ticket 2 3

Replay Attack Assumptions No online database of tickets are available Attacker needs a valid source ticket The attacker owns a clone MIFARE Ultralight tag Three (3) simple steps Dump the ticket Edit key information Write to the blank UL tag Attack 3 Reply Attack

We love Chinese stuff Perfect clone of UL ticket No read-only pages Just clone your real ticket Add a ride to the cloned ticket Stamp your brand new cloned ticket Clone it back on the real ticket Or directly use the clone Pay attention to the number of rides Have fun Attack 3 Reply Attack

Attack 3 Reply Attack Considerations Encrypted ticket Encryption can be circumnavigated by cloning the whole encrypted data It works if the whole data area is encrypted It works if the timestamp is encrypted It works because The stamping machine is validating a cloned ticket, but with a ride more The clone tag has the same number or rides left, but an updated timestamp

What if you could simply edit your tag as you prefer?

Custom Edit Just write whatever you want wherever you prefer: Fix UID bytes ( if you broke them ) Write arbitrary data to pages Be careful If you are not using a clone UL, you could lock forever some pages

Now you can edit your saved dump: For privacy and security reasons dumps are stored in private directory of the app located in /data/data/ org.bughardy.nfcult/files/ Without root permission an external app can not access to those files Now you can edit them within the NFCulT app Why it is useful? This is a must-have features for reply attack, since very often you need to add a ride to your dump You can reply the edited dump directly to your ticket or save it as a new one Dump Edit

Base Conversion Now from the Dump Edit tab you can convert values in different bases for a more in-deep understanding of data on the ticket. It supports: Hex > Bin Hex > Dec Bin > Hex Bin > Dec Dec > Hex Dec > Bin

Future ready Now NFCulT supports also ART That means it is ready to use also on Android 5.0 smartphones In the next release I ll probably work on a tablet version

Where to find Source code and dev build are on github: https://github.com/securenetwork/nfcult APK and official signed builds are available on Play Store: https://play.google.com/store/apps/details? id=org.bughardy.nfcult