libnfc/utils/nfc-mfclassic.1
2017-10-01 15:29:01 +02:00

161 lines
4.0 KiB
Groff

.TH nfc-mfclassic 1 "Nov 02, 2009" "libnfc" "NFC Utilities"
.SH NAME
nfc-mfclassic \- MIFARE Classic command line tool
.SH SYNOPSIS
.B nfc-mfclassic
.RI \fR\fBf\fR|\fR\fBr\fR|\fR\fBR\fR|\fBw\fR\fR|\fBW\fR
.RI \fR\fBa\fR|\fR\fBA\fR|\fBb\fR\fR|\fBB\fR
.RI \fR\fBu\fR\fR|\fBU\fR<\fBuid\fR>\fR
.IR DUMP
.RI [
.IR KEYS
.RI [\fR\fBf\fR]
.RI ]
.SH DESCRIPTION
.B nfc-mfclassic
is a MIFARE Classic tool that allow to read or write
.IR DUMP
file using MIFARE keys provided in
.IR KEYS
file.
MIFARE Classic tag is one of the most widely used RFID tags.
The firmware in the NFC controller supports authenticating, reading and writing
to/from MIFARE Classic tags. This tool demonstrates the speed of this library
and its ease-of-use. It's possible to read and write the complete content of a
MIFARE Classic 4KB tag within 1 second. It uses a binary MIFARE Dump file (MFD)
to store the keys and data for all sectors.
Be cautious that some parts of a MIFARE Classic memory are used for r/w access
of the rest of the memory, so please read the tag documentation before experimenting too much!
The
.B f
option to format the card will reset all keys to FFFFFFFFFFFF, all data to 00 and all ACLs to default.
The
.B W
option performs a write operation on special MIFARE Classic cards, that can
be 'unlocked' to allow block 0 to be modified ('generation 1 Chinese magic
cards'). Similarly, the
.B R
option allows an 'unlocked' read. This bypasses authentication and allows
reading of the Key A and Key B data regardless of ACLs.
The
.B C
option performs a write operation on special MIFARE Classic cards, that allow
block 0 to be modified by the regular write command ('generation 2 Chinese
magic cards'/'CUID direct-write cards'). This type of card does not reply to
the backdoor/unlock command of generation 1 cards and is therefore harder to
detect.
*** Note that
.B W
,
.B R
and
.B C
options only work on Chinese magic cards (clones of MIFARE Classic cards, that
have a modifiable block 0). Rewriting block 0 allows for modification of
manufacturer data such as the UID. Writing bad manufacturer data into block 0
(e.g. bad BCC) may permanantly brick a Chinese magic card. Currently, only
4-byte UIDs are supported.
R/W errors on some blocks can be either considered as critical or ignored.
To halt on first error, specify keys with lowercase (
.B a
or
.B b
). To ignore such errors, use uppercase (
.B A
or
.B B
).
When using multiple tags infront of a reader, the
.B U
option can be used to supply the UID of tag to be read or written. Append the
hexadecimal UID to the U option. For example U01ab23cd for the 4 byte UID
0x01 0xab 0x23 0xcd. Using the
.B u
parameter instead will use whatever libnfc decides which generally is the lowest
UID.
.SH OPTIONS
.TP
.BR f " | " r " | " R " | " w " | " W " | " C
Perform format (
.B f
) or read from (
.B r
) or unlocked/gen1 read from (
.B R
) or write to (
.B w
) or unlocked/gen1 write to (
.B W
) or direct/CUID/gen2 write to (
C
) card.
.TP
.BR a " | " A " | " b " | " B
Use A or B MIFARE keys.
Halt on errors (
.B a
|
.B b
) or tolerate errors (
.B A
|
.B
B
).
.TP
.BR u " | " U
Use the default UID (
.B u
) or supply a valid 4 byte UID (
.B U<uid>
).
.TP
.IR DUMP
MiFare Dump (MFD) used to write (card to MFD) or (MFD to card)
.TP
.IR KEYS
MiFare Dump (MFD) that contains the keys (optional). Data part of the dump is ignored.
.TP
.B f
Force using the keyfile
.IR KEYS
even if UID does not match (optional).
.SH BUGS
Please report any bugs on the
.B libnfc
issue tracker at:
.br
.BR https://github.com/nfc-tools/libnfc/issues
.SH LICENCE
.B libnfc
is licensed under the GNU Lesser General Public License (LGPL), version 3.
.br
.B libnfc-utils
and
.B libnfc-examples
are covered by the the BSD 2-Clause license.
.SH AUTHORS
Adam Laurie <adam@algroup.co.uk>,
.br
Roel Verdult <roel@libnfc.org>,
.br
Romain Tartière <romain@libnfc.org>,
.br
Romuald Conty <romuald@libnfc.org>.
.PP
This manual page was written by Romuald Conty <romuald@libnfc.org>.
It is licensed under the terms of the GNU GPL (version 2 or later).