Important!

Blog moved to https://blog.apdu.fr/

I moved my blog from https://ludovicrousseau.blogspot.com/ to https://blog.apdu.fr/ . Why? I wanted to move away from Blogger (owne...

Showing posts with label EMV. Show all posts
Showing posts with label EMV. Show all posts

Wednesday, May 1, 2013

cardpeek now available as a Debian package


The nice cardpeek software I presented in "cardpeek: A tool to read the contents of smartcards" is now available as the cardpeek Debian package. You do not need to install lua and rebuild the application yourself anymore.

cardpeek is a graphical application to read EMV, SIM and other types of smart cards.

Friday, October 26, 2012

cardpeek: A tool to read the contents of smartcards

A few days ago I discovered a nice tool: cardpeek.






Project

The project is hosted at http://code.google.com/p/cardpeek/.
It is Free Software and uses the GNU GPL v3 licence.

From the project web site:
Cardpeek is a Linux/Windows tool to read the contents of ISO7816 smartcards. It features a GTK GUI to represent card data is a tree view, and is extendable with a scripting language (LUA).

The goal of this project is to allow smartcard owners to be better informed about what type of personal information is stored in these devices.

The tool currently reads the contents of :
  • EMV cards, including NFC ones.
  • Navigo public transport cards (partially supports MOBIB as well)
  • The French health card "Vitale 2"
  • Electronic/Biometric passports in BAC security mode.

It can also read the following cards with limited interpretation of data:
  • Some Mifare cards (such as the Thalys card);
  • Moneo, the French electronic purse;
  • GSM SIM cards.

More info on the Wiki here: http://code.google.com/p/cardpeek/wiki/Main

Installation

It is easy to install under Debian GNU/Linux. You may need to install some dependencies related to the lua language. The program is written in C and lua. The parts sending smart card commands are lua scripts. I do not yet have lua in my list of languages for PC/SC.

You may be unable to run the ./configure script. I already reported this problem. run autoreconf -vis to get correct symlinks.

Examples

EMV

I tried with an EMV card.

The application gives a lot of information. For example you have access to the card transaction records.
In this example I payed 48.11€ on the August 30th of 2012. This transaction was to fil the tank with gasoline but the card do not store information about the merchant.

Navigo Pass

I do not have a Navigo Pass myself so I reused the screen copy from the cardpeek project navigo page.

From the project:
The "calypso" script included in cardpeek can read the content of Navigo cards used in Paris. It provides enhanced "event log" analysis notably with subway/train station names, as illustrated in the screenshot above. It has been successfully tested on Navigo Découverte, Navigo and Navigo Intégrale cards.

SIM

The support is SIM card is indicated as beta but does work quiet well.

For example you can dump the phone book stored in your SIM card.

I guess it is in beta mode because not all the fields are parsed and displayed in a human readable format.

Conclusion

Cardpeek is a very nice tool to explore many common kinds of smart cards. It is tech savvy oriented.

Wednesday, June 20, 2012

More EMV tools

I discovered 2 other tools for interacting with EMV smart cards

javaemvreader

It is an application written in Java. The project is hosted at http://code.google.com/p/javaemvreader/ and using the Apache License 2.0 licence.

I have not yet tried to use the software. According to the web site the application is able to perform:
EMV function nameCommand
Initialize card SELECT FILE "1PAY.SYS.DDF01"
READ RECORD (to read all records in the specified SFI)
Application Selection SELECT
Initiate Application Processing GET PROCESSING OPTIONS
Read Application Data READ RECORD (all records listed in the AFL)
(Read other application data) GET DATA (ATC, Last online ATC, PIN Try Counter, Log Format)
Dynamic Data Authentication INTERNAL AUTHENTICATE
Offline verification VERIFY (only plaintext PIN verification is supported)
Read Transaction Log GET DATA/READ RECORD
N/A READ RECORD (brute force all valid SFI values and record numbers)

The application uses the javax.smartcardio API to talk to PC/SC.


emvlab.org

It is not an application but different web services to parse EMV data.

EMV tag search Look up EMV tags in this handy database. Search by keyword e.g. for all tags that contain the word "currency" or "cryptogram" in the description, or look up a hex tag e.g "9F20".
TLV decoder Decode EMV TLV (Tag, Length Value) byte strings into their constituent tags and sub-tags. Useful for analysing APDU traces, responses and so on.
CAP calculator Generate CAP codes using an emulated banking card and CAP calculator, to test against real gadgets or for testing authentication servers.
Cryptogram calculator Generate and verify EMV ARQC, ARPC and TC cryptograms, calculated using the vital parameters of the card, UDKs, ATC etc.
DES calculator Encrypt and decrypt hex strings using DES and 3DES, using the basic modes of operation, ECB, CBC.
ASN1 decoder Decode a binary file into an ASN1 dump using an online interface to Peter Gutmann's dumpasn1 tool
PIN translation tools Encrypt, decrypt and translate ISO PINblocks between different encryption keys. PINs, PANs, padding... all sorts of fun!
Keyshare generation tools Automatically generate test keys of various lengths, and split into components. KCVs are automatically provided for each component and the whole key.
Truecolour hex dump tool This hex dump tool will create a multicoloured, annotated hex dump of the provided file, making it easy to spot strings, markers, and high and low entropy areas of the file. Very useful for when you don't have your favourite hex dump tool to hand.
Character set encoding conversionConvert strings of text and hex between ASCII, ECBDIC and hex representations. Suprising how often you need one of these!
ePassport MRZ calculator Generate passport Machine Readable Zones (MRZs) from biographical details including name, date of birth, and passport numbers, expiry dates etc. Randomly created identities can also be used.
Contact us Let us know what you think of the site, and if you have any problem reports or suggestions.

I have not yet tried this service.

Thursday, December 1, 2011

EMV-CAP article now available online

In a previous article "EMV-CAP in MISC Magazine n°56" I presented a paper published in the French magazine MISC. The paper is now available online.

Thanks to Philippe Teuwen, co-author of the article, for the info.

Sunday, August 14, 2011

EMV-CAP in MISC Magazine n°56

I just read an article about EMV-CAP protocol in the latest number of MISC Magazine (n°56 July-August 2011).

Misc 56 cover


The article is "Banque en ligne : à la découverte d'EMV-CAP" from Jean-Pierre Szikora and Philippe Teuwen. The 13 pages long article (and the complete magazine) is in French. Sorry if you can't read French.

Some page samples:
Article first page
Article 4th page
Article 5th page


The article is also linked to a web site from the authors with more information:

  • an Python application to get a lot of information from a EMV-CAP card
  • a trace generated by the above application using a real card
  • a JavaCard applet to simulate an EMV-CAP applet

If you have a bank card and want to play with it you should have a look at their application.

You should be able to buy this MISC Magazine n°56 in France and other countries until the end of this month. Or buy it online from the editor web site.

You can also (re-)read a previous blog article titles "PSSI: SIM card phone book listing (part 2)" also about an EMV card dump application.

Happy hacking!


Flattr this

Thursday, November 11, 2010

PSSI: SIM card phone book listing (part 2)

Just a week after my post about a missing SIM card explorer in free software I discover in a the French MISC magazine article "Python Simple Smartcard Interpreter" that such a project exists.


PSSI: Python Simple Smartcard Interpreter


The project is hosted at http://code.google.com/p/pssi/ and uses GNU GPLv3 licence.
" Python script that provides an abstract layer for smartcard reading. Thanks to it, it is possible to read a smartcard by simply adding its structure in the form of a plugin, without taking care of the communication layer. The tool comes with several plugins, namely SIM, EMV, and NAVIGO. "
The project is quiet new. The project was created 30 July 2010 on code.google.com and the first commit occured on 19 Sept 2010. No stable/numbered release is available.

Plugins


The software is not just for SIM cards but is generic and uses plugins.

SIM

This plugin displays a lot of information about the SIM:
  • Telecom provider
  • Phone book
  • SMS

EMV

This plugin also displays a lot of information about the bank card:

Applications on the card



 ATR                         : 3B 65 00 00 66 04 6C 90 00
 Content                    
    Applications List          
       ====   1   ====
          ====   1   ====
             Application information    
                EMV Application information
                   Application ID              : a0 00 00 00 42 10 10 
                   Application name            : CB
                   Application priority        : 1
          ====   2   ====
             Application information    
                EMV Application information
                   Application ID              : a0 00 00 00 03 10 10 
                   Application name            : VISA
                   Application priority        : 2

Card holder name


Application information    
   Track 2 data                : 49 78 38 00 XX XX XX XX YY YY YY YY 
   Cardholder                  : MR ROUSSEAU LUDOVIC       
   Track 1 discretionary data  : 329627000000000673000000

Card validity dates and card number


Application information    
   Validity beginning          : 01 / 09 / 08
   Validity end                : 30 / 09 / 10
   Card number                 : 49 78 38 00 XX XX XX XX 
   PAN sequence number         : 4

The card number has been obscured by me. Even if the card expired a few months ago I think it is safer like this :-)

Transactions


====   1   ====
====   2   ====
   Amount          : 126.63          ()
   CID             : 64              (Cryptogram Information Data)
   Country         : FRANCE          (Country where the terminal is located)
   Currency        : Euro            ()
   Date            : 18 / 09 / 10    ()
   Type            : Payment         ()
====   3   ====
   Amount          : 36.80           ()
   CID             : 64              (Cryptogram Information Data)
   Country         : FRANCE          (Country where the terminal is located)
   Currency        : Euro            ()
   Date            : 31 / 08 / 10    ()
   Type            : Payment         ()
====   4   ====
   Amount          : 202.60          ()
   CID             : 64              (Cryptogram Information Data)
   Country         : FRANCE          (Country where the terminal is located)
   Currency        : Euro            ()
   Date            : 25 / 08 / 10    ()
   Type            : Payment         ()


NAVIGO

Navigo is the smart card used by the RATP in Paris public transport system. I do not have such a card so could not use this plugin.

ccid-utils

Another project to dump an EMV card is ccid-utils but this project did not work with my French bank card so I thought my card was not EMV compliant. But I was wrong since PSSI works great with this card.

Another problem with ccid-utils is that even if the program uses Python the core of the project uses C and directly talks to a CCID reader instead of using the PC/SC API through Pyscard. ccid-utils is also very limited regarding the CCID readers it supports.

Conclusion

PSSI is much more than a SIM card explorer. It also works for EMV and Navigo cards. The display of information is nice. The code is Python only so I had no problem using it on Mac OS X. I think I will continue playing with the software and maybe implement other features.


Flattr this