ESP32 Bit Pirate home
  • RFID
  • Advanced
  • 5 min
  • Serial CLI

Recipe · Advanced · RFID

How to clone a MIFARE UID to a magic card

Use the RFID clone flow with a PN532 to copy a source UID to a compatible magic MIFARE Classic lab card.

RFID reader communicating with a contactless tag.
A practical ESP32 Bit Pirate recipe based on documented firmware commands.
Step 1

Commands

Run this sequence from the CLI. Adjust pins, addresses or filenames to match your own setup.

Result

What it means

The clone flow demonstrates the difference between normal tag reading and special writable UID test cards.

Troubleshooting

  • Re-enter the selected mode setup if pins changed.
  • Confirm the target shares ground with the ESP32 Bit Pirate.
  • Start with short commands before using longer capture or bridge sessions.

Next steps

  • Read the target card after cloning to confirm the UID.
  • Use write for page or block data tests.
  • Use erase only on disposable lab tags.

MIFARE UID clone FAQ

Why does UID clone require a magic card?

Normal MIFARE Classic cards do not allow UID changes. The clone flow targets special lab “magic” cards with rewritable block 0 behavior.

Is this a full card clone?

No. This recipe is about copying the UID to a compatible test card. It does not automatically clone sectors, keys, access bits or protected application data.

What should I save before changing a magic card?

Save the source UID, the target card type and any test notes before writing. That gives you a clean way to verify the clone result and restore your lab documentation later.

Go deeper