An Android NFC-App for reading, writing, analyzing, etc. MIFARE Classic RFID-Tags.
Maybe you want to update the post because your assumptions about Mifare Classic vs. Mifare Ultralight are wrong. Even the tag with the 7 byte UID is a Mifare Classic tag. There are Mifare Classic tags with 4 or 7 byte UIDs!
- Screenshots(outdated, check Google Play)
- Additional stuff (Documentation, etc.)
- Donate with Paypal
Features
- Read MIFARE Classic tags
- Save, edit and share the tag data you read
- Write to MIFARE Classic tags (block-wise)
- Clone MIFARE Classic tags
(Write dump of a tag to another tag; write 'dump-wise') - Key management based on dictionary-attack
(Write the keys you know in a file (dictionary).
MCT will try to authenticate with these
keys against all sectors and read as much as possible.
See chapter Getting Started.) - Format a tag back to the factory/delivery state
- Write the manufacturer block of special MIFARE Classic tags
- Use external NFC readers like ACR 122U
(See the Help & Info sectionfor more information.) - Create, edit, save and share key files (dictionaries)
- Decode & Encode MIFARE Classic Value Blocks
- Decode & Encode MIFARE Classic Access Conditions
- Compare dumps (Diff Tool)
- Display generic tag information
- Display the tag data as highlighted hex
- Display the tag data as 7-Bit US-ASCII
- Display the MIFARE Classic Access Conditions as a table
- Display MIFARE Classic Value Blocks as integer
- In-App (offline) help and information
- It's free software (open source). ;)
General Information
This tool provides several features to interact with (and only with)MIFARE Classic RFID-Tags. It is designed for users who have at leastbasic familiarity with the MIFARE Classic technology.You also need an understanding of the hexadecimal number system,because all data input and output is in hexadecimal.
Some important things are:
- The features this tool provides are very basic. There are no suchfancy things like saving a URL to an RFID-Tag with a nice lookinggraphical user interface. If you want so save things on a tag,you have to input the raw hexadecimal data.
- This App can not crack/hackany MIFARE Classic keys. If you want to read/write an RFID-Tag, youfirst need keys for this specific tag. For additional informationplease read/see chapter Getting Started.
- There will be no 'brute-force' attackcapability in this application. It is way too slow dueto the protocol.
- The first block of the first sector of an originalMIFARE Classic tag is read-only i.e. not writable. But thereare special MIFARE Classic tags that support writing to themanufacturer block with a simple write command. This App is able towrite to such tags and can therefore create fully correct clones.However, some special tags require a special command sequence toput them into the state where writing to the manufacturer block ispossible. These tags will not work.
Remember this when you are shopping for special tags!
Also, make sure the the BCC value is correct before writing. The BCCis the first byte after the UID. It is calculated by XOR-ing allbytes of the UID. - This app will not work on some devices because their hardware(NFC-controller) does not support MIFARE Classic(read more).You can find a list of incompatible deviceshere.
For further information about MIFARE Classic checkWikipedia,do some Google searchesor read theMIFARE Classic (1k) 'Datasheet'(PDF) from NXP.
Getting Started
First of all, you need the keys for the tag you want to read.Due to some weaknesses in MIFARE Classic, you can retrieveall the keys (A and B) of a tag with tools like theProxmark3 ornormal RFID-Readers and some special software(mfcuk,mfoc).
The application comes with standard key files calledstd.keys and extended-std.keys, which contains thewell known keys and some standard keys from a short Google search.You can try to read a tag with this key file using'Read Tag' from main menu.
Once you know some keys, you can put them into a simple textfile (one key per line). You can do this on your PC and transferthe file to the MifareClassicTool/key-files/directory (on external storage), or you can create a new key file via'Edit or Add Key File' from main menu.If you are finished setting up your key file, you can read a tagusing 'Read Tag' from main menu.
Advantages of the Key Files Concept:
- You don't have to worry about which key is for which sector.
The application tries to authenticate with all keys from the key - You don't have to know all the keys.
If neither key A nor key B for a specific sector is found in thekey file (dictionary), the application will skip reading saidsector.
This dictionary-attack based mapping process(keys <-> sectors) makes it easy for you to read as much aspossible with the keys you know!
License
This application was originally developed byGerhard Klostermeier in cooperation with SySS GmbH(www.syss.de) and AalenUniversity (www.htw-aalen.de) in 2012/2013.It is free software and licensed under theGNU General Public License v3.0 (GPLv3)
Icons used in this application:
- Logo: Beneke Traub
(Creative Commons 4.0) - Oxygen Icons: www.oxygen-icons.org
(GNU Lesser General Public License) - RFID Tag: www.nfc-tag.de
(Creative Commons 3.0)
MIFAREĀ® is a registered trademark of NXP Semiconductors.
I want to write data to a mifare classic 1K tags. does anyone have a working sample code to do that?I can't find enough information on that on the web.Thanks!
2 Answers
There is example code availble at http://nearfieldcommunication.com/developers/android/
If you have an intent of a NFC discovering, you can use this snippet:
At this example I'm writting at Sector 1 Block 0. Be sure your trying to write in an 'valid' sector with the appropiate key.