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 (a or b)
  • to ignore those errors, use uppercase (A or B)

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 that W and R options **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 keyfile KEYS even 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 πŸ’–βœ¨πŸŽ€πŸ¦‹