This project provides a Python script for dumping MIFARE Classic 1K and 4K NFC cards using a PN532 reader over UART.
It authenticates each sector using Key A (and optionally Key B, if added later) and produces a full .mfd/.dump-style binary file compatible with common NFC tools.
- Reads all blocks of a MIFARE Classic 1K or 4K card
- Supports per-sector Key A loaded from a text file
- Automatically determines card layout (1K or 4K) based on the highest sector index
- Falls back to default key
FFFFFFFFFFFFif no key is provided - Produces a raw dump (
card_dump.mfd) compatible with MFOC/MFCUK-style tools - Works with PN532 in HCU mode, using a USB to TTL.
- This repo comes with 3 python files.
Dump_MifareClassic1K.py: The main script to dump the card (For MC1K).Dump_MifareClassic4K.py: The main script to dump the card (For MC4K).NFC-Dump_Analyze.py: A helper script to analyze the dumped.mfdfile.
To use the scripts, run the following command in your terminal:
python Dump_MifareClassic1K.pyTo analyze your dumped file, run:
python ./NFC-Dump_Analyze.py ./card_dump.mfd- Python 3.7+
- PN532 board configured for HCU
adafruit-circuitpython-pn532pyserial
Install dependencies:
pip install adafruit-circuitpython-pn532 pyserialTo read your dumps, you can check zhovner's MFDRead tool: https://github.com/zhovner/mfdread