MifareClassicTool Documentation

An Android NFC app for reading, writing, analyzing, etc. MIFARE Classic RFID tags.

RAW Doc

File: README.md

MIFARE Classic Tool (MCT)

An Android NFC app for reading, writing, analyzing, etc. MIFARE Classic RFID tags.



Read this information in other languages:

Helpful links:

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 (block 0) of special MIFARE Classic tags
  • Use external NFC readers like ACR 122U
    (See the Help & Info section
    for 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
  • Calculate the BCC (Block Check Character)
  • Quick UID clone feature
  • Import/export/convert files
  • 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 least
basic 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 such
    fancy things as saving a URL to an RFID-Tag with a nice looking
    graphical user interface. If you want to save things on a tag,
    you have to input the raw hexadecimal data.
  • This App can not crack/hack
    any MIFARE Classic keys. If you want to read/write an RFID-Tag, you
    first need keys for this specific tag. For additional information
    please read/see chapter Getting Started.
  • There will be no "brute-force" attack
    capability in this application. It is way too slow due
    to the protocol.
  • Be aware! Uninstalling this app will delete all files
    (dumps/keys) saved by it permanently.
  • The first block of the first sector of an original
    MIFARE Classic tag is read-only i.e. not writable. But there
    are special MIFARE Classic tags that support writing to the
    manufacturer block with a simple write command (often called "magic tag
    gen2" or "CUID"). This App is able to write to such tags and can therefore
    create fully correct clones. "FUID" and "UFUID" tags should work too,
    but they have not been tested so far. However, the app will not work with
    all special tags. Some of them require a special command sequence (which
    cannot be sent due to limitations in the Android NFC API) to
    put them into the state where writing to the manufacturer block is possible.
    These tags are often called "gen1", "gen1a" or "UID".
    Remember this when you are shopping for special tags!
    More information about magic cards can be found
    here.
    Also, make sure the BCC value (check out the "BCC Calculator Tool"),
    the SAK and the ATQA values are correct. If you just want to clone a UID,
    please use the "Clone UID Tool".
  • 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 devices
    here
    .

For further information about MIFARE Classic check
Wikipedia,
do some Google searches
or read the
MIFARE 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 retrieve
all the keys (A and B) of a tag with tools like the
Proxmark3 or
normal RFID-Readers and some special software
(mfcuk,
mfoc).

The application comes with standard key files called
std.keys, extended-std.keys and hotel-std.keys, which contain the
well known keys and some standard keys from a short Google search.
You can try to read a tag with these key files using
"Read Tag" from the main menu. Changes to these key files
will be lost. Create your own key file for your keys.

Once you know some keys, you can put them into a simple text
file (one key per line). You can do this on your PC and import
the file using MCT's import/export tool, or you can create a new
key file via "Edit or Add Key File" from the main menu.
If you are finished setting up your key file, you can read a tag
using "Read Tag" from the 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
    file (dictionary).
  • You don't have to know all the keys.
    If neither key A nor key B for a specific sector is found in the
    key file (dictionary), the application will skip reading said
    sector.

This dictionary-attack based mapping process
(keys <-> sectors) makes it easy for you to read as much as
possible with the keys you know!

License

This application was originally developed by
Gerhard Klostermeier in cooperation with SySS GmbH and Aalen
University (www.htw-aalen.de) in 2012/2013.
It is free software and licensed under the
GNU General Public License v3.0 (GPLv3)

Icons used in this application:

MIFARE® is a registered trademark of NXP Semiconductors.


File: README.zh-CN.md

MIFARE Classic Tool (MCT)

一个用于对MIFARE Classic RFID标签进行读取、写入、分析等操作的Android NFC应用程序。



以其他语言阅读本文:

链接:

特性

  • 读取MIFARE Classic标签
  • 保存,编辑和分享您读取的标签数据
  • 写入MIFARE Classic标签(逐块)
  • 克隆MIFARE Classic标签
    (将标签的转储写入另一个标签;逐文件写入)
  • 基于字典攻击的密钥管理
    (将已知密钥写入字典文件)
    MCT将尝试对所有扇区使用这些密钥进行身份验证,并尽可能多地读取。请参阅章节入门。
  • 将标签格式化为出厂/交付状态
  • 对特殊类型的MIFARE Classic标签写入制造商块(块0)
  • 使用外部NFC读取器,例如ACR 122U
    (请参阅帮助与信息获得更多信息)
  • 创建,编辑,保存并分享密钥文件(字典)
  • 解码和编码MIFARE Classic值块
  • 解码和编码MIFARE Classic访问控制条件
  • 比较转储(通过比较工具)
  • 显示标签的一般信息
  • 以高亮的十六进制形式查看标签数据
  • 以7-Bit US-ASCII形式查看标签数据
  • 以表格形式查看MIFARE Classic访问控制条件
  • 以整数形式查看标签数据
  • 计算BCC(Block Check Character/信息组校验码)
  • 快速UID克隆功能
  • 导入/导出/转换文件
  • 内建离线的帮助与信息
  • 它是一个免费软件(开源哦) ;)

一般信息

本工具提供了一些操作MIFARE Classic RFID标签的功能。本工具针对至少基本熟悉MIFARE Classic技术的用户。您还需要了解十六进制数系统,因为所有的数据输入和输出都是十六进制的。

一些重要信息:

  • 此工具提供的功能非常底层。
    没有什么能够比通过漂亮的图形界面将URL保存到RFID标签更有趣了。但如果您想在标签上保存什么,您必须输入原始的十六进制数据。
  • 此应用程序无法破解/破解任何MIFARE经典密钥。
    如果您想读/写RFID标签,您首先需要这个特定标签的密钥。欲了解更多信息,请参阅章节入门。
  • 此应用程序不会提供暴力攻击功能。因为协议太慢了。
  • 注意!卸载此应用程序将会永久删除其保存的所有文件(转储/密钥)。
  • 原始MIFARE Classic标签中的第一个块是只读的,即无法向其写入任何数据。
    但是有一些特殊的MIFARE Classic标签支持通过简单的写命令写入制造商块(即块0),该应用程序能够写入此类标签,因此可以创建完全正确的克隆。(通常称为“ 2代魔术标签”,即中文购物网站上通常可以见到的CUID卡;某些CUID卡无法使用,详见MIFARE Classic DirectWrite,但在中文购物网站上似乎不必担心遇到这类特殊的卡片;FUID/UFUID理论上也可使用,但未经测试,欢迎在issue中反馈使用效果。)
    然而,某些特殊标签需要特殊命令序列以使其可以写入制造商块(“ 1代魔术标签”,即中文购物网站上通常可以见到的UID卡)。由于Android NFC API的限制,本应用无法发送相应的特殊命令序列,故无法写入这类标签的制造商块。请购买时注意区分!
    另外,请确保BCC值(请使用“ BCC计算器”)、SAK和ATQA值正确。如果您只想克隆一个UID,请使用“克隆UID工具”。
  • 本应用程序在某些硬件(NFC控制器)不支持MIFARE Classic的设备上无法使用 (了解更多)。
    您可以在这里找到已知不兼容设备列表

有关MIFARE Classic的更多信息,请参阅维基百科,百度搜索或者阅读NXP的MIFARE Classic (1k) '数据表'(PDF)。

入门

首先,您需要待读取标签的密钥。由于MIFARE Classic中的某些缺陷,您可以使用Proxmark3、普通的RFID读卡器以及一些特殊工具 (mfcuk、mfoc)找回全部密钥(包括密钥A与密钥B)。

该应用程序自带名为std.keys和extended-std.keys的标准密钥文件,其中包含常见的的密钥和通过Google搜索得到的一些标准密钥。您可以通过应用程序主界面的“读标签”尝试用其读取标签数据。

如有已知密钥,可以将其放入一个简单的文本文件中(每行一个密钥)。您可以在PC上进行此操作,然后使用MCT的“导入/导出工具”导入文件,也可以通过“编辑/新建密钥文件”创建新的密钥文件。如果完成了密钥文件的设置,则可以通过应用程序主界面的“读标签”来读取标签。

密钥文件的优点:

  • 您不必担心哪个密钥属于哪个扇区
    应用程序尝试使用文件中的所有密钥进行身份验证
  • 您不必知道所有密钥
    如果在密钥文件(字典)中找不到用于特定扇区的密钥A和密钥B,则应用程序将跳过读取该扇区的操作。
    这种基于字典攻击的映射过程(密钥<->扇区) 使您可以轻松读取尽可能多的已知密钥!

许可

此应用程序最初由Gerhard Klostermeier与SySS GmbH及亚伦大学(www.htw-aalen.de)在2012/2013年合作开发。它是免费软件,并通过GNU通用公共许可证版本3(GPLv3)授权。

应用中的图标:

MIFARE®是NXP Semiconductors的注册商标。