nfc-mfclassic(1)
π nfc-mfclassic(1) π
okay bestie, welcome to the NFC Utilities corner of the group chat, because today we're talking about nfc-mfclassic and honestly? she's iconic. it's giving command line tool for MIFARE Classic, and yes you're gonna read the whole thing, no skimming, I see you π
β¨ NAME β¨
nfc-mfclassic β a MIFARE Classic command line tool, periodt π
πΈ SYNOPSIS πΈ
nfc-mfclassic f|r|R|w|W a|A|b|B u|U<uid> DUMP [ KEYS [f] ]
like, that's the whole vibe. five little letters and a dump file. slay.
π¦ DESCRIPTION π¦
so nfc-mfclassic is a MIFARE Classic tool that lets you read or write a DUMP file using the MIFARE keys you hand it in the KEYS file. that's the whole point, that's the mission, that's the main character energy π
MIFARE Classic tag? one of the most widely used RFID tags out there. literally everywhere. the moment.
the firmware in the NFC controller supports authenticating, reading and writing to/from MIFARE Classic tags, and this tool is basically a little showcase β it demonstrates the speed of this library and how easy it is to use. and ngl the speed is unreal: you can read and write the complete content of a MIFARE Classic 4KB tag within 1 second. one. second. ππ₯ it stores everything in a binary MIFARE Dump file (MFD), which holds the keys and the data for all sectors.
β οΈ be cautious bestie!! some parts of a MIFARE Classic memory are used for r/w access of the rest of the memory. so please, PLEASE read the tag documentation before you start experimenting too much. I am begging π
the f option formats the card, and that resets all keys to FFFFFFFFFFFF, all data to 00, and all ACLs to default. full reset, fresh face, new era π
the W option lets you write special MIFARE cards that can be 'unlocked' so block 0 becomes overwritable. that includes the UID and the manufacturer data, so yeah, we're in the deep end. take care when amending UIDs to set the correct BCC (UID checksum) β do not skip the checksum, I'm serious π«Ά. currently only 4 byte UIDs are supported.
similarly, the R option is the 'unlocked' read. it bypasses authentication and lets you read the Key A and Key B data regardless of ACLs. she simply walks in πͺβ¨
R/W errors on some blocks can be either considered critical or ignored, and you get to pick:
- to halt on the first error, specify keys with lowercase (
aorb) - to ignore those errors, use uppercase (
AorB)
when you've got multiple tags in front of a reader, the U option is your bestie β it supplies the UID of the 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 u parameter instead will just use whatever libnfc decides, which generally is the lowest UID. letting libnfc choose for you, very demure, very mindful πΈ
* note thatWandRoptions **only work on special versions of MIFARE 1K cards (Chinese clones). yes, only those. no cap.
π OPTIONS π
f|r|R|w|Wβ perform format (f) or read from (r) or unlocked read from (R) or write to (w) or unlocked write to (W) card. pick your fighter πa|A|b|Bβ use A or B MIFARE keys. halt on errors (a|b) or tolerate errors (A|B). lowercase = stop the second something goes wrong, uppercase = we move on, we forgive, we forget π§u|Uβ use the default UID (u) or supply a valid 4 byte UID (U<uid>). team "let libnfc decide" or team "I have a specific tag in mind", both valid πDUMPβ MiFare Dump (MFD) used to write (card to MFD) or (MFD to card). she's the file, she goes both ways πKEYSβ MiFare Dump (MFD) that contains the keys (optional). the data part of the dump is ignored, only the keys matter here, we're not nosy πfβ force using the keyfileKEYSeven if UID does not match (optional). it's giving "I said what I said" π€
π BUGS π
found a bug? please report any bugs on the libnfc issue tracker at: https://github.com/nfc-tools/libnfc/issues
do it for me. do it for the community. do it for the plot π«Ά
π LICENCE π
libnfc is licensed under the GNU Lesser General Public License (LGPL), version 3. libnfc-utils and libnfc-examples are covered by the the BSD 2-Clause license.
(yes, the "the the" is in the original and I'm keeping it, it's iconic, no notes π)
β AUTHORS β
- Adam Laurie
<adam@algroup.co.uk> - Roel Verdult
<roel@libnfc.org> - Romain Tartière
<romain@libnfc.org> - Romuald Conty
<romuald@libnfc.org>
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).
legends, all of them. ate and left no crumbs π₯
and that's the page bestie!! brought to you by libnfc, dated Nov 02, 2009, living forever in the nfc-mfclassic(1) manual. go read a tag, stay safe, set your BCC, and hydrate πβ¨ππ¦
π¦ where this page comes from
- alpine 3.24: libnfc-doc 1.8.0-r2 Β· LGPL-3.0-or-later
- arch rolling: libnfc 1.8.0-4 Β· LGPL-3.0-or-later
- debian bookworm: libnfc-bin 1.8.0-2 Β· LGPL-3.0-only
- debian trixie: libnfc-bin 1.8.0-3.1+b1 Β· LGPL-3.0-only
- fedora 43: libnfc-examples 1.8.0-12.fc43 Β· LGPL-3.0-or-later
- fedora 44: libnfc-examples 1.8.0-13.fc44 Β· LGPL-3.0-or-later
- nixos 26.05: libnfc 1.8.0
- nixpkgs unstable: libnfc 1.8.0
- ubuntu jammy: libnfc-bin 1.8.0-2 Β· LGPL-3.0-only
- ubuntu noble: libnfc-bin 1.8.0-3.1build1 Β· LGPL-3.0-only
- ubuntu questing: libnfc-bin 1.8.0-3.1build1
- ubuntu resolute: libnfc-bin 1.8.0-3.1build2 Β· LGPL-3.0-only
- ubuntu stonking: libnfc-bin 1.8.0-3.1build2 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms