From 927faff46b0fb92b2ba71fea787ec25615f51219 Mon Sep 17 00:00:00 2001 From: exiom Date: Fri, 20 Jun 2025 12:01:20 +0800 Subject: [PATCH] Documentation Revamp Added Documentation for - Writing Updated Documentation for - Reading - Compatible RFID Blanks Cleaned up and reorganized the rest of the documentations. --- OpenSourceRfid.md | 3 - README.md | 101 +++------------- BambuLabRfid.md => docs/BambuLabRfid.md | 0 CrealityRfid.md => docs/CrealityRfid.md | 0 OpenTag.md => docs/OpenTag.md | 0 docs/ReadTags.md | 106 ++++++++++++++++ TagSniffing.md => docs/TagSniffing.md | 0 docs/WriteTags.md | 154 ++++++++++++++++++++++++ 8 files changed, 274 insertions(+), 90 deletions(-) delete mode 100644 OpenSourceRfid.md rename BambuLabRfid.md => docs/BambuLabRfid.md (100%) rename CrealityRfid.md => docs/CrealityRfid.md (100%) rename OpenTag.md => docs/OpenTag.md (100%) create mode 100644 docs/ReadTags.md rename TagSniffing.md => docs/TagSniffing.md (100%) create mode 100644 docs/WriteTags.md diff --git a/OpenSourceRfid.md b/OpenSourceRfid.md deleted file mode 100644 index 4d0a4b2..0000000 --- a/OpenSourceRfid.md +++ /dev/null @@ -1,3 +0,0 @@ -File Moved - -See [OpenTag.md](./OpenTag.md) diff --git a/README.md b/README.md index d1cdcbd..398bea2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Bambu Lab RFID Tag Guide +This repository contains the collective research of the Bambu Lab Filament RFID Tags and serves as a guide to give you a basic overview how you can decrypt and read your tags. -This guide gives you a basic overview how you can decrypt and read your tags. - -[View Collection of Tags](https://github.com/queengooborg/Bambu-Lab-RFID-Library) +Please visit the [Bambu Lab RFID Library Repository](https://github.com/queengooborg/Bambu-Lab-RFID-Library) to view our collection of tags. [![Link to Discord](https://img.shields.io/badge/Discord-join_now-blue?style=flat-square&logo=discord&logoColor=white&label=Discord&color=blue)](https://discord.gg/zVfCVubwr7) @@ -16,13 +15,10 @@ This guide gives you a basic overview how you can decrypt and read your tags. * [Requirements](#requirements) * [Proxmark3 compatible readers](#proxmark3-compatible-readers) * [Proxmark3 Easy](#proxmark3-easy) - * [Hacking a Bambu Lab Tag and readout of its data](#hacking-a-bambu-lab-tag-and-readout-of-its-data) - * [Deriving the keys](#deriving-the-keys) - * [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) - * [Sniffing the tag data with a Proxmark3 (legacy method)](#sniffing-the-tag-data-with-a-proxmark3-legacy-method) - * [Tag Documentation](#tag-documentation) + * [Bambu Lab Tag documentation as well as other brands and Open 3D-RFID](#tag-documentation) * [How do RFID tags work?](#how-do-rfid-tags-work) - * [Compatible RFID tags - By generation](#compatible-rfid-tags---by-generation) + * [Hacking a Bambu Lab Tag and readout of its data](#hacking-a-bambu-lab-tag-and-readout-of-its-data) + * [RFID tag cloning and compatible RFID tags](#rfid-tag-cloning) * [Reverse engineering RFID Board](#reverse-engineering-rfid-board) @@ -44,7 +40,8 @@ This is a research group dedicated to documenting the data structures used by Ba ### How to contribute -If you have a Proxmark3 (or other RFID debugging tool), you can decrypt the contents of your Bambu Lab RFID tags and submit them via [Discord](https://discord.gg/zVfCVubwr7). +If you have a Proxmark3 (or other RFID debugging tool), you can decrypt the contents of your Bambu Lab RFID tags and submit them via [Discord](https://discord.gg/zVfCVubwr7), or alternatively submit a Pull Request to the [Bambu Lab RFID Library Repository](https://github.com/queengooborg/Bambu-Lab-RFID-Library). + A lot of the contents have been deciphered, but the more data we have, the easier it is to compare differences to learn what each byte represents and double-check our answers. ### Todos/Timeline/Next steps @@ -73,73 +70,13 @@ A lot of the contents have been deciphered, but the more data we have, the easie A Proxmark3 Easy is sufficient for all the tasks that need to be done. You can buy a clone from Alixepress, Amazon or Dangerous Things. -## Hacking a Bambu Lab Tag and readout of its data - -We document here the most simple approach to get all required A-Keys and the data of the tag. The easiest way is to derive the keys using the Python script in this repository. - -### Deriving the keys - -A way to derive the keys from the UID of an RFID tag was discovered, which unlocked the ability to scan and scrape RFID tag data without sniffing, as well as with other devices like the Flipper Zero. A script is included in the repository to derive the keys from the UID of a tag. - -First, obtain the tag's UID: - -- Proxmark3 - 1. Run the Proxmark3 software by running `pm3` in the terminal - 2. Place the Proxmark3 device on the RFID tag of the spool - 3. Run `hf mf info` and look for the UID line item -- Flipper Zero - 1. Open the NFC app and scan the tag - 2. The Flipper will attempt to decrypt the tag, but you can skip the "Nested Dictionary (Backdoor)" step for speed - 3. The UID of the tag will appear on-screen -- Bambu Lab AMS - 1. Load the spool into an AMS slot and wait for it to finish loading - 2. View the spool's details on the printer's touchscreen, Bambu Studio or Bambu Handy - 3. The UID is the first eight characters of the spool's serial number - -Next, run the key derivation script and pipe its output to a file by running `python3 deriveKeys.py [UID] > ./keys.dic`. - -Then, use the keys file to extract the data from the RFID tag: - -- Proxmark3 - 1. Run the Proxmark3 software by running `pm3` in the terminal - 2. Place the Proxmark3 device on the RFID tag of the spool - 3. Run `hf mf dump -k ./keys.dic` to dump the RFID tag's contents -- Flipper Zero - 1. Open the qFlipper program and connect your Flipper to your computer - - You may also connect the SD card directly to your computer - 2. Navigate to `SD Card/nfc/assets/` - 3. Copy the `mf_classic_dict_user.nfc` file to your computer - 4. Copy the contents of `keys.dic` to `mf_classic_dict_user.nfc` - 5. Copy `mf_classic_dict_user.nfc` back onto your Flipper - 6. Use the NFC app to scan your tag - -### Proxmark3 fm11rf08s recovery script - -In 2024, a new backdoor[^rfid-backdoor] was found that makes it much easier to obtain the data from the RFID tags. A script is included in the proxmark3 software since v4.18994 (nicknamed "Backdoor"), which allows us to utilize this backdoor. Before this script was implemented, the tag had to be sniffed by placing the spool in the AMS and sniffing the packets transferred between the tag and the AMS. - -Place your reader on the tag, start proxmark3 (run `pm3`) and run the following command: - -`script run fm11rf08s_recovery` - -This script takes about 15-20 minutes to complete. Once it has finished, you will receive a binary key file and a dump. - -To visualize the data on the tag, run the following: - -`script run fm11rf08s_full -b` - -### Sniffing the tag data with a Proxmark3 (legacy method) - -Before the above methods were developed, tag data had to be obtained by sniffing the data between the RFID tag and the AMS using a Proxmark3-compatible device. - -To read how to obtain the tag data using the legacy sniffing method, see the [TagSniffing.md](./TagSniffing.md). - ## Tag Documentation -For a description of the blocks of a Bambu Lab RFID tag, see [BambuLabRfid.md](./BambuLabRfid.md). +For a description of the blocks of a Bambu Lab RFID tag, see [BambuLabRfid.md](./docs/BambuLabRfid.md). -For a description of the blocks of a Creality RFID tag, see [CrealityRfid.md](./CrealityRfid.md). +For a description of the blocks of a Creality RFID tag, see [CrealityRfid.md](./docs/CrealityRfid.md). -An open-source standard proposal, Open 3D-RFID, is being incubated in this repository. For a description of the standard, see [OpenSourceRfid.md](./OpenSourceRfid.md). +An open-source standard proposal, Open 3D-RFID, is being incubated in this repository. For a description of the standard, see [OpenSourceRfid.md](./docs/OpenSourceRfid.md). ## How do RFID tags work? @@ -172,23 +109,13 @@ Here's a high-level summary of how everything works: - RSA Signature Private Key. You'd have to get this from bambu, good luck - Since Bambu Lab will likely not remove the signature requirement, you would need custom AMS firmware to read tags and ignore the signature -## Compatible RFID tags - By generation +## Hacking a Bambu Lab Tag and readout of its data -There are tags known as "Magic Tags" which allow functionality that's not part of the classic MIFARE spec. -One example is that most Magic Tags allow the UID to be changed, which is normally read-only on MIFARE tags. -Magic tags are often refered to by their "generation", eg "Magic Gen 1". Each newer generation increases the functionality, but tends to also be more expensive) +Please visit [ReadTags.md](./docs/ReadTags.md), where we documented all the approaches we discovered along the way to get all required keys and data out of the tag. -Gen 1 --> **Not compatible**(due to AMS checking if tag is unlockable with command 0x40) +## RFID Tag Cloning -Gen 2 --> **Works** - -Gen 2 OTW --> **Not tested** - -Gen 3 --> **Not tested** - -Gen 4 --> **Not tested**(The best option but pricey and hard to source in small chip formfactor) - -FUID --> **Works** "Fused UID" aka "write-once UID". Once a UID is written, it cannot be changed +Please visit [WriteTags.md](./docs/WriteTags.md), where we documented all the current and past ways of cloning Bambu Lab filament RFID tags and compatible RFID tags used to clone them. ## Reverse engineering RFID Board diff --git a/BambuLabRfid.md b/docs/BambuLabRfid.md similarity index 100% rename from BambuLabRfid.md rename to docs/BambuLabRfid.md diff --git a/CrealityRfid.md b/docs/CrealityRfid.md similarity index 100% rename from CrealityRfid.md rename to docs/CrealityRfid.md diff --git a/OpenTag.md b/docs/OpenTag.md similarity index 100% rename from OpenTag.md rename to docs/OpenTag.md diff --git a/docs/ReadTags.md b/docs/ReadTags.md new file mode 100644 index 0000000..6348129 --- /dev/null +++ b/docs/ReadTags.md @@ -0,0 +1,106 @@ +# Hacking a Bambu Lab Tag and readout of its data + + We have documented here all the approaches we discovered along the way to get all required keys and data out of the tag. Instructions here are mainly focused on using the _**Proxmark 3**_, as this is what we have and use. There are many other devices capable of doing this, if you have discovered other ways of doing this and would like to contribute to it's documentation, please feel free to submit a pull request. + +Currently, the easiest way is using the built-in function of the latest version of Proxmark3 (Iceman fork). + +## Table of contents + +* [Dumping Tags using Proxmark3](#dumping-tags-using-proxmark3-iceman-fork) +* [Deriving the keys](#deriving-the-keys) +* [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) +* [Sniffing the tag data with a Proxmark3 (legacy method)](#sniffing-the-tag-data-with-a-proxmark3-legacy-method) + + +### Dumping Tags using Proxmark3 (Iceman fork) +As of 29th of May 2025, [pelrun](https://github.com/pelrun) has implemented functions into pm3 which allows for a much faster and simpler process to generate the keys and dump files from Bambu Lab filament RFID tags. Please update your copy of pm3 by running +```git pull``` +To replicate your own tags or contribute to the library, you can easily make dump and key files of your own tags by running the following commands, after placing the tag on your Proxmark 3, +``` +hf mf bambukeys -r -d;hf mf dump +``` +or +``` +hf mf bambukeys -r -d +hf mf dump +``` +This process should only take a few seconds with an expected output similar to below, (to keep things short, dumps of key and data were omitted) +``` +[=] -----------------------------------Add commentMore actions +[=] UID 4b... XX XX XX XX +[=] ----------------------------------- + +[+] Saved 192 bytes to binary file `C:\Users\exiom\Desktop\ProxSpace\pm3/hf-mf-XXXXXXXX-key.bin` +[+] Loaded binary key file `C:\Users\exiom\Desktop\ProxSpace\pm3/hf-mf-XXXXXXXX-key.bin` +[=] Reading sector access bits... +[=] ................. +[+] Finished reading sector access bits +[=] Dumping all blocks from card... +[-] Sector... 15 block... 3 ( ok ) +[+] Succeeded in dumping all blocks + +[+] time: 10 seconds + +[=] -----+-----+-------------------------------------------------+----------------- +[=] sec | blk | data | ascii +[=] -----+-----+-------------------------------------------------+----------------- + +[+] Saved 1024 bytes to binary file `C:\Users\exiom\Desktop\ProxSpace\pm3/hf-mf-XXXXXXXX-dump.bin` +[+] Saved to json file C:\Users\exiom\Desktop\ProxSpace\pm3/hf-mf-XXXXXXXX-dump.json +``` + +### Deriving the keys + +A way to derive the keys from the UID of an RFID tag was discovered, which unlocked the ability to scan and scrape RFID tag data without sniffing, as well as with other devices like the Flipper Zero. A script is included in the repository to derive the keys from the UID of a tag. + +First, obtain the tag's UID: + +- Proxmark3 + 1. Run the Proxmark3 software by running `pm3` in the terminal + 2. Place the Proxmark3 device on the RFID tag of the spool + 3. Run `hf mf info` and look for the UID line item +- Flipper Zero + 1. Open the NFC app and scan the tag + 2. The Flipper will attempt to decrypt the tag, but you can skip the "Nested Dictionary (Backdoor)" step for speed + 3. The UID of the tag will appear on-screen +- Bambu Lab AMS + 1. Load the spool into an AMS slot and wait for it to finish loading + 2. View the spool's details on the printer's touchscreen, Bambu Studio or Bambu Handy + 3. The UID is the first eight characters of the spool's serial number + +Next, run the key derivation script and pipe its output to a file by running `python3 deriveKeys.py [UID] > ./keys.dic`. + +Then, use the keys file to extract the data from the RFID tag: + +- Proxmark3 + 1. Run the Proxmark3 software by running `pm3` in the terminal + 2. Place the Proxmark3 device on the RFID tag of the spool + 3. Run `hf mf dump -k ./keys.dic` to dump the RFID tag's contents +- Flipper Zero + 1. Open the qFlipper program and connect your Flipper to your computer + - You may also connect the SD card directly to your computer + 2. Navigate to `SD Card/nfc/assets/` + 3. Copy the `mf_classic_dict_user.nfc` file to your computer + 4. Copy the contents of `keys.dic` to `mf_classic_dict_user.nfc` + 5. Copy `mf_classic_dict_user.nfc` back onto your Flipper + 6. Use the NFC app to scan your tag + +### Proxmark3 fm11rf08s recovery script + +In 2024, a new backdoor[^rfid-backdoor] was found that makes it much easier to obtain the data from the RFID tags. A script is included in the proxmark3 software since v4.18994 (nicknamed "Backdoor"), which allows us to utilize this backdoor. Before this script was implemented, the tag had to be sniffed by placing the spool in the AMS and sniffing the packets transferred between the tag and the AMS. + +Place your reader on the tag, start proxmark3 (run `pm3`) and run the following command: + +`script run fm11rf08s_recovery` + +This script takes about 15-20 minutes to complete. Once it has finished, you will receive a binary key file and a dump. + +To visualize the data on the tag, run the following: + +`script run fm11rf08_full -b` + +### Sniffing the tag data with a Proxmark3 (legacy method) + +Before the above methods were developed, tag data had to be obtained by sniffing the data between the RFID tag and the AMS using a Proxmark3-compatible device. + +To read how to obtain the tag data using the legacy sniffing method, see the [TagSniffing.md](./docs/TagSniffing.md). \ No newline at end of file diff --git a/TagSniffing.md b/docs/TagSniffing.md similarity index 100% rename from TagSniffing.md rename to docs/TagSniffing.md diff --git a/docs/WriteTags.md b/docs/WriteTags.md new file mode 100644 index 0000000..2a76e19 --- /dev/null +++ b/docs/WriteTags.md @@ -0,0 +1,154 @@ +# RFID Tag Cloning + +This serves as a guide on making a clone or your own dump or one from this library, and assumes you have a Proxmark3 and using ProxSpace. As there are plenty of guides online that can better explain how to set this up and therefore it will not be within the scope of this guide. + +## Table of contents + +* [Compatible RFID tags - By generation](#compatible-rfid-tags---by-generation) +* [Writing to Blank tags](#writing-to-blank-tags) + * [FUID](#fuid) + * [UFUID](#ufuid) + + +## Compatible RFID tags - By generation + +There are tags known as "Magic Tags" which allow functionality that's not part of the classic MIFARE spec. +One example is that most Magic Tags allow the UID to be changed, which is normally read-only on MIFARE tags. +Magic tags are often refered to by their "generation", eg "Magic Gen 1". Each newer generation increases the functionality, but tends to also be more expensive) + +Name inside the brackets are alternative names these tags are generally named under in various marketplaces such as AliExpress + +- Gen 1 (UID) --> **Not compatible** (AMS checks if tag is unlockable with command 0x40) +- Gen 2 (CUID) --> **Inconsistent or No longer works** (AMS writes a winky face to block 0, thereby "bricking" the tag) +- Gen 3 --> **Not tested** +- Gen 4 --> **Works** (The best option but pricey and hard to source in small chip formfactor) + - FUID --> **Works** Marketed as "Write-once UID". Functions similarly to a Gen 2 tag, once a UID is written, it cannot be changed. + - UFUID --> **Works** Marketed as "Sealable UID". Functions similarly to a Gen 1 tag, until it is "sealed" by the user. + +More information on the use of magic cards can be found at https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/magic_cards_notes.md#mifare-classic-uscuid + +## Writing to Blank tags +⚠ *(To ease frustrations caused by typos when issuing commands, I encourage you to use the copy button on the right, especially when multiple commands are issued using the same line)* ⚠ + +### FUID +FUIDs are marketed as "write once UID", it has a default UID of `AA55C396` and will allow writes to block 0 in this state. It will lock once written to. + +#### Identify +You can identify the tag by issuing the following commands and will show these expected results +``` +hf mf info +``` +For an unlocked card the following will show, +``` +[usb] pm3 --> hf mf info +[=] --- ISO14443-a Information --------------------- +[+] UID: AA 55 C3 96 +[=] --- Magic Tag Information +[+] Magic capabilities... Gen 2 / CUID +[+] Magic capabilities... Gen 4 GDM / USCUID ( Gen4 Magic Wakeup ) +[+] Magic capabilities... Write Once / FUID +``` +For an locked card the following will show, +``` +[=] --- Magic Tag Information +[=] +``` + +#### Write FUID +For simplity, you need to copy the desired source dump file (hf-mf-XXXXXXXX-dump.bin) and it's key file (hf-mf-XXXXXXXX-key.bin) into the `pm3` folder of `ProxSpace` wherever this maybe on your computer. + +To write to the FUID tag, we will issue the following command (replace hf-mf-XXXXXXXX-dump.bin with the file name of your source dump file) +``` +hf mf restore -u XXXXXXXX --force +``` +Expected Output: +``` +[+] Loaded binary key file `hf-mf-5AF731B5-key.bin` +[=] Using key file `hf-mf-5AF731B5-key.bin` +[+] Loaded 1024 bytes from binary file `hf-mf-5AF731B5-dump.bin` + +Wall of write messages omitted ending in ( ok ) + +[=] Done! +``` +You can verify that the tag has been successfully written by again running `hf mf info`, the UID should now be different to the first time you ran this command and matches that of the source dump file. +``` +[usb] pm3 --> hf mf info +[=] --- ISO14443-a Information --------------------- +[+] UID: XX XX XX XX +``` +You can additionally verify the content of the tag by issuing the command, +``` +hf mf dump --ns +``` +Your FUID tag is now written, locked and ready to use. + + + +### UFUID +UFUIDs are marketed as a "sealable UID", it will allow writes to the card until it is "sealed" by the user. + +#### Identify +You can identify the tag by issuing the following command: +``` +hf mf info +``` +For an unlocked card the following will show, +``` +[=] --- Magic Tag Information +[+] Magic capabilities... Gen 1a +[+] Magic capabilities... Gen 4 GDM / USCUID ( ZUID Gen1 Magic Wakeup ) +``` +For an locked card the following will show, +``` +[=] --- Magic Tag Information +[+] Magic capabilities... Gen 4 GDM / USCUID ( Gen4 Magic Wakeup ) +``` + +#### Write UFUID +For simplity, you need to copy the desired source dump file (hf-mf-XXXXXXXX-dump.bin) and it's key file (hf-mf-XXXXXXXX-key.bin) into the `pm3` folder of `ProxSpace` wherever this maybe on your computer. + +To write to the UFUID tag, we will issue the following gen1a command (replace hf-mf-XXXXXXXX-dump.bin with the file name of your source dump file) +``` +hf mf cload -f hf-mf-XXXXXXXX-dump.bin +``` +Expected Output: +``` +[+] Loaded 1024 bytes from binary file `hf-mf-XXXXXXXX-dump.bin` +[=] Copying to magic gen1a MIFARE Classic 1K +[=] ................................................................. +[+] Card loaded 64 blocks from file +[=] Done! +``` +You can verify that the tag has been successfully written by again running `hf mf info`, the UID should now be different to the first time you ran this command and matches that of the source dump file. +``` +[usb] pm3 --> hf mf info +[=] --- ISO14443-a Information --------------------- +[+] UID: XX XX XX XX +``` +You can additionally verify the content of the tag by issuing the command, +``` +hf mf dump --ns +``` + +#### Seal UFUID +Before you can use this tag, you will need to seal the UFUID tag by issuing the following commands, otherwise it will respond to Magic Card Gen1 commands which the AMS will identify and ignore the tag. + +⚠ (Please use the copy button on the right, as this procedure depends on you issuing the chain of commands succesively and completing the full set within a very short period of time.) ⚠ +``` +hf 14a raw -a -k -b 7 40;hf 14a raw -k 43;hf 14a raw -k -c e100;hf 14a raw -c 85000000000000000000000000000008 +``` +Expected Output: +``` +[usb] pm3 --> hf 14a raw -a -k -b 7 40;hf 14a raw -k 43;hf 14a raw -k -c e100;hf 14a raw -c 85000000000000000000000000000008 +[+] 0A +[+] 0A +[+] 0A +[+] 0A +``` +Now, when you issue the command `hf mf info`, it should now look like this, +``` +[=] --- Magic Tag Information +[=] +``` +Your UFUID tag is now written, locked and ready to use. \ No newline at end of file