From 308bde610dc83d367701c68d22c3e78ac5135abf Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:21:30 -0800 Subject: [PATCH 01/36] Format Readme using Prettier --- README.md | 325 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 170 insertions(+), 155 deletions(-) diff --git a/README.md b/README.md index c2726bc..5379976 100644 --- a/README.md +++ b/README.md @@ -4,88 +4,95 @@ This guide gives you a basic overview how you can decrypt and read your tags. Si We are currently working on a way to submit the tag data in a secure way so analysis on the data could be done. -# Table of contents +# Table of contents + - * [Project Summary](#project-summary) - * [FAQs](#faqs) - * [How do RFID tags work?](#how-do-rfid-tags-work) - * [How to contribute](#how-to-contribute) - * [Todos/Timeline/Next steps](#todostimelinenext-steps) - * [Required Equipment](#required-equipment) - * [Proxmark3 compatible readers](#proxmark3-compatible-readers) - * [Proxmark3 Easy](#proxmark3-easy) - * [Hacking a Bambulab Tag and readout of its data](#hacking-a-bambulab-tag-and-readout-of-its-data) - * [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) - * [Bambulab AMS RFID reader location](#bambulab-ams-rfid-reader-location) - * [Bambulab AMS Lite RFID reader location (legacy)](#bambulab-ams-lite-rfid-reader-location-legacy) - * [Proxmark3 placement for sniffing (legacy)](#proxmark3-placement-for-sniffing-legacy) - * [Key Derivation](#key-derivation) - * [Dump RFID Contents (.bin) (legacy)](#dump-rfid-contents-bin-legacy) - * [Tag Documentation](#tag-documentation) - * [Block Overview](#block-overview) - * [MIFARE Encryption Keys](#mifare-encryption-keys) - * [Block 0](#block-0) - * [Block 1](#block-1) - * [Block 2](#block-2) - * [Block 4](#block-4) - * [Block 5](#block-5) - * [Block 6](#block-6) - * [Block 8](#block-8) - * [Block 9](#block-9) - * [Block 10](#block-10) - * [Block 12](#block-12) - * [Block 13](#block-13) - * [Block 14](#block-14) - * [Block 16](#block-16) - * [Block 17](#block-17) - * [Compatible RFID tags - By generation](#compatible-rfid-tags----by-generation) - * [Reverse engineering RFID Board](#reverse-engineering-rfid-board) + +- [Project Summary](#project-summary) + - [FAQs](#faqs) + - [How do RFID tags work?](#how-do-rfid-tags-work) + - [How to contribute](#how-to-contribute) +- [Todos/Timeline/Next steps](#todostimelinenext-steps) +- [Required Equipment](#required-equipment) + - [Proxmark3 compatible readers](#proxmark3-compatible-readers) + - [Proxmark3 Easy](#proxmark3-easy) +- [Hacking a Bambulab Tag and readout of its data](#hacking-a-bambulab-tag-and-readout-of-its-data) + - [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) + - [Bambulab AMS RFID reader location](#bambulab-ams-rfid-reader-location) + - [Bambulab AMS Lite RFID reader location (legacy)](#bambulab-ams-lite-rfid-reader-location-legacy) + - [Proxmark3 placement for sniffing (legacy)](#proxmark3-placement-for-sniffing-legacy) + - [Key Derivation](#key-derivation) + - [Dump RFID Contents (.bin) (legacy)](#dump-rfid-contents-bin-legacy) +- [Tag Documentation](#tag-documentation) + - [Block Overview](#block-overview) + - [MIFARE Encryption Keys](#mifare-encryption-keys) + - [Block 0](#block-0) + - [Block 1](#block-1) + - [Block 2](#block-2) + - [Block 4](#block-4) + - [Block 5](#block-5) + - [Block 6](#block-6) + - [Block 8](#block-8) + - [Block 9](#block-9) + - [Block 10](#block-10) + - [Block 12](#block-12) + - [Block 13](#block-13) + - [Block 14](#block-14) + - [Block 16](#block-16) + - [Block 17](#block-17) +- [Compatible RFID tags - By generation](#compatible-rfid-tags----by-generation) +- [Reverse engineering RFID Board](#reverse-engineering-rfid-board) ## Project Summary + This is a research group dedicated to documenting the data structures used by Bambulab 3D printers to identify filament data. ### FAQs - * **Can I clone tags?** - * Yes, you can read and clone tags using a tool such as a Proxmark3 - * **Can I create custom tags?** - * No, tags are digitally signed. Even if you modify the contents, the printer will reject any tags without a valid RSA signature - * An [Open Source RFID Tag](OpenSourceRfid.md) has been proposed to allow anyone to create / modify their own tags. This must be adopted by printer manufacturers, or you can mod your own printer for support - * **What are the next steps for this project?** - * Decyphering the rest of the unknwn tag content - * Custom AMS firmware that allows custom tags to be read while ignoring the signature - * See [Todos/Timeline/Next steps](#todostimelinenext-steps) for more info + +- **Can I clone tags?** + - Yes, you can read and clone tags using a tool such as a Proxmark3 +- **Can I create custom tags?** + - No, tags are digitally signed. Even if you modify the contents, the printer will reject any tags without a valid RSA signature + - An [Open Source RFID Tag](OpenSourceRfid.md) has been proposed to allow anyone to create / modify their own tags. This must be adopted by printer manufacturers, or you can mod your own printer for support +- **What are the next steps for this project?** + - Decyphering the rest of the unknwn tag content + - Custom AMS firmware that allows custom tags to be read while ignoring the signature + - See [Todos/Timeline/Next steps](#todostimelinenext-steps) for more info ### How do RFID tags work? + Here's a high-level summary of how everything works: -* BambuLab printers use MiFare 13.56MHZ RFID tags - * These tags contain a unique ID that is not encrypted (called the UID) - * In most cases UID is fixed (not-changable). Some "hackable" rfid tags allow you to set the UID to anything you want -* Blocks (Encrypted) - * MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. See [Tag stucture](#tag-stucture) section for details - * The blocks are encrypted, meaning that you need to have a KEY to decipher them - * Each block is encrypted with a different key -* Encryption Keys - * Keys are unique to each RFID tag. Even if you discover the key for one tag, that doesn't mean you can use that same key to unlock a different tag. - * As of 11/19/24, keys can be derived from the UID. After reading the UID from the tag, the KDF (key derivation function) can be used to derive the 16 keys. - * (Outdated, sniffing is no longer required now that the KDF is known) Keys can be sniffed by using a device (such as a ProxMark 3) to listen in on the communication between the AMS and the rfid tag. - * Once the keys have been sniffed, they can be saved and used to read the contents of the tag directly (without an AMS). (Reminder, the saved keys will ONLY work for the tag they were sniffed from) -* RSA Signature - * One of the blocks contains a 2048-bit RSA Signature - * RSA signatures are a way to digitally sign / certify authenticity of content, and they are effectively un-breakable (this is how things like cryptocurrency remain secure) - * RSA signatures encompass all of the data of the RFID tag. Changing a single byte somewhere else in the tag would require a completely different signature to be considered genuine - * Bambu printers check the content of the tag and then check if the signature is valid. If the signature is invalid, it rejects the tag -* Cloning Tags - * Even though there is a signature, a tag can be cloned - * To clone a tag, it must have the same UID, identical content from the data blocks, and the identical RSA signature - * Changing even one byte will cause the signature to be invalid, and the tag will be rejected -* Custom Tags - * This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. - * To create a custom key, you need to know the following info: - * RSA Signature Private Key. You'd have to get this from bambu, good luck - * Since Bambulab will likely not remove the signature requirement, you would need custom AMS firmware to read tags and ignore the signature + +- BambuLab printers use MiFare 13.56MHZ RFID tags + - These tags contain a unique ID that is not encrypted (called the UID) + - In most cases UID is fixed (not-changable). Some "hackable" rfid tags allow you to set the UID to anything you want +- Blocks (Encrypted) + - MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. See [Tag stucture](#tag-stucture) section for details + - The blocks are encrypted, meaning that you need to have a KEY to decipher them + - Each block is encrypted with a different key +- Encryption Keys + - Keys are unique to each RFID tag. Even if you discover the key for one tag, that doesn't mean you can use that same key to unlock a different tag. + - As of 11/19/24, keys can be derived from the UID. After reading the UID from the tag, the KDF (key derivation function) can be used to derive the 16 keys. + - (Outdated, sniffing is no longer required now that the KDF is known) Keys can be sniffed by using a device (such as a ProxMark 3) to listen in on the communication between the AMS and the rfid tag. + - Once the keys have been sniffed, they can be saved and used to read the contents of the tag directly (without an AMS). (Reminder, the saved keys will ONLY work for the tag they were sniffed from) +- RSA Signature + - One of the blocks contains a 2048-bit RSA Signature + - RSA signatures are a way to digitally sign / certify authenticity of content, and they are effectively un-breakable (this is how things like cryptocurrency remain secure) + - RSA signatures encompass all of the data of the RFID tag. Changing a single byte somewhere else in the tag would require a completely different signature to be considered genuine + - Bambu printers check the content of the tag and then check if the signature is valid. If the signature is invalid, it rejects the tag +- Cloning Tags + - Even though there is a signature, a tag can be cloned + - To clone a tag, it must have the same UID, identical content from the data blocks, and the identical RSA signature + - Changing even one byte will cause the signature to be invalid, and the tag will be rejected +- Custom Tags + - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. + - To create a custom key, you need to know the following info: + - RSA Signature Private Key. You'd have to get this from bambu, good luck + - Since Bambulab will likely not remove the signature requirement, you would need custom AMS firmware to read tags and ignore the signature ### How to contribute + If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your tags and submit them for review. The more data we have, the easier it is to compare differences to learn what each byte represents. A lot of the contents have been deciphered (see [Tag stucture](#tag-stucture)), but there is still more unknown data still left. @@ -96,7 +103,6 @@ The more data we have, the easier it is to compare differences to learn what eac - [ ] Tag content analysis - [ ] Generate keys based on an arbitrary UID - ## Required Equipment - Bambulab 3D Printer with AMS or AMS Lite @@ -107,11 +113,13 @@ The more data we have, the easier it is to compare differences to learn what eac ### Proxmark3 compatible readers #### Proxmark3 Easy + ![](images/Proxmark3_easy.png) 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 Bambulab 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 sniff the data. @@ -132,25 +140,28 @@ To visualize the data on the tag you can run now: `script run fm11rf08_full -b` ### Bambulab AMS RFID reader location + The Bambulab AMS RFID readers are located between slots 1&2 and slots 3&4. ![](images/filament-slots.jpg) ### Bambulab AMS Lite RFID reader location (legacy) + The Bambulab AMS Lite RFID readers are located at the base of each spool holder. For sniffing, you will need to place the Proxmark in between the RFID tag and the reader on the AMS. As there is not much clearance, it is recommended to temporarily remove the low frequency radio (the topmost piece) if you can, as it will not be used in this process. ### Proxmark3 placement for sniffing (legacy) -For sniffing, you will need to place the Proxmark3 against the reader. On the AMS lite, you must place it in between the reader and the spool. On the AMS, it is recommended to place it between the reader and the spool, but you may place it on the other side (for example, load the spool into slot 1 and place the Proxmark3 against the reader in slot 2). +For sniffing, you will need to place the Proxmark3 against the reader. On the AMS lite, you must place it in between the reader and the spool. On the AMS, it is recommended to place it between the reader and the spool, but you may place it on the other side (for example, load the spool into slot 1 and place the Proxmark3 against the reader in slot 2). > [!TIP] -> As there is not much clearance, it may be helpful to disassemble the Proxmark3 Easy and remove the top and middle layers. For this particular process, you will only need the bottom-most layer. +> As there is not much clearance, it may be helpful to disassemble the Proxmark3 Easy and remove the top and middle layers. For this particular process, you will only need the bottom-most layer. If you place the Proxmark in between the AMS reader and the spool, make sure that spool rotates so that the RFID tag moves away from the reader, otherwise the AMS will assume that it is reading the tag from its neighboring slot and attempt to rewind it until it cannot see the RFID tag. -### Key Derivation ### +### Key Derivation + As of 11/19/24, keys can now be derived from the UID of a tag. ```python @@ -158,17 +169,15 @@ from Cryptodome.Protocol.KDF import HKDF from Cryptodome.Hash import SHA256 uid=bytes([0x02,0x3b,0x44,0x74]) -master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) +master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) keys=HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") print([a.hex() for a in keys]) ``` - ### Dump RFID Contents (.bin) (legacy) - 1. **Run ProxMark3 Software** In a terminal, run `pm3` to start the Proxmark3 Software @@ -176,7 +185,7 @@ print([a.hex() for a in keys]) 2. **Sniff Communication** - Start sniffing with: `hf 14a sniff -c -r`
- (hf=High Frequency, 14a=Tag Type, Sniff=command, -c and -r mean "capture on triggers instead of continuously) + (hf=High Frequency, 14a=Tag Type, Sniff=command, -c and -r mean "capture on triggers instead of continuously) - Place your Proxmark3 between the tag and the AMS. Recommended: Use tape to hold it in place. - Load a strand of filament into the AMS. This is what triggers the AMS to attempt to read the RFID tag. @@ -198,13 +207,13 @@ print([a.hex() for a in keys]) 6. Run `hf mf fchk -f [dictionaryFilepath] --dump` to create a key file - - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard. + - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard. - - Example: + - Example: - ``` - [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin - ``` + ``` + [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin + ``` 2. **Manual** (not recommended) @@ -212,27 +221,28 @@ print([a.hex() for a in keys]) - We will discover keys one at a time and save them to a dictionary file. - Navigate to your Proxmark3 software installation directory. This will be specific to your Operating System and Installation. - - macOS (Intel) Example: `/usr/local/Cellar/proxmark3/4.17768/share/proxmark3/` - - macOS (ARM) Eample: `/opt/homebrew/Cellar/proxmark3/4.17768/share/proxmark3/` - - Windows Example: TBD - - Linux Example: TBD + - macOS (Intel) Example: `/usr/local/Cellar/proxmark3/4.17768/share/proxmark3/` + - macOS (ARM) Eample: `/opt/homebrew/Cellar/proxmark3/4.17768/share/proxmark3/` + - Windows Example: TBD + - Linux Example: TBD - Open a text editor and save a blank file called `myDictionary.dic` into the `dictionaries/` folder of your Proxmark3 software installation directory. - (You can call this file anything you want, but for the rest of this example, we will refer to it as "myDictionary") + (You can call this file anything you want, but for the rest of this example, we will refer to it as "myDictionary") - Leave this file open, we will continue to add keys to it in the next step 2. **Extract Keys From Trace** + - Run `trace list -t mf -f myDictionary` to view the trace that was recorded from sniffing in the previous step. - This uses the key dictionary `myDictionary.dic` that we created in step 3. + This uses the key dictionary `myDictionary.dic` that we created in step 3. + - Read the output and look for anything that mentions a key. - - Three Possible Formats: - - `key E0B50731BE27 prng WEAK` - Follow Step 5 - - `nested probable key: 50B0318A4FE7` - Follow Step 6 - - `Nested authentication detected.` - Follow Step 7 - - - Each of these 3 entries can provide us with a valid key. Follow step 5, 6, or 7 depending on which type of key you encounter. + - Three Possible Formats: + - `key E0B50731BE27 prng WEAK` - Follow Step 5 + - `nested probable key: 50B0318A4FE7` - Follow Step 6 + - `Nested authentication detected.` - Follow Step 7 + - Each of these 3 entries can provide us with a valid key. Follow step 5, 6, or 7 depending on which type of key you encounter. 3. **First Key - Plain Text** - Example: `key E0B50731BE27 prng WEAK` @@ -243,57 +253,60 @@ print([a.hex() for a in keys]) - Copy/paste this key into the `myDictionary.dic` file that you created in step 3, then save the file. 5. **Nested Authentication Key** - Example: - ``` - Nested authentication detected. - tools/mf_nonce_brute/mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C - ``` + ``` + Nested authentication detected. + tools/mf_nonce_brute/mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C + ``` - Open a second terminal window, and change directories into your Proxmark3 software installation directory. This is specific to your OS and PM3 installation. - - macOS/Linux: `cd $(brew --prefix proxmark3)/share/proxmark3/` - - Windows: TBD + - macOS/Linux: `cd $(brew --prefix proxmark3)/share/proxmark3/` + - Windows: TBD - CD into the tools folder `cd tools/` - Copy the command from ProxMark starting at `mf_nonce_brute`, including all the arguments (random letters/numbers) after it, and run the program from the `tools/` directory. - - Example (macOS/Linux): `./mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` - - Example (Windows): `mf_nonce_brute.exe 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` + - Example (macOS/Linux): `./mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` + - Example (Windows): `mf_nonce_brute.exe 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` - The program will discover a key. Copy/paste this key into your `myDictionary.dic` file, and SAVE IT. - - Example Output: - ``` - Valid Key found [ 202efd3dcdfd ] - ``` + - Example Output: + ``` + Valid Key found [ 202efd3dcdfd ] + ``` 6. **Check Keys (Optional)** + - If you want to check how many valid keys you've discovered, you can do this test - This is optional, and you can choose to wait until you have discovered all of the keys - **WARNING**: Performing a key check will erase the trace that you recorded during step 2, and will require you to re-sniff data (repeat step 2) - - If you want to save your trace to avoid re-sniffing, use `trace save -f ` and `trace load -f ` + + - If you want to save your trace to avoid re-sniffing, use `trace save -f ` and `trace load -f ` - Run `hf mf fchk --1k -f myDictionary` to test your keys - - Example Output (showing 11/16 keys discovered): - ``` - [+] found keys: - - [+] -----+-----+--------------+---+--------------+---- - [+] Sec | Blk | key A |res| key B |res - [+] -----+-----+--------------+---+--------------+---- - [+] 000 | 003 | E0B50731BE27 | 1 | ------------ | 0 - [+] 001 | 007 | 63654DB94D97 | 1 | ------------ | 0 - [+] 002 | 011 | 387C06EFFDC8 | 1 | ------------ | 0 - [+] 003 | 015 | 38963E577E43 | 1 | ------------ | 0 - [+] 004 | 019 | 8A3EA2564692 | 1 | ------------ | 0 - [+] 005 | 023 | 935E0F11857A | 1 | ------------ | 0 - [+] 006 | 027 | EBC8F7D23A06 | 1 | ------------ | 0 - [+] 007 | 031 | DD6128F13D4C | 1 | ------------ | 0 - [+] 008 | 035 | ------------ | 0 | ------------ | 0 - [+] 009 | 039 | 4E470B09521F | 1 | ------------ | 0 - [+] 010 | 043 | 50EB8811A69C | 1 | ------------ | 0 - [+] 011 | 047 | 4BDD25091824 | 1 | ------------ | 0 - [+] 012 | 051 | ------------ | 0 | ------------ | 0 - [+] 013 | 055 | ------------ | 0 | ------------ | 0 - [+] 014 | 059 | ------------ | 0 | ------------ | 0 - [+] 015 | 063 | ------------ | 0 | ------------ | 0 - [+] -----+-----+--------------+---+--------------+---- - [+] ( 0:Failed / 1:Success ) - ``` + - Example Output (showing 11/16 keys discovered): + ``` + [+] found keys: + + [+] -----+-----+--------------+---+--------------+---- + [+] Sec | Blk | key A |res| key B |res + [+] -----+-----+--------------+---+--------------+---- + [+] 000 | 003 | E0B50731BE27 | 1 | ------------ | 0 + [+] 001 | 007 | 63654DB94D97 | 1 | ------------ | 0 + [+] 002 | 011 | 387C06EFFDC8 | 1 | ------------ | 0 + [+] 003 | 015 | 38963E577E43 | 1 | ------------ | 0 + [+] 004 | 019 | 8A3EA2564692 | 1 | ------------ | 0 + [+] 005 | 023 | 935E0F11857A | 1 | ------------ | 0 + [+] 006 | 027 | EBC8F7D23A06 | 1 | ------------ | 0 + [+] 007 | 031 | DD6128F13D4C | 1 | ------------ | 0 + [+] 008 | 035 | ------------ | 0 | ------------ | 0 + [+] 009 | 039 | 4E470B09521F | 1 | ------------ | 0 + [+] 010 | 043 | 50EB8811A69C | 1 | ------------ | 0 + [+] 011 | 047 | 4BDD25091824 | 1 | ------------ | 0 + [+] 012 | 051 | ------------ | 0 | ------------ | 0 + [+] 013 | 055 | ------------ | 0 | ------------ | 0 + [+] 014 | 059 | ------------ | 0 | ------------ | 0 + [+] 015 | 063 | ------------ | 0 | ------------ | 0 + [+] -----+-----+--------------+---+--------------+---- + [+] ( 0:Failed / 1:Success ) + ``` 7. **Find Remaining Keys** + - Repeat step 4 until all 16 keys are discovered - Your dictionary may be larger than 16 entries if you accidentally copied a duplicate key or an invalid key. These invalid entries are fine, and you can ignore them - **Recommended**: When you think you have discovered all 16 keys, perform step 8 to verify that your keys are correct. @@ -303,20 +316,21 @@ print([a.hex() for a in keys]) - Remove the spool from the AMS and hold the Proxmark3 against the RFID tag of the spool - Run `hf mf fchk --1k -f myDictionary --dump` to create a key file - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard - - Example: - ``` - [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin - ``` + - Example: + ``` + [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin + ``` 4. **Dump RFID Contents** - + - Run `hf mf dump -k [path-to-keyfile]` while the Proxmark3 is on the spool's RFID tag to dump the contents of the tag using the 16 keys we discovered - There should be no errors - The output should tell you where your `.bin` file is saved - - Example: - ``` - [+] saved 1024 bytes to binary file /Users/mitch/hf-mf-75066B1D-dump.bin - ``` + - Example: + ``` + [+] saved 1024 bytes to binary file /Users/mitch/hf-mf-75066B1D-dump.bin + ``` + ## Tag Documentation This contains documentation for the known and unknown data that is contained in each block on the RFID tag. @@ -444,11 +458,11 @@ Known Values: Example Data: `AA AA AA AA BB BB __ __ CC CC CC CC __ __ __ __` -| position | length | type | Description | -| -------- | ------ | ----------- | -------------------------------------------- | -| 0 (AA) | 4 | RGBA | Color in hex RGBA | -| 4 (BB) | 2 | uint16 (LE) | Spool Weight in grams (`E8 03` --> 1000 g) | -| 8 (CC) | 8 | float (LE) | Filament Diameter in milimeters | +| position | length | type | Description | +| -------- | ------ | ----------- | ------------------------------------------ | +| 0 (AA) | 4 | RGBA | Color in hex RGBA | +| 4 (BB) | 2 | uint16 (LE) | Spool Weight in grams (`E8 03` --> 1000 g) | +| 8 (CC) | 8 | float (LE) | Filament Diameter in milimeters | ### Block 6 @@ -488,8 +502,8 @@ Example Data: Example Data: `__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` -| position | length | type | Description | -| -------- | ------ | ------- | ------------------------- | +| position | length | type | Description | +| -------- | ------ | ----------- | --------------------------------------------------- | | 4 (AA) | 2 | uint16 (LE) | Spool Width in µm (`E1 19` --> 6625µm --> 66.25mm ) | ### Block 12 @@ -531,6 +545,7 @@ Example Data: | 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | Known Format Identifiers: + - 00 00 = Empty - 02 00 = Color Info @@ -539,15 +554,15 @@ Known Format Identifiers: Example Data: `AA AA __ __ __ __ __ __ __ __ __ __ __ __ __ __` -| position | length | type | Description | -| -------- | ------ | ----------- | ---------------------------------- | -| 0 (AA) | 2 | **Unknown** | **Unknown** | +| position | length | type | Description | +| -------- | ------ | ----------- | ----------- | +| 0 (AA) | 2 | **Unknown** | **Unknown** | -## Compatible RFID tags - By generation +## 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) +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) Gen 1 --> **Not compatible**(due to AMS checking if tag is unlockable with command 0x40) From c595afff0f174294e093854f8952fb3f0b519b55 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:22:04 -0800 Subject: [PATCH 02/36] Bambulab -> Bambu Lab --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 5379976..c62f904 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Bambulab RFID Tag Guide +# Bambu Lab RFID Tag Guide -This guide gives you a basic overview how you can decrypt and read your tags. Since we don't know how Bambulab will react on this guide and the general reverse engineering of the tags: **Please don't share you tag's UID and the related keys for now.** +This guide gives you a basic overview how you can decrypt and read your tags. Since we don't know how Bambu Lab will react on this guide and the general reverse engineering of the tags: **Please don't share you tag's UID and the related keys for now.** We are currently working on a way to submit the tag data in a secure way so analysis on the data could be done. @@ -16,10 +16,10 @@ We are currently working on a way to submit the tag data in a secure way so anal - [Required Equipment](#required-equipment) - [Proxmark3 compatible readers](#proxmark3-compatible-readers) - [Proxmark3 Easy](#proxmark3-easy) -- [Hacking a Bambulab Tag and readout of its data](#hacking-a-bambulab-tag-and-readout-of-its-data) +- [Hacking a Bambu Lab Tag and readout of its data](#hacking-a-bambu-lab-tag-and-readout-of-its-data) - [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) - - [Bambulab AMS RFID reader location](#bambulab-ams-rfid-reader-location) - - [Bambulab AMS Lite RFID reader location (legacy)](#bambulab-ams-lite-rfid-reader-location-legacy) + - [Bambu Lab AMS RFID reader location](#bambu-lab-ams-rfid-reader-location) + - [Bambu Lab AMS Lite RFID reader location (legacy)](#bambu-lab-ams-lite-rfid-reader-location-legacy) - [Proxmark3 placement for sniffing (legacy)](#proxmark3-placement-for-sniffing-legacy) - [Key Derivation](#key-derivation) - [Dump RFID Contents (.bin) (legacy)](#dump-rfid-contents-bin-legacy) @@ -46,7 +46,7 @@ We are currently working on a way to submit the tag data in a secure way so anal ## Project Summary -This is a research group dedicated to documenting the data structures used by Bambulab 3D printers to identify filament data. +This is a research group dedicated to documenting the data structures used by Bambu Lab 3D printers to identify filament data. ### FAQs @@ -64,7 +64,7 @@ This is a research group dedicated to documenting the data structures used by Ba Here's a high-level summary of how everything works: -- BambuLab printers use MiFare 13.56MHZ RFID tags +- Bambu Lab printers use MiFare 13.56MHZ RFID tags - These tags contain a unique ID that is not encrypted (called the UID) - In most cases UID is fixed (not-changable). Some "hackable" rfid tags allow you to set the UID to anything you want - Blocks (Encrypted) @@ -89,7 +89,7 @@ Here's a high-level summary of how everything works: - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. - To create a custom key, you need to know the following info: - RSA Signature Private Key. You'd have to get this from bambu, good luck - - Since Bambulab will likely not remove the signature requirement, you would need custom AMS firmware to read tags and ignore the signature + - Since Bambu Lab will likely not remove the signature requirement, you would need custom AMS firmware to read tags and ignore the signature ### How to contribute @@ -105,8 +105,8 @@ The more data we have, the easier it is to compare differences to learn what eac ## Required Equipment -- Bambulab 3D Printer with AMS or AMS Lite -- Bambulab Filament spool **or** the related tags +- Bambu Lab 3D Printer with AMS or AMS Lite +- Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader - The [proxmark3 software](https://github.com/RfidResearchGroup/proxmark3) @@ -118,7 +118,7 @@ The more data we have, the easier it is to compare differences to learn what eac 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 Bambulab Tag and readout of its data +## 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 sniff the data. @@ -139,15 +139,15 @@ To visualize the data on the tag you can run now: `script run fm11rf08_full -b` -### Bambulab AMS RFID reader location +### Bambu Lab AMS RFID reader location -The Bambulab AMS RFID readers are located between slots 1&2 and slots 3&4. +The Bambu Lab AMS RFID readers are located between slots 1&2 and slots 3&4. ![](images/filament-slots.jpg) -### Bambulab AMS Lite RFID reader location (legacy) +### Bambu Lab AMS Lite RFID reader location (legacy) -The Bambulab AMS Lite RFID readers are located at the base of each spool holder. +The Bambu Lab AMS Lite RFID readers are located at the base of each spool holder. For sniffing, you will need to place the Proxmark in between the RFID tag and the reader on the AMS. As there is not much clearance, it is recommended to temporarily remove the low frequency radio (the topmost piece) if you can, as it will not be used in this process. @@ -343,43 +343,43 @@ Summary of what kind of data is stored in each block. Detailed info for each blo | 0 | 0 | [Block 0](#block-0) UID and Tag Manufacturer Data | | 0 | 1 | [Block 1](#block-1) Tray Info Index | | 0 | 2 | [Block 2](#block-2) Filament Type | -| 0 | 3 | [Block 3](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 0 | 3 | [Block 3](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 1 | 0 | [Block 4](#block-4) Detailed Filament Type | | 1 | 1 | [Block 5](#block-5) Spool Weight, Color Code, Filament Diameter | | 1 | 2 | [Block 6](#block-6) Temperatures and Drying Info | -| 1 | 3 | [Block 7](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 1 | 3 | [Block 7](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 2 | 0 | [Block 8](#block-8) X Cam Info, Nozzle Diameter | | 2 | 1 | [Block 9](#block-9) Tray UID | | 2 | 2 | [Block 10](#block-10) Spool Width | -| 2 | 3 | [Block 11](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 2 | 3 | [Block 11](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 3 | 0 | [Block 12](#block-12) Production Date/Time | | 3 | 1 | [Block 13](#block-13) Short Production Date/Time | | 3 | 2 | [Block 14](#block-14) Filament Length | -| 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 4 | 0 | [Block 16](#block-16) Extra Color Info | | 4 | 1 | [Block 17](#block-17) **Unknown** | | 4 | 2 | **Empty** | -| 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 5 | 0 | **Empty** | | 5 | 1 | **Empty** | | 5 | 2 | **Empty** | -| 5 | 3 | [Block 23](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 5 | 3 | [Block 23](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 6 | 0 | **Empty** | | 6 | 1 | **Empty** | | 6 | 2 | **Empty** | -| 6 | 3 | [Block 27](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 6 | 3 | [Block 27](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 7 | 0 | **Empty** | | 7 | 1 | **Empty** | | 7 | 2 | **Empty** | -| 7 | 3 | [Block 31](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 7 | 3 | [Block 31](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 8 | 0 | **Empty** | | 8 | 1 | **Empty** | | 8 | 2 | **Empty** | -| 8 | 3 | [Block 35](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 8 | 3 | [Block 35](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 9 | 0 | **Empty** | | 9 | 1 | **Empty** | | 9 | 2 | **Empty** | -| 9 | 3 | [Block 39](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | +| 9 | 3 | [Block 39](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | | 10-15 | \* | **RSA-2048 Signature** | The first part of the filament serial number seems to be the Tag UID. @@ -390,8 +390,8 @@ The first part of the filament serial number seems to be the Tag UID. ### MIFARE Encryption Keys Every 4th block (eg Sector X, Block 3) contains encryption keys that are part of the MIFARE RFID standard. -This has nothing to do with BambuLab's memory format. -All BambuLab tags use the same Permission Bits (Access Control) +This has nothing to do with Bambu Lab's memory format. +All Bambu Lab tags use the same Permission Bits (Access Control) Example Data: `AA AA AA AA AA AA PP PP PP PP BB BB BB BB BB BB` From db76df0cf2258f4b9b4abb9fcdacd9d35a721643 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:31:29 -0800 Subject: [PATCH 03/36] Re-add link to Discord --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c62f904..1822c3a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This guide gives you a basic overview how you can decrypt and read your tags. Si We are currently working on a way to submit the tag data in a secure way so analysis on the data could be done. +[![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) + # Table of contents From 9b88549b49bbf75a2beeb1b2c38f2061988465bc Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:33:06 -0800 Subject: [PATCH 04/36] Say to specifically use the Iceman fork of pm3 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1822c3a..1e5f7b0 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,8 @@ The more data we have, the easier it is to compare differences to learn what eac - Bambu Lab 3D Printer with AMS or AMS Lite - Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader -- The [proxmark3 software](https://github.com/RfidResearchGroup/proxmark3) +- The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) + - The official version is unmaintained, so we strongly recommend using the Iceman fork; the steps written below are written for the Iceman fork ### Proxmark3 compatible readers From 4e08dc0e0ddb91c6f3c1b240c617a2c7b3f32c0e Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:33:15 -0800 Subject: [PATCH 05/36] Convert date format to international format --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e5f7b0..207965d 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ If you place the Proxmark in between the AMS reader and the spool, make sure tha ### Key Derivation -As of 11/19/24, keys can now be derived from the UID of a tag. +As of 2024-11-19, keys can now be derived from the UID of a tag. ```python from Cryptodome.Protocol.KDF import HKDF From 77be3aab53fd37a37256276e2781d95f7daf30fa Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:33:42 -0800 Subject: [PATCH 06/36] Format Python --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 207965d..1599175 100644 --- a/README.md +++ b/README.md @@ -171,10 +171,10 @@ As of 2024-11-19, keys can now be derived from the UID of a tag. from Cryptodome.Protocol.KDF import HKDF from Cryptodome.Hash import SHA256 -uid=bytes([0x02,0x3b,0x44,0x74]) +uid = bytes([0x02,0x3b,0x44,0x74]) master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) -keys=HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") +keys = HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") print([a.hex() for a in keys]) ``` From d9e1ba1fa4f068734a4d9d374b0e2a52e0e448d2 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:41:45 -0800 Subject: [PATCH 07/36] Don't recommend Iceman fork; require it --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1599175..fe0af50 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ The more data we have, the easier it is to compare differences to learn what eac - Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) - - The official version is unmaintained, so we strongly recommend using the Iceman fork; the steps written below are written for the Iceman fork + - Make sure you are using the Iceman fork as the original version of the software is unmaintained; all instructions are written for the Iceman fork and will not work on the original version ### Proxmark3 compatible readers From 8e1c66eebe273cf2d28acda5c48a338f2bb80677 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:42:09 -0800 Subject: [PATCH 08/36] "github" -> "GitHub" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe0af50..5395764 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ The more data we have, the easier it is to compare differences to learn what eac ## Todos/Timeline/Next steps - [ ] Tool for automatic trace analysis -- [ ] Web service for tag submisson with automatic anonymized data publishing to github +- [ ] Web service for tag submisson with automatic anonymized data publishing to GitHub - [ ] Tag content analysis - [ ] Generate keys based on an arbitrary UID From 8be4fc0a739f7053da71b94959590b99e66aebc3 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:45:00 -0800 Subject: [PATCH 09/36] Simplify instructions for using recovery script --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5395764..e005a41 100644 --- a/README.md +++ b/README.md @@ -123,26 +123,23 @@ A Proxmark3 Easy is sufficient for all the tasks that need to be done. You can b ## 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 sniff the data. - -Update November 2024: In 2024 a new backdoor was found which requires no sniffing. Details can be found [here](https://eprint.iacr.org/2024/1275.pdf). Overall this makes it much easier get the keys and the tags 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 use the `fm11rf08s` script included in the Proxmark3 software. ### Proxmark3 fm11rf08s recovery script -This script is included in proxmarx3 since its release "Backdoor" and later. +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 and run the following command. +Place your reader on the tag, start proxmark3 (run `pm3`) and run the following command: `script run fm11rf08s_recovery` -This requires some time but once done you receive a binary key file and a dump. +This script takes a bit of time, but once it is complete, you will receive a binary key file and a dump. -To visualize the data on the tag you can run now: +To visualize the data on the tag, run the following: `script run fm11rf08_full -b` -### Bambu Lab AMS RFID reader location +### Bambu Lab AMS RFID reader location (legacy) The Bambu Lab AMS RFID readers are located between slots 1&2 and slots 3&4. @@ -585,3 +582,5 @@ For ease of debugging and lowering the cost of failures the RFID board is revers As a nice to benefit to have is that you can manufacture boards in different colors. ![](rfid-board/Photo_PCB_BBL-RFID.jpg) + +[^rfid-backdoor]: https://eprint.iacr.org/2024/1275.pdf From bddc47a5b7bfea652f7dcdb85b5f9e243b675cb8 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:59:29 -0800 Subject: [PATCH 10/36] Move legacy sniffing instructions to its own document to de-clutter the Readme --- README.md | 192 +---------------------------------------------- TagSniffing.md | 197 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+), 190 deletions(-) create mode 100644 TagSniffing.md diff --git a/README.md b/README.md index e005a41..60ff39f 100644 --- a/README.md +++ b/README.md @@ -139,197 +139,9 @@ To visualize the data on the tag, run the following: `script run fm11rf08_full -b` -### Bambu Lab AMS RFID reader location (legacy) +### Sniffing the tag data (legacy method) -The Bambu Lab AMS RFID readers are located between slots 1&2 and slots 3&4. - -![](images/filament-slots.jpg) - -### Bambu Lab AMS Lite RFID reader location (legacy) - -The Bambu Lab AMS Lite RFID readers are located at the base of each spool holder. - -For sniffing, you will need to place the Proxmark in between the RFID tag and the reader on the AMS. As there is not much clearance, it is recommended to temporarily remove the low frequency radio (the topmost piece) if you can, as it will not be used in this process. - -### Proxmark3 placement for sniffing (legacy) - -For sniffing, you will need to place the Proxmark3 against the reader. On the AMS lite, you must place it in between the reader and the spool. On the AMS, it is recommended to place it between the reader and the spool, but you may place it on the other side (for example, load the spool into slot 1 and place the Proxmark3 against the reader in slot 2). - -> [!TIP] -> As there is not much clearance, it may be helpful to disassemble the Proxmark3 Easy and remove the top and middle layers. For this particular process, you will only need the bottom-most layer. - -If you place the Proxmark in between the AMS reader and the spool, make sure that spool rotates so that the RFID tag moves away from the reader, otherwise the AMS will assume that it is reading the tag from its neighboring slot and attempt to rewind it until it cannot see the RFID tag. - -### Key Derivation - -As of 2024-11-19, keys can now be derived from the UID of a tag. - -```python -from Cryptodome.Protocol.KDF import HKDF -from Cryptodome.Hash import SHA256 - -uid = bytes([0x02,0x3b,0x44,0x74]) -master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) - -keys = HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") - -print([a.hex() for a in keys]) -``` - -### Dump RFID Contents (.bin) (legacy) - -1. **Run ProxMark3 Software** - - In a terminal, run `pm3` to start the Proxmark3 Software - -2. **Sniff Communication** - - - Start sniffing with: `hf 14a sniff -c -r`
- (hf=High Frequency, 14a=Tag Type, Sniff=command, -c and -r mean "capture on triggers instead of continuously) - - - Place your Proxmark3 between the tag and the AMS. Recommended: Use tape to hold it in place. - - Load a strand of filament into the AMS. This is what triggers the AMS to attempt to read the RFID tag. - - Press the button on the ProxMark to end capture after the filament has completed loading - -3. **Extract the Keys** - - 1. **Automatic** (recommended) - - 1. Save the trace results to a file with: `trace save -f [FILENAME]` - - 2. Open a new terminal window and run the trace key extractor script in this repository with Python 3: `python3 traceKeyExtractor.py` - - 3. Input the trace results filepath or drag and drop it into the terminal window - - 4. After the keys are extracted, return to the Proxmark3 software - - 5. Remove the spool from the AMS and hold the Proxmark3 against the RFID tag of the spool - - 6. Run `hf mf fchk -f [dictionaryFilepath] --dump` to create a key file - - - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard. - - - Example: - - ``` - [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin - ``` - - 2. **Manual** (not recommended) - - 1. **Create a Key Dictionary** - - - We will discover keys one at a time and save them to a dictionary file. - - Navigate to your Proxmark3 software installation directory. This will be specific to your Operating System and Installation. - - macOS (Intel) Example: `/usr/local/Cellar/proxmark3/4.17768/share/proxmark3/` - - macOS (ARM) Eample: `/opt/homebrew/Cellar/proxmark3/4.17768/share/proxmark3/` - - Windows Example: TBD - - Linux Example: TBD - - Open a text editor and save a blank file called `myDictionary.dic` into the `dictionaries/` folder of your Proxmark3 software installation directory. - - (You can call this file anything you want, but for the rest of this example, we will refer to it as "myDictionary") - - - Leave this file open, we will continue to add keys to it in the next step - - 2. **Extract Keys From Trace** - - - Run `trace list -t mf -f myDictionary` to view the trace that was recorded from sniffing in the previous step. - - This uses the key dictionary `myDictionary.dic` that we created in step 3. - - - Read the output and look for anything that mentions a key. - - Three Possible Formats: - - `key E0B50731BE27 prng WEAK` - Follow Step 5 - - `nested probable key: 50B0318A4FE7` - Follow Step 6 - - `Nested authentication detected.` - Follow Step 7 - - Each of these 3 entries can provide us with a valid key. Follow step 5, 6, or 7 depending on which type of key you encounter. - - 3. **First Key - Plain Text** - - Example: `key E0B50731BE27 prng WEAK` - - This is the first key that was discovered by sniffing AMS traffic. - - Copy/paste this key into the `myDictionary.dic` file that you created in step 3, then save the file. - 4. **Nested Probable Key** - - Example: `nested probable key: 50B0318A4FE7` - - Copy/paste this key into the `myDictionary.dic` file that you created in step 3, then save the file. - 5. **Nested Authentication Key** - - Example: - ``` - Nested authentication detected. - tools/mf_nonce_brute/mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C - ``` - - Open a second terminal window, and change directories into your Proxmark3 software installation directory. This is specific to your OS and PM3 installation. - - macOS/Linux: `cd $(brew --prefix proxmark3)/share/proxmark3/` - - Windows: TBD - - CD into the tools folder `cd tools/` - - Copy the command from ProxMark starting at `mf_nonce_brute`, including all the arguments (random letters/numbers) after it, and run the program from the `tools/` directory. - - Example (macOS/Linux): `./mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` - - Example (Windows): `mf_nonce_brute.exe 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` - - The program will discover a key. Copy/paste this key into your `myDictionary.dic` file, and SAVE IT. - - Example Output: - ``` - Valid Key found [ 202efd3dcdfd ] - ``` - 6. **Check Keys (Optional)** - - - If you want to check how many valid keys you've discovered, you can do this test - - This is optional, and you can choose to wait until you have discovered all of the keys - - **WARNING**: Performing a key check will erase the trace that you recorded during step 2, and will require you to re-sniff data (repeat step 2) - - - If you want to save your trace to avoid re-sniffing, use `trace save -f ` and `trace load -f ` - - - Run `hf mf fchk --1k -f myDictionary` to test your keys - - Example Output (showing 11/16 keys discovered): - ``` - [+] found keys: - - [+] -----+-----+--------------+---+--------------+---- - [+] Sec | Blk | key A |res| key B |res - [+] -----+-----+--------------+---+--------------+---- - [+] 000 | 003 | E0B50731BE27 | 1 | ------------ | 0 - [+] 001 | 007 | 63654DB94D97 | 1 | ------------ | 0 - [+] 002 | 011 | 387C06EFFDC8 | 1 | ------------ | 0 - [+] 003 | 015 | 38963E577E43 | 1 | ------------ | 0 - [+] 004 | 019 | 8A3EA2564692 | 1 | ------------ | 0 - [+] 005 | 023 | 935E0F11857A | 1 | ------------ | 0 - [+] 006 | 027 | EBC8F7D23A06 | 1 | ------------ | 0 - [+] 007 | 031 | DD6128F13D4C | 1 | ------------ | 0 - [+] 008 | 035 | ------------ | 0 | ------------ | 0 - [+] 009 | 039 | 4E470B09521F | 1 | ------------ | 0 - [+] 010 | 043 | 50EB8811A69C | 1 | ------------ | 0 - [+] 011 | 047 | 4BDD25091824 | 1 | ------------ | 0 - [+] 012 | 051 | ------------ | 0 | ------------ | 0 - [+] 013 | 055 | ------------ | 0 | ------------ | 0 - [+] 014 | 059 | ------------ | 0 | ------------ | 0 - [+] 015 | 063 | ------------ | 0 | ------------ | 0 - [+] -----+-----+--------------+---+--------------+---- - [+] ( 0:Failed / 1:Success ) - ``` - - 7. **Find Remaining Keys** - - - Repeat step 4 until all 16 keys are discovered - - Your dictionary may be larger than 16 entries if you accidentally copied a duplicate key or an invalid key. These invalid entries are fine, and you can ignore them - - **Recommended**: When you think you have discovered all 16 keys, perform step 8 to verify that your keys are correct. - - 8. **Convert Dictionary to Key File** - - - Remove the spool from the AMS and hold the Proxmark3 against the RFID tag of the spool - - Run `hf mf fchk --1k -f myDictionary --dump` to create a key file - - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard - - Example: - ``` - [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin - ``` - -4. **Dump RFID Contents** - - - Run `hf mf dump -k [path-to-keyfile]` while the Proxmark3 is on the spool's RFID tag to dump the contents of the tag using the 16 keys we discovered - - There should be no errors - - The output should tell you where your `.bin` file is saved - - Example: - ``` - [+] saved 1024 bytes to binary file /Users/mitch/hf-mf-75066B1D-dump.bin - ``` +To read how to obtain the tag data using the legacy sniffing method, see the [corresponding document](./TagSniffing.md). ## Tag Documentation diff --git a/TagSniffing.md b/TagSniffing.md new file mode 100644 index 0000000..b6e5f65 --- /dev/null +++ b/TagSniffing.md @@ -0,0 +1,197 @@ +# Sniffing the tag data + +> [!NOTE] +> This document describes the legacy method for obtaining Bambu Lab RFID tag data. See the [Readme](./README.md#proxmark3-fm11rf08s-recovery-script) for instructions on the new method. + +To obtain the data from an RFID tag on a Bambu Lab spool, the user used to have to sniff the data transferred between the tag and the AMS reader to obtain the encryption keys used to decrypt the tag data. This document explains how to sniff the data. + +## Proxmark3 placement for sniffing + +For sniffing, you will need to place the Proxmark in between the RFID tag and the reader on the AMS. As there is not much clearance, it is recommended to temporarily remove the low frequency radio (the topmost piece) if you can, as it will not be used in this process. + +Make sure that spool rotates so that the RFID tag moves away from the reader, otherwise the AMS will assume that it is reading the tag from its neighboring slot and attempt to rewind it until it cannot see the RFID tag. + +> [!TIP] +> Proxmark3 Easy users: as there is not much clearance, it may be helpful to disassemble the Proxmark3 Easy and remove the top and middle layers. For this particular process, you will only need the bottom-most layer. + +### Bambu Lab AMS RFID Reader Location (for X1/P1 series) + +The Bambu Lab AMS RFID readers are located between slots 1&2 and slots 3&4. + +![](images/filament-slots.jpg) + +It is recommended to place your Proxmark3 device between the reader and the spool, but you may place it on the other side (for example, load the spool into slot 1 and place the Proxmark3 against the reader in slot 2). + +### Bambu Lab AMS Lite RFID Reader Location (for A1 series) + +The Bambu Lab AMS Lite RFID readers are located at the base of each spool holder. + +You must place your Proxmark3 device between the reader and the spool. + +## Key Derivation + +As of 2024-11-19, keys can now be derived from the UID of a tag. + +```python +from Cryptodome.Protocol.KDF import HKDF +from Cryptodome.Hash import SHA256 + +uid = bytes([0x02,0x3b,0x44,0x74]) +master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) + +keys = HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") + +print([a.hex() for a in keys]) +``` + +## Dump RFID Contents (.bin) + +1. **Run ProxMark3 Software** + + In a terminal, run `pm3` to start the Proxmark3 Software + +2. **Sniff Communication** + + - Start sniffing with: `hf 14a sniff -c -r`
+ (hf=High Frequency, 14a=Tag Type, Sniff=command, -c and -r mean "capture on triggers instead of continuously) + + - Place your Proxmark3 between the tag and the AMS. Recommended: Use tape to hold it in place. + - Load a strand of filament into the AMS. This is what triggers the AMS to attempt to read the RFID tag. + - Press the button on the ProxMark to end capture after the filament has completed loading + +3. **Extract the Keys** + + 1. **Automatic** (recommended) + + 1. Save the trace results to a file with: `trace save -f [FILENAME]` + + 2. Open a new terminal window and run the trace key extractor script in this repository with Python 3: `python3 traceKeyExtractor.py` + + 3. Input the trace results filepath or drag and drop it into the terminal window + + 4. After the keys are extracted, return to the Proxmark3 software + + 5. Remove the spool from the AMS and hold the Proxmark3 against the RFID tag of the spool + + 6. Run `hf mf fchk -f [dictionaryFilepath] --dump` to create a key file + + - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard. + + - Example: + + ``` + [+] Found keys have been dumped to /Users/mitch/hf-mf-75066B1D-key.bin + ``` + + 2. **Manual** (not recommended) + + 1. **Create a Key Dictionary** + + - We will discover keys one at a time and save them to a dictionary file. + - Navigate to your Proxmark3 software installation directory. This will be specific to your Operating System and Installation. + - macOS (via Homebrew) Example: `cd $(brew --prefix proxmark3)/share/proxmark3/` + - Linux Eample: `/usr/local/proxmark3/4.17768/share/proxmark3/` + - Windows Example: TBD + - Open a text editor and save a blank file called `myDictionary.dic` into the `dictionaries/` folder of your Proxmark3 software installation directory. + + (You can call this file anything you want, but for the rest of this example, we will refer to it as "myDictionary") + + - Leave this file open, we will continue to add keys to it in the next step + + 2. **Extract Keys From Trace** + + - Run `trace list -t mf -f myDictionary` to view the trace that was recorded from sniffing in the previous step. + + This uses the key dictionary `myDictionary.dic` that we created in step 3. + + - Read the output and look for anything that mentions a key. + - Three Possible Formats: + - `key E0B50731BE27 prng WEAK` - Follow Step 5 + - `nested probable key: 50B0318A4FE7` - Follow Step 6 + - `Nested authentication detected.` - Follow Step 7 + - Each of these 3 entries can provide us with a valid key. Follow step 5, 6, or 7 depending on which type of key you encounter. + + 3. **First Key - Plain Text** + - Example: `key E0B50731BE27 prng WEAK` + - This is the first key that was discovered by sniffing AMS traffic. + - Copy/paste this key into the `myDictionary.dic` file that you created in step 3, then save the file. + 4. **Nested Probable Key** + - Example: `nested probable key: 50B0318A4FE7` + - Copy/paste this key into the `myDictionary.dic` file that you created in step 3, then save the file. + 5. **Nested Authentication Key** + - Example: + ``` + Nested authentication detected. + tools/mf_nonce_brute/mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C + ``` + - Open a second terminal window, ensuring you are still in the Proxmark3 installation directory. + - CD into the tools folder `cd tools/` + - Copy the command from ProxMark starting at `mf_nonce_brute`, including all the arguments (random letters/numbers) after it, and run the program from the `tools/` directory. + - Example (macOS/Linux): `./mf_nonce_brute 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` + - Example (Windows): `mf_nonce_brute.exe 75066b1d 4db2f2ac 0101 70fcdd3d 328eb1e6 1101 28b75cfd 0010 5196401C` + - The program will discover a key. Copy/paste this key into your `myDictionary.dic` file, and SAVE IT. + - Example Output: + ``` + Valid Key found [ 202efd3dcdfd ] + ``` + 6. **Check Keys (Optional)** + + - If you want to check how many valid keys you've discovered, you can do this test + - This is optional, and you can choose to wait until you have discovered all of the keys + - **WARNING**: Performing a key check will erase the trace that you recorded during step 2, and will require you to re-sniff data (repeat step 2) + + - If you want to save your trace to avoid re-sniffing, use `trace save -f ` and `trace load -f ` + + - Run `hf mf fchk --1k -f myDictionary` to test your keys + - Example Output (showing 11/16 keys discovered): + ``` + [+] found keys: + + [+] -----+-----+--------------+---+--------------+---- + [+] Sec | Blk | key A |res| key B |res + [+] -----+-----+--------------+---+--------------+---- + [+] 000 | 003 | E0B50731BE27 | 1 | ------------ | 0 + [+] 001 | 007 | 63654DB94D97 | 1 | ------------ | 0 + [+] 002 | 011 | 387C06EFFDC8 | 1 | ------------ | 0 + [+] 003 | 015 | 38963E577E43 | 1 | ------------ | 0 + [+] 004 | 019 | 8A3EA2564692 | 1 | ------------ | 0 + [+] 005 | 023 | 935E0F11857A | 1 | ------------ | 0 + [+] 006 | 027 | EBC8F7D23A06 | 1 | ------------ | 0 + [+] 007 | 031 | DD6128F13D4C | 1 | ------------ | 0 + [+] 008 | 035 | ------------ | 0 | ------------ | 0 + [+] 009 | 039 | 4E470B09521F | 1 | ------------ | 0 + [+] 010 | 043 | 50EB8811A69C | 1 | ------------ | 0 + [+] 011 | 047 | 4BDD25091824 | 1 | ------------ | 0 + [+] 012 | 051 | ------------ | 0 | ------------ | 0 + [+] 013 | 055 | ------------ | 0 | ------------ | 0 + [+] 014 | 059 | ------------ | 0 | ------------ | 0 + [+] 015 | 063 | ------------ | 0 | ------------ | 0 + [+] -----+-----+--------------+---+--------------+---- + [+] ( 0:Failed / 1:Success ) + ``` + + 7. **Find Remaining Keys** + + - Repeat step 4 until all 16 keys are discovered + - Your dictionary may be larger than 16 entries if you accidentally copied a duplicate key or an invalid key. These invalid entries are fine, and you can ignore them + - **Recommended**: When you think you have discovered all 16 keys, perform step 8 to verify that your keys are correct. + + 8. **Convert Dictionary to Key File** + + - Remove the spool from the AMS and hold the Proxmark3 against the RFID tag of the spool + - Run `hf mf fchk --1k -f myDictionary --dump` to create a key file + - The program will report the destination of the key file that it saved. Copy this filepath to your clipboard + - Example: + ``` + [+] Found keys have been dumped to /current/directory/hf-mf-75066B1D-key.bin + ``` + +4. **Dump RFID Contents** + + - Run `hf mf dump -k [path-to-keyfile]` while the Proxmark3 is on the spool's RFID tag to dump the contents of the tag using the 16 keys we discovered + - There should be no errors + - The output should tell you where your `.bin` file is saved + - Example: + ``` + [+] saved 1024 bytes to binary file /current/directory/hf-mf-75066B1D-dump.bin + ``` From 71c2eac1640083225a75b91537b816342a5d313f Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 04:59:47 -0800 Subject: [PATCH 11/36] Simplify RFID board reverse-engineering section --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 60ff39f..7e28bfc 100644 --- a/README.md +++ b/README.md @@ -390,9 +390,6 @@ FUID --> **Works** "Fused UID" aka "write-once UID". Once a UID is written, it c ## Reverse engineering RFID Board -For ease of debugging and lowering the cost of failures the RFID board is reverse engineered. You can find complete production ready gerber files and bill of materials in rfid-board folder - -As a nice to benefit to have is that you can manufacture boards in different colors. -![](rfid-board/Photo_PCB_BBL-RFID.jpg) +For ease of debugging and lowering the cost of failures, the RFID board is reverse-engineered. You can find complete production-ready gerber files and a bill of materials in [rfid-board](./rfid-board) folder. [^rfid-backdoor]: https://eprint.iacr.org/2024/1275.pdf From 737b82057a02120728866195b5d5d29abc1ec9d5 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 05:04:12 -0800 Subject: [PATCH 12/36] Update "How to contribute" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e28bfc..4cced4d 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,8 @@ Here's a high-level summary of how everything works: ### How to contribute -If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your tags and submit them for review. -The more data we have, the easier it is to compare differences to learn what each byte represents. A lot of the contents have been deciphered (see [Tag stucture](#tag-stucture)), but there is still more unknown data still left. +If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your tags and submit them via [Discord](https://discord.gg/zVfCVubwr7). +A lot of the contents have been deciphered (see [Tag stucture](#tag-stucture)), 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 From b6a20d6906291a554e4793cb7dca5de80d09c101 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 05:04:28 -0800 Subject: [PATCH 13/36] An AMS is no longer required equipment --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 4cced4d..065b71c 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,6 @@ A lot of the contents have been deciphered (see [Tag stucture](#tag-stucture)), ## Required Equipment -- Bambu Lab 3D Printer with AMS or AMS Lite - Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) From 668d765d91a9247dea54fe7361e047009c7488ed Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 05:10:49 -0800 Subject: [PATCH 14/36] Move details of Bambu Lab RFID tag blocks to its own document --- BambuLabRfid.md | 226 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 235 ++---------------------------------------------- 2 files changed, 233 insertions(+), 228 deletions(-) create mode 100644 BambuLabRfid.md diff --git a/BambuLabRfid.md b/BambuLabRfid.md new file mode 100644 index 0000000..ce1dd63 --- /dev/null +++ b/BambuLabRfid.md @@ -0,0 +1,226 @@ +# Bambu Lab RFID Tag Documentation + +This contains documentation for the known and unknown data that is contained in each block on the RFID tags for Bambu Lab spools. + +## Block Overview + +Summary of what kind of data is stored in each block. Detailed info for each block is documented below. +| sec | blk | Data | +|-----|-----|----------------------------------------------------------------------------------------| +| 0 | 0 | [Block 0](#block-0) UID and Tag Manufacturer Data | +| 0 | 1 | [Block 1](#block-1) Tray Info Index | +| 0 | 2 | [Block 2](#block-2) Filament Type | +| 0 | 3 | [Block 3](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 1 | 0 | [Block 4](#block-4) Detailed Filament Type | +| 1 | 1 | [Block 5](#block-5) Spool Weight, Color Code, Filament Diameter | +| 1 | 2 | [Block 6](#block-6) Temperatures and Drying Info | +| 1 | 3 | [Block 7](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 2 | 0 | [Block 8](#block-8) X Cam Info, Nozzle Diameter | +| 2 | 1 | [Block 9](#block-9) Tray UID | +| 2 | 2 | [Block 10](#block-10) Spool Width | +| 2 | 3 | [Block 11](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 3 | 0 | [Block 12](#block-12) Production Date/Time | +| 3 | 1 | [Block 13](#block-13) Short Production Date/Time | +| 3 | 2 | [Block 14](#block-14) Filament Length | +| 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 4 | 0 | [Block 16](#block-16) Extra Color Info | +| 4 | 1 | [Block 17](#block-17) **Unknown** | +| 4 | 2 | **Empty** | +| 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 5 | 0 | **Empty** | +| 5 | 1 | **Empty** | +| 5 | 2 | **Empty** | +| 5 | 3 | [Block 23](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 6 | 0 | **Empty** | +| 6 | 1 | **Empty** | +| 6 | 2 | **Empty** | +| 6 | 3 | [Block 27](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 7 | 0 | **Empty** | +| 7 | 1 | **Empty** | +| 7 | 2 | **Empty** | +| 7 | 3 | [Block 31](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 8 | 0 | **Empty** | +| 8 | 1 | **Empty** | +| 8 | 2 | **Empty** | +| 8 | 3 | [Block 35](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 9 | 0 | **Empty** | +| 9 | 1 | **Empty** | +| 9 | 2 | **Empty** | +| 9 | 3 | [Block 39](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | +| 10-15 | \* | **RSA-2048 Signature** | + +The first part of the filament serial number seems to be the Tag UID. + +> [!NOTE] +> All numbers are encoded as Little Endian (LE). + +## MIFARE Encryption Keys + +Every 4th block (eg Sector X, Block 3) contains encryption keys that are part of the MIFARE RFID standard. +This has nothing to do with Bambu Lab's memory format. +All Bambu Lab tags use the same Permission Bits (Access Control) + +Example Data: +`AA AA AA AA AA AA PP PP PP PP BB BB BB BB BB BB` + +| position | length | type | Description | +| -------- | ------ | ------- | ------------------------------------------------------------------------------ | +| 0 (AA) | 6 | RAW Bin | A-Key | +| 6 (PP) | 4 | RAW Bin | Permission Bits (Access Control)
ALWAYS `87 87 87 69` (hex) for Bambu Tags | +| 10 (BB) | 6 | RAW Bin | B-Key (always `00 00 00 00 00 00` for Bambu tags) | + +## Block 0 + +Note: Block 0 is Read-only. The contents are set by the tag manufacturer. + +Example Data: +`AA AA AA AA BB BB BB BB BB BB BB BB BB BB BB BB` + +| position | length | type | Description | +| -------- | ------ | ------- | --------------------- | +| 0 (AA) | 4 | string | Tag UID | +| 4 (BB) | 12 | RAW Bin | Tag Manufacturer Data | + +## Block 1 + +Example Data: +`AA AA AA AA AA AA AA AA BB BB BB BB BB BB BB BB` + +| position | length | type | Description | +| -------- | ------ | ------ | --------------------------------------------- | +| 0 (AA) | 8 | string | Tray Info Index - Material Variant Identifier | +| 8 (BB) | 16 | string | Tray Info Index - Unique Material Identifier | + +## Block 2 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` + +| position | length | type | Description | +| -------- | ------ | ------ | ------------- | +| 0 (AA) | 16 | string | Filament Type | + +## Block 4 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` + +| position | length | type | description | +| -------- | ------ | ------ | ---------------------- | +| 0 (AA) | 16 | string | Detailed Filament Type | + +Known Values: + +- PLA Basic +- PLA Matte +- PLA Silk +- PLA Galaxy +- PLA Sparkle +- Support for PLA (prev. Support W) +- PLA-CF (prev. PLA Tough) +- PETG Basic + +## Block 5 + +Example Data: +`AA AA AA AA BB BB __ __ CC CC CC CC __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | ------------------------------------------ | +| 0 (AA) | 4 | RGBA | Color in hex RGBA | +| 4 (BB) | 2 | uint16 (LE) | Spool Weight in grams (`E8 03` --> 1000 g) | +| 8 (CC) | 8 | float (LE) | Filament Diameter in milimeters | + +## Block 6 + +Example Data: +`AA AA BB BB CC CC DD DD EE EE FF FF __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | --------------------------------------- | +| 0 (AA) | 2 | uint16 (LE) | Drying Temperature in °C | +| 2 (BB) | 2 | uint16 (LE) | Drying time in hours | +| 4 (CC) | 2 | uint16 (LE) | Bed Temerature Type **(types unknown)** | +| 6 (DD) | 2 | uint16 (LE) | Bed Temperature in °C | +| 8 (EE) | 2 | uint16 (LE) | Max Temperature for Hotend in °C | +| 10 (FF) | 2 | uint16 (LE) | Min Temperature for Hotend in °C | + +## Block 8 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA BB BB BB BB` + +| position | length | type | description | +| -------- | ------ | ---------- | ----------------------- | +| 0 (AA) | 12 | RAW Bin | X Cam info | +| 12 (BB) | 4 | float (LE) | **Nozzle Diameter...?** | + +## Block 9 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` + +| position | length | type | Description | +| -------- | ------ | ------ | ----------- | +| 0 (AA) | 16 | string | Tray UID | + +## Block 10 + +Example Data: +`__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | --------------------------------------------------- | +| 4 (AA) | 2 | uint16 (LE) | Spool Width in µm (`E1 19` --> 6625µm --> 66.25mm ) | + +## Block 12 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` + +| position | length | type | Description | +| -------- | ------ | ------ | -------------------------------------------------------------------------- | +| 0 (AA) | 16 | string | Production Date and Time in ASCII (`____`) | + +## Block 13 + +Example Data: +`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` + +| position | length | type | Description | +| -------- | ------ | ------ | ---------------------------------- | +| 0 (AA) | 16 | string | **Short Production Date/Time...?** | + +## Block 14 + +Example Data: +`__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | --------------------------------- | +| 4 (AA) | 2 | uint16 (LE) | **Filament length in meters...?** | + +## Block 16 + +Example Data: +`AA AA BB BB CC CC CC CC __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | ---------------------------------- | +| 0 (AA) | 2 | uint16 (LE) | Format Identifier | +| 2 (BB) | 2 | uint16 (LE) | Color Count | +| 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | + +Known Format Identifiers: + +- 00 00 = Empty +- 02 00 = Color Info + +## Block 17 + +Example Data: +`AA AA __ __ __ __ __ __ __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | ----------- | +| 0 (AA) | 2 | **Unknown** | **Unknown** | diff --git a/README.md b/README.md index 065b71c..6bcfedb 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ Here's a high-level summary of how everything works: - Bambu Lab printers use MiFare 13.56MHZ RFID tags - These tags contain a unique ID that is not encrypted (called the UID) - - In most cases UID is fixed (not-changable). Some "hackable" rfid tags allow you to set the UID to anything you want + - In most cases UID is fixed (not-changable). Some "hackable" RFID tags allow you to set the UID to anything you want - Blocks (Encrypted) - - MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. See [Tag stucture](#tag-stucture) section for details + - MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. - The blocks are encrypted, meaning that you need to have a KEY to decipher them - Each block is encrypted with a different key - Encryption Keys @@ -95,8 +95,8 @@ Here's a high-level summary of how everything works: ### How to contribute -If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your tags and submit them via [Discord](https://discord.gg/zVfCVubwr7). -A lot of the contents have been deciphered (see [Tag stucture](#tag-stucture)), but the more data we have, the easier it is to compare differences to learn what each byte represents and double-check our answers. +If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your Bambu Lab RFID tags and submit them via [Discord](https://discord.gg/zVfCVubwr7). +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 @@ -140,234 +140,13 @@ To visualize the data on the tag, run the following: ### Sniffing the tag data (legacy method) -To read how to obtain the tag data using the legacy sniffing method, see the [corresponding document](./TagSniffing.md). +To read how to obtain the tag data using the legacy sniffing method, see the [TagSniffing.md](./TagSniffing.md). ## Tag Documentation -This contains documentation for the known and unknown data that is contained in each block on the RFID tag. +For a description of the blocks of a Bambu Lab RFID tag, see [BambuLabRfid.md](./BambuLabRfid.md). -### Block Overview - -Summary of what kind of data is stored in each block. Detailed info for each block is documented below. -| sec | blk | Data | -|-----|-----|----------------------------------------------------------------------------------------| -| 0 | 0 | [Block 0](#block-0) UID and Tag Manufacturer Data | -| 0 | 1 | [Block 1](#block-1) Tray Info Index | -| 0 | 2 | [Block 2](#block-2) Filament Type | -| 0 | 3 | [Block 3](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 1 | 0 | [Block 4](#block-4) Detailed Filament Type | -| 1 | 1 | [Block 5](#block-5) Spool Weight, Color Code, Filament Diameter | -| 1 | 2 | [Block 6](#block-6) Temperatures and Drying Info | -| 1 | 3 | [Block 7](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 2 | 0 | [Block 8](#block-8) X Cam Info, Nozzle Diameter | -| 2 | 1 | [Block 9](#block-9) Tray UID | -| 2 | 2 | [Block 10](#block-10) Spool Width | -| 2 | 3 | [Block 11](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 3 | 0 | [Block 12](#block-12) Production Date/Time | -| 3 | 1 | [Block 13](#block-13) Short Production Date/Time | -| 3 | 2 | [Block 14](#block-14) Filament Length | -| 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 4 | 0 | [Block 16](#block-16) Extra Color Info | -| 4 | 1 | [Block 17](#block-17) **Unknown** | -| 4 | 2 | **Empty** | -| 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 5 | 0 | **Empty** | -| 5 | 1 | **Empty** | -| 5 | 2 | **Empty** | -| 5 | 3 | [Block 23](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 6 | 0 | **Empty** | -| 6 | 1 | **Empty** | -| 6 | 2 | **Empty** | -| 6 | 3 | [Block 27](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 7 | 0 | **Empty** | -| 7 | 1 | **Empty** | -| 7 | 2 | **Empty** | -| 7 | 3 | [Block 31](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 8 | 0 | **Empty** | -| 8 | 1 | **Empty** | -| 8 | 2 | **Empty** | -| 8 | 3 | [Block 35](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 9 | 0 | **Empty** | -| 9 | 1 | **Empty** | -| 9 | 2 | **Empty** | -| 9 | 3 | [Block 39](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to Bambu Lab | -| 10-15 | \* | **RSA-2048 Signature** | - -The first part of the filament serial number seems to be the Tag UID. - -> [!NOTE] -> All numbers are encoded as Little Endian (LE). - -### MIFARE Encryption Keys - -Every 4th block (eg Sector X, Block 3) contains encryption keys that are part of the MIFARE RFID standard. -This has nothing to do with Bambu Lab's memory format. -All Bambu Lab tags use the same Permission Bits (Access Control) - -Example Data: -`AA AA AA AA AA AA PP PP PP PP BB BB BB BB BB BB` - -| position | length | type | Description | -| -------- | ------ | ------- | ------------------------------------------------------------------------------ | -| 0 (AA) | 6 | RAW Bin | A-Key | -| 6 (PP) | 4 | RAW Bin | Permission Bits (Access Control)
ALWAYS `87 87 87 69` (hex) for Bambu Tags | -| 10 (BB) | 6 | RAW Bin | B-Key (always `00 00 00 00 00 00` for Bambu tags) | - -### Block 0 - -Note: Block 0 is Read-only. The contents are set by the tag manufacturer. - -Example Data: -`AA AA AA AA BB BB BB BB BB BB BB BB BB BB BB BB` - -| position | length | type | Description | -| -------- | ------ | ------- | --------------------- | -| 0 (AA) | 4 | string | Tag UID | -| 4 (BB) | 12 | RAW Bin | Tag Manufacturer Data | - -### Block 1 - -Example Data: -`AA AA AA AA AA AA AA AA BB BB BB BB BB BB BB BB` - -| position | length | type | Description | -| -------- | ------ | ------ | --------------------------------------------- | -| 0 (AA) | 8 | string | Tray Info Index - Material Variant Identifier | -| 8 (BB) | 16 | string | Tray Info Index - Unique Material Identifier | - -### Block 2 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` - -| position | length | type | Description | -| -------- | ------ | ------ | ------------- | -| 0 (AA) | 16 | string | Filament Type | - -### Block 4 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` - -| position | length | type | description | -| -------- | ------ | ------ | ---------------------- | -| 0 (AA) | 16 | string | Detailed Filament Type | - -Known Values: - -- PLA Basic -- PLA Matte -- PLA Silk -- PLA Galaxy -- PLA Sparkle -- Support for PLA (prev. Support W) -- PLA-CF (prev. PLA Tough) -- PETG Basic - -### Block 5 - -Example Data: -`AA AA AA AA BB BB __ __ CC CC CC CC __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | ------------------------------------------ | -| 0 (AA) | 4 | RGBA | Color in hex RGBA | -| 4 (BB) | 2 | uint16 (LE) | Spool Weight in grams (`E8 03` --> 1000 g) | -| 8 (CC) | 8 | float (LE) | Filament Diameter in milimeters | - -### Block 6 - -Example Data: -`AA AA BB BB CC CC DD DD EE EE FF FF __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | --------------------------------------- | -| 0 (AA) | 2 | uint16 (LE) | Drying Temperature in °C | -| 2 (BB) | 2 | uint16 (LE) | Drying time in hours | -| 4 (CC) | 2 | uint16 (LE) | Bed Temerature Type **(types unknown)** | -| 6 (DD) | 2 | uint16 (LE) | Bed Temperature in °C | -| 8 (EE) | 2 | uint16 (LE) | Max Temperature for Hotend in °C | -| 10 (FF) | 2 | uint16 (LE) | Min Temperature for Hotend in °C | - -### Block 8 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA BB BB BB BB` - -| position | length | type | description | -| -------- | ------ | ---------- | ----------------------- | -| 0 (AA) | 12 | RAW Bin | X Cam info | -| 12 (BB) | 4 | float (LE) | **Nozzle Diameter...?** | - -### Block 9 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` - -| position | length | type | Description | -| -------- | ------ | ------ | ----------- | -| 0 (AA) | 16 | string | Tray UID | - -### Block 10 - -Example Data: -`__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | --------------------------------------------------- | -| 4 (AA) | 2 | uint16 (LE) | Spool Width in µm (`E1 19` --> 6625µm --> 66.25mm ) | - -### Block 12 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` - -| position | length | type | Description | -| -------- | ------ | ------ | -------------------------------------------------------------------------- | -| 0 (AA) | 16 | string | Production Date and Time in ASCII (`____`) | - -### Block 13 - -Example Data: -`AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA` - -| position | length | type | Description | -| -------- | ------ | ------ | ---------------------------------- | -| 0 (AA) | 16 | string | **Short Production Date/Time...?** | - -### Block 14 - -Example Data: -`__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | --------------------------------- | -| 4 (AA) | 2 | uint16 (LE) | **Filament length in meters...?** | - -### Block 16 - -Example Data: -`AA AA BB BB CC CC CC CC __ __ __ __ __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | ---------------------------------- | -| 0 (AA) | 2 | uint16 (LE) | Format Identifier | -| 2 (BB) | 2 | uint16 (LE) | Color Count | -| 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | - -Known Format Identifiers: - -- 00 00 = Empty -- 02 00 = Color Info - -### Block 17 - -Example Data: -`AA AA __ __ __ __ __ __ __ __ __ __ __ __ __ __` - -| position | length | type | Description | -| -------- | ------ | ----------- | ----------- | -| 0 (AA) | 2 | **Unknown** | **Unknown** | +For a description of an open-source standard proposal, see [OpenSourceRfid.md](./OpenSourceRfid.md). ## Compatible RFID tags - By generation From 4ed4efbc1414ab2660e5602d36434824c59d05db Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 05:12:27 -0800 Subject: [PATCH 15/36] Update table of contents --- README.md | 49 ++++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 6bcfedb..db00239 100644 --- a/README.md +++ b/README.md @@ -9,41 +9,20 @@ We are currently working on a way to submit the tag data in a secure way so anal # Table of contents - -- [Project Summary](#project-summary) - - [FAQs](#faqs) - - [How do RFID tags work?](#how-do-rfid-tags-work) - - [How to contribute](#how-to-contribute) -- [Todos/Timeline/Next steps](#todostimelinenext-steps) -- [Required Equipment](#required-equipment) - - [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) - - [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) - - [Bambu Lab AMS RFID reader location](#bambu-lab-ams-rfid-reader-location) - - [Bambu Lab AMS Lite RFID reader location (legacy)](#bambu-lab-ams-lite-rfid-reader-location-legacy) - - [Proxmark3 placement for sniffing (legacy)](#proxmark3-placement-for-sniffing-legacy) - - [Key Derivation](#key-derivation) - - [Dump RFID Contents (.bin) (legacy)](#dump-rfid-contents-bin-legacy) -- [Tag Documentation](#tag-documentation) - - [Block Overview](#block-overview) - - [MIFARE Encryption Keys](#mifare-encryption-keys) - - [Block 0](#block-0) - - [Block 1](#block-1) - - [Block 2](#block-2) - - [Block 4](#block-4) - - [Block 5](#block-5) - - [Block 6](#block-6) - - [Block 8](#block-8) - - [Block 9](#block-9) - - [Block 10](#block-10) - - [Block 12](#block-12) - - [Block 13](#block-13) - - [Block 14](#block-14) - - [Block 16](#block-16) - - [Block 17](#block-17) -- [Compatible RFID tags - By generation](#compatible-rfid-tags----by-generation) -- [Reverse engineering RFID Board](#reverse-engineering-rfid-board) + * [Project Summary](#project-summary) + * [FAQs](#faqs) + * [How do RFID tags work?](#how-do-rfid-tags-work) + * [How to contribute](#how-to-contribute) + * [Todos/Timeline/Next steps](#todostimelinenext-steps) + * [Required Equipment](#required-equipment) + * [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) + * [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) + * [Sniffing the tag data (legacy method)](#sniffing-the-tag-data-legacy-method) + * [Tag Documentation](#tag-documentation) + * [Compatible RFID tags - By generation](#compatible-rfid-tags---by-generation) + * [Reverse engineering RFID Board](#reverse-engineering-rfid-board) ## Project Summary From 36d56cffe257ef795abfa6794e9a6501bf23fae3 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 1 Dec 2024 05:21:01 -0800 Subject: [PATCH 16/36] Rearrange sections for better flow --- README.md | 68 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index db00239..5c59987 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,8 @@ We are currently working on a way to submit the tag data in a secure way so anal * [Project Summary](#project-summary) * [FAQs](#faqs) - * [How do RFID tags work?](#how-do-rfid-tags-work) * [How to contribute](#how-to-contribute) - * [Todos/Timeline/Next steps](#todostimelinenext-steps) + * [Todos/Timeline/Next steps](#todostimelinenext-steps) * [Required Equipment](#required-equipment) * [Proxmark3 compatible readers](#proxmark3-compatible-readers) * [Proxmark3 Easy](#proxmark3-easy) @@ -21,6 +20,7 @@ We are currently working on a way to submit the tag data in a secure way so anal * [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) * [Sniffing the tag data (legacy method)](#sniffing-the-tag-data-legacy-method) * [Tag Documentation](#tag-documentation) + * [How do RFID tags work?](#how-do-rfid-tags-work) * [Compatible RFID tags - By generation](#compatible-rfid-tags---by-generation) * [Reverse engineering RFID Board](#reverse-engineering-rfid-board) @@ -41,43 +41,12 @@ This is a research group dedicated to documenting the data structures used by Ba - Custom AMS firmware that allows custom tags to be read while ignoring the signature - See [Todos/Timeline/Next steps](#todostimelinenext-steps) for more info -### How do RFID tags work? - -Here's a high-level summary of how everything works: - -- Bambu Lab printers use MiFare 13.56MHZ RFID tags - - These tags contain a unique ID that is not encrypted (called the UID) - - In most cases UID is fixed (not-changable). Some "hackable" RFID tags allow you to set the UID to anything you want -- Blocks (Encrypted) - - MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. - - The blocks are encrypted, meaning that you need to have a KEY to decipher them - - Each block is encrypted with a different key -- Encryption Keys - - Keys are unique to each RFID tag. Even if you discover the key for one tag, that doesn't mean you can use that same key to unlock a different tag. - - As of 11/19/24, keys can be derived from the UID. After reading the UID from the tag, the KDF (key derivation function) can be used to derive the 16 keys. - - (Outdated, sniffing is no longer required now that the KDF is known) Keys can be sniffed by using a device (such as a ProxMark 3) to listen in on the communication between the AMS and the rfid tag. - - Once the keys have been sniffed, they can be saved and used to read the contents of the tag directly (without an AMS). (Reminder, the saved keys will ONLY work for the tag they were sniffed from) -- RSA Signature - - One of the blocks contains a 2048-bit RSA Signature - - RSA signatures are a way to digitally sign / certify authenticity of content, and they are effectively un-breakable (this is how things like cryptocurrency remain secure) - - RSA signatures encompass all of the data of the RFID tag. Changing a single byte somewhere else in the tag would require a completely different signature to be considered genuine - - Bambu printers check the content of the tag and then check if the signature is valid. If the signature is invalid, it rejects the tag -- Cloning Tags - - Even though there is a signature, a tag can be cloned - - To clone a tag, it must have the same UID, identical content from the data blocks, and the identical RSA signature - - Changing even one byte will cause the signature to be invalid, and the tag will be rejected -- Custom Tags - - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. - - To create a custom key, you need to know the following info: - - 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 - ### How to contribute If you have a Proxmark3 (or other RFID debugging tool), you can sniff and decrypt the contents of your Bambu Lab RFID tags and submit them via [Discord](https://discord.gg/zVfCVubwr7). 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 +### Todos/Timeline/Next steps - [ ] Tool for automatic trace analysis - [ ] Web service for tag submisson with automatic anonymized data publishing to GitHub @@ -127,6 +96,37 @@ For a description of the blocks of a Bambu Lab RFID tag, see [BambuLabRfid.md](. For a description of an open-source standard proposal, see [OpenSourceRfid.md](./OpenSourceRfid.md). +## How do RFID tags work? + +Here's a high-level summary of how everything works: + +- Bambu Lab printers use MiFare 13.56MHZ RFID tags + - These tags contain a unique ID that is not encrypted (called the UID) + - In most cases UID is fixed (not-changable). Some "hackable" RFID tags allow you to set the UID to anything you want +- Blocks (Encrypted) + - MiFare tags also contain "Blocks" of data. Each block contains info about the spool, such as Material, Color, Manufacturing Date, etc. + - The blocks are encrypted, meaning that you need to have a KEY to decipher them + - Each block is encrypted with a different key +- Encryption Keys + - Keys are unique to each RFID tag. Even if you discover the key for one tag, that doesn't mean you can use that same key to unlock a different tag. + - As of 11/19/24, keys can be derived from the UID. After reading the UID from the tag, the KDF (key derivation function) can be used to derive the 16 keys. + - (Outdated, sniffing is no longer required now that the KDF is known) Keys can be sniffed by using a device (such as a ProxMark 3) to listen in on the communication between the AMS and the rfid tag. + - Once the keys have been sniffed, they can be saved and used to read the contents of the tag directly (without an AMS). (Reminder, the saved keys will ONLY work for the tag they were sniffed from) +- RSA Signature + - One of the blocks contains a 2048-bit RSA Signature + - RSA signatures are a way to digitally sign / certify authenticity of content, and they are effectively un-breakable (this is how things like cryptocurrency remain secure) + - RSA signatures encompass all of the data of the RFID tag. Changing a single byte somewhere else in the tag would require a completely different signature to be considered genuine + - Bambu printers check the content of the tag and then check if the signature is valid. If the signature is invalid, it rejects the tag +- Cloning Tags + - Even though there is a signature, a tag can be cloned + - To clone a tag, it must have the same UID, identical content from the data blocks, and the identical RSA signature + - Changing even one byte will cause the signature to be invalid, and the tag will be rejected +- Custom Tags + - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. + - To create a custom key, you need to know the following info: + - 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 There are tags known as "Magic Tags" which allow functionality that's not part of the classic MIFARE spec. From 0becd1c776162b6c0aa54b6c68e4664181dc7cae Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 11:03:13 -0800 Subject: [PATCH 17/36] Mention that pm3 "Backdoor" or higher is required --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5c59987..d58a3bc 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ A lot of the contents have been deciphered, but the more data we have, the easie - A Proxmark3-compatible RFID reader - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) - Make sure you are using the Iceman fork as the original version of the software is unmaintained; all instructions are written for the Iceman fork and will not work on the original version + - Requires v4.18994 (codename "Backdoor") or higher ### Proxmark3 compatible readers From be75ccf8c744b7b3da31a057c39673c8d942dd8a Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 11:11:05 -0800 Subject: [PATCH 18/36] Update clarification on which pm3 version to use --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d58a3bc..085207d 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ A lot of the contents have been deciphered, but the more data we have, the easie - Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) - - Make sure you are using the Iceman fork as the original version of the software is unmaintained; all instructions are written for the Iceman fork and will not work on the original version - Requires v4.18994 (codename "Backdoor") or higher + - You MUST use the Iceman fork as the original version of the software is unmaintained; all instructions and scripts are written for the Iceman fork and will not work on the original version ### Proxmark3 compatible readers From 385899320ac83e18b7c59e2905ce66e1cd462692 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 11:33:06 -0800 Subject: [PATCH 19/36] Mention exact amount of time needed to complete backdoor script --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 085207d..4423afe 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Place your reader on the tag, start proxmark3 (run `pm3`) and run the following `script run fm11rf08s_recovery` -This script takes a bit of time, but once it is complete, you will receive a binary key file and a dump. +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: From 005786d4b274980a7fb57c968ba6c2801db336b1 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Wed, 4 Dec 2024 11:33:14 -0800 Subject: [PATCH 20/36] Add a small description about sniffing --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4423afe..6010bcf 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,8 @@ To visualize the data on the tag, run the following: ### Sniffing the tag data (legacy method) +Before the above script was created, tag data had to be obtained by sniffing the data between the RFID tag and the AMS. + To read how to obtain the tag data using the legacy sniffing method, see the [TagSniffing.md](./TagSniffing.md). ## Tag Documentation From 6854b3e878fcdc2b8716cba80bdf7c67bd46fa38 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 5 Dec 2024 21:18:44 -0800 Subject: [PATCH 21/36] Block 19 isn't in nanometers, just multiplied by 100 --- BambuLabRfid.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index ce1dd63..857317f 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -169,9 +169,9 @@ Example Data: Example Data: `__ __ __ __ AA AA __ __ __ __ __ __ __ __ __ __` -| position | length | type | Description | -| -------- | ------ | ----------- | --------------------------------------------------- | -| 4 (AA) | 2 | uint16 (LE) | Spool Width in µm (`E1 19` --> 6625µm --> 66.25mm ) | +| position | length | type | Description | +| -------- | ------ | ----------- | ----------------------------------------------------- | +| 4 (AA) | 2 | uint16 (LE) | Spool Width in mm*100 (`E1 19` --> 6625 --> 66.25mm ) | ## Block 12 From c804276116be240ecdeac904f102d986767df7f5 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 5 Dec 2024 21:29:21 -0800 Subject: [PATCH 22/36] Add known material IDs Fixes #42. --- BambuLabRfid.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index 857317f..09039fa 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -86,11 +86,33 @@ Example Data: Example Data: `AA AA AA AA AA AA AA AA BB BB BB BB BB BB BB BB` -| position | length | type | Description | -| -------- | ------ | ------ | --------------------------------------------- | -| 0 (AA) | 8 | string | Tray Info Index - Material Variant Identifier | -| 8 (BB) | 16 | string | Tray Info Index - Unique Material Identifier | +| position | length | type | Description | +| -------- | ------ | ------ | ------------------------------------- | +| 0 (AA) | 8 | string | Tray Info Index - Material Variant ID | +| 8 (BB) | 8 | string | Tray Info Index - Material ID | +Known Material IDs: + +- GFA00: Bambu PLA Basic +- GFA01: Bambu PLA Matte +- GFB00: Bambu ABS +- GFB98: Generic ASA +- GFB99: Generic ABS +- GFC00: Bambu PC +- GFC99: Generic PC +- GFG99: Generic PETG +- GFL00: PolyLite PLA +- GFL01: PolyTerra PLA +- GFL98: Generic PLA-CF +- GFL99: Generic PLA +- GFN03: Bambu PA-CF +- GFN98: Generic PA-CF +- GFN99: Generic PA +- GFS00: Bambu Support W +- GFS01: Bambu Support G +- GFS99: Generic PVA +- GFU01: Bambu TPU 95A +- GFU99: Generic TPU ## Block 2 Example Data: From f44e5c065d9877702fdfc28a55fadbab1bd43ef5 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 5 Dec 2024 21:32:04 -0800 Subject: [PATCH 23/36] Add additional material IDs found from tag dumps --- BambuLabRfid.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index 09039fa..26dbca2 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -95,11 +95,18 @@ Known Material IDs: - GFA00: Bambu PLA Basic - GFA01: Bambu PLA Matte +- GFA05: Bambu PLA Silk +- GFA08: Bambu PLA Sparkle +- GFA09: Bambu PLA Tough +- GFA15: Bambu PLA Galaxy +- GFA50: Bambu PLA-CF - GFB00: Bambu ABS - GFB98: Generic ASA - GFB99: Generic ABS - GFC00: Bambu PC - GFC99: Generic PC +- GFG00: Bambu PETG Basic +- GFG01: Bambu PETG Translucent - GFG99: Generic PETG - GFL00: PolyLite PLA - GFL01: PolyTerra PLA @@ -110,9 +117,11 @@ Known Material IDs: - GFN99: Generic PA - GFS00: Bambu Support W - GFS01: Bambu Support G +- GFS02: Bambu Support for PLA - GFS99: Generic PVA - GFU01: Bambu TPU 95A - GFU99: Generic TPU + ## Block 2 Example Data: From bd4af381f8dfcb54e69a9abda4ed2252158d7a99 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 5 Dec 2024 21:40:36 -0800 Subject: [PATCH 24/36] Add color IDs --- BambuLabRfid.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index 26dbca2..b628d95 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -91,6 +91,8 @@ Example Data: | 0 (AA) | 8 | string | Tray Info Index - Material Variant ID | | 8 (BB) | 8 | string | Tray Info Index - Material ID | +The material IDs all start with the letters "GF" (so far), and the material variant IDs start with the last three letters of the material ID. For example, a variant ID of `A50-K0` is associated with a material ID of `GFA50`. We'll refer to the second part (after the hyphen) of the variant IDs as "color IDs". + Known Material IDs: - GFA00: Bambu PLA Basic @@ -122,6 +124,28 @@ Known Material IDs: - GFU01: Bambu TPU 95A - GFU99: Generic TPU +Known Color IDs: + +- A0: + - For A00: Orange (#FF671FFF) + - For G00: Orange (#FF6A13FF) +- B3: Marine Blue (#0078BFFF) +- B4: Blue (#0085ADFF) +- B7: Royal Purple (#483D8BFF) +- D0: Grey (#8E9089FF) +- D1: Silver (#A6A9AAFF) +- G1: + - For A15: Nebulae (#424379FF) + - Others: Green (#00AE42FF) +- G6: Green (#00AE42FF) +- K0, K1: Black (#000000FF) +- P0: Purple (#D6ABFF80) +- T3: Neon City (Blue-Magenta) (#0047BBFF / #BB22A3F) +- W0, W1: White (#FFFFFFFF) +- W2: Ivory White (#FFFFFFFF) +- Y3: Bronze (#84754EFF) + + ## Block 2 Example Data: From 7fe91df30ab13981d64248450ba8a7afa3bc2b75 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sat, 7 Dec 2024 09:09:11 -0800 Subject: [PATCH 25/36] Add additional material IDs --- BambuLabRfid.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index b628d95..009f281 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -97,32 +97,91 @@ Known Material IDs: - GFA00: Bambu PLA Basic - GFA01: Bambu PLA Matte +- GFA02: Bambu PLA Metal +- GFA03: Bambu PLA Impact - GFA05: Bambu PLA Silk +- GFA07: Bambu PLA Marble - GFA08: Bambu PLA Sparkle - GFA09: Bambu PLA Tough +- GFA11: Bambu PLA Aero +- GFA12: Bambu PLA Glow +- GFA13: Bambu PLA Dynamic - GFA15: Bambu PLA Galaxy - GFA50: Bambu PLA-CF - GFB00: Bambu ABS +- GFB01: Bambu ASA +- GFB02: Bambu ASA-Aero +- GFB50: Bambu ABS-GF +- GFB51: Bambu ASA-CF +- GFB60: PolyLite ABS +- GFB61: PolyLite ASA - GFB98: Generic ASA - GFB99: Generic ABS - GFC00: Bambu PC - GFC99: Generic PC - GFG00: Bambu PETG Basic - GFG01: Bambu PETG Translucent +- GFG02: Bambu PETG HF +- GFG50: Bambu PETG-CF +- GFG60: PolyLite PETG +- GFG96: Generic PETG HF +- GFG97: Generic PCTG +- GFG98: Generic PETG-CF - GFG99: Generic PETG - GFL00: PolyLite PLA - GFL01: PolyTerra PLA +- GFL03: eSUN PLA+ +- GFL04: Overture PLA +- GFL05: Overture Matte PLA +- GFL06: Fiberon PETG-ESD +- GFL50: Fiberon PA6-CF +- GFL51: Fiberon PA6-GF +- GFL52: Fiberon PA12-CF +- GFL53: Fiberon PA612-CF +- GFL54: Fiberon PET-CF +- GFL55: Fiberon PETG-rCF +- GFL95: Generic PLA High Speed +- GFL96: Generic PLA Silk - GFL98: Generic PLA-CF - GFL99: Generic PLA - GFN03: Bambu PA-CF +- GFN04: Bambu PAHT-CF +- GFN05: Bambu PA6-CF +- GFN06: Bambu PPA-CF +- GFN08: Bambu PA6-GF +- GFN96: Generic PPA-GF +- GFN97: Generic PPA-CF - GFN98: Generic PA-CF +- GFN98: Generic PA-CF P1P - GFN99: Generic PA +- GFN99: Generic PA P1P +- GFP95: Generic PP-GF +- GFP96: Generic PP-CF +- GFP97: Generic PP +- GFP98: Generic PE-CF +- GFP99: Generic PE +- GFR98: Generic PHA +- GFR99: Generic EVA - GFS00: Bambu Support W - GFS01: Bambu Support G - GFS02: Bambu Support for PLA +- GFS03: Bambu Support for PA/PET +- GFS04: Bambu PVA +- GFS05: Bambu Support for PLA/PETG +- GFS06: Bambu Support for ABS +- GFS97: Generic BVOH +- GFS98: Generic HIPS - GFS99: Generic PVA +- GFT01: Bambu PET-CF +- GFT02: Bambu PPS-CF +- GFT97: Generic PPS +- GFT98: Generic PPS-CF +- GFU00: Bambu TPU 95A HF - GFU01: Bambu TPU 95A +- GFU02: Bambu TPU for AMS +- GFU98: Generic TPU for AMS - GFU99: Generic TPU +- GFU99: Generic TPU P1P Known Color IDs: From 1ff592dbdf046dd22a71031505c6e0d251929b7b Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 11:25:03 -0800 Subject: [PATCH 26/36] Update key derivation script to mention what variable to replace --- TagSniffing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TagSniffing.md b/TagSniffing.md index b6e5f65..fb687f4 100644 --- a/TagSniffing.md +++ b/TagSniffing.md @@ -36,7 +36,7 @@ As of 2024-11-19, keys can now be derived from the UID of a tag. from Cryptodome.Protocol.KDF import HKDF from Cryptodome.Hash import SHA256 -uid = bytes([0x02,0x3b,0x44,0x74]) +uid = bytes([0x02,0x3b,0x44,0x74]) # Replace this with the tag's UID master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) keys = HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") From fe85c9a188a04719557e6bdd57f0e030b8cda476 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 11:54:33 -0800 Subject: [PATCH 27/36] Formatting fix --- BambuLabRfid.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index 009f281..e70640e 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -63,11 +63,11 @@ All Bambu Lab tags use the same Permission Bits (Access Control) Example Data: `AA AA AA AA AA AA PP PP PP PP BB BB BB BB BB BB` -| position | length | type | Description | -| -------- | ------ | ------- | ------------------------------------------------------------------------------ | -| 0 (AA) | 6 | RAW Bin | A-Key | -| 6 (PP) | 4 | RAW Bin | Permission Bits (Access Control)
ALWAYS `87 87 87 69` (hex) for Bambu Tags | -| 10 (BB) | 6 | RAW Bin | B-Key (always `00 00 00 00 00 00` for Bambu tags) | +| position | length | type | Description | +| -------- | ------ | ------- | ---------------------------------------------------------------------- | +| 0 (AA) | 6 | RAW Bin | A-Key | +| 6 (PP) | 4 | RAW Bin | Permission Bits (Access Control) (always `87 87 87 69` for Bambu Tags) | +| 10 (BB) | 6 | RAW Bin | B-Key (always `00 00 00 00 00 00` for Bambu tags) | ## Block 0 From b6ef0cc4dba5d49444f9518142f9746a27e2147a Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 11:54:46 -0800 Subject: [PATCH 28/36] No need to list all material and variant IDs --- BambuLabRfid.md | 114 +----------------------------------------------- 1 file changed, 1 insertion(+), 113 deletions(-) diff --git a/BambuLabRfid.md b/BambuLabRfid.md index e70640e..da01ba6 100644 --- a/BambuLabRfid.md +++ b/BambuLabRfid.md @@ -91,119 +91,7 @@ Example Data: | 0 (AA) | 8 | string | Tray Info Index - Material Variant ID | | 8 (BB) | 8 | string | Tray Info Index - Material ID | -The material IDs all start with the letters "GF" (so far), and the material variant IDs start with the last three letters of the material ID. For example, a variant ID of `A50-K0` is associated with a material ID of `GFA50`. We'll refer to the second part (after the hyphen) of the variant IDs as "color IDs". - -Known Material IDs: - -- GFA00: Bambu PLA Basic -- GFA01: Bambu PLA Matte -- GFA02: Bambu PLA Metal -- GFA03: Bambu PLA Impact -- GFA05: Bambu PLA Silk -- GFA07: Bambu PLA Marble -- GFA08: Bambu PLA Sparkle -- GFA09: Bambu PLA Tough -- GFA11: Bambu PLA Aero -- GFA12: Bambu PLA Glow -- GFA13: Bambu PLA Dynamic -- GFA15: Bambu PLA Galaxy -- GFA50: Bambu PLA-CF -- GFB00: Bambu ABS -- GFB01: Bambu ASA -- GFB02: Bambu ASA-Aero -- GFB50: Bambu ABS-GF -- GFB51: Bambu ASA-CF -- GFB60: PolyLite ABS -- GFB61: PolyLite ASA -- GFB98: Generic ASA -- GFB99: Generic ABS -- GFC00: Bambu PC -- GFC99: Generic PC -- GFG00: Bambu PETG Basic -- GFG01: Bambu PETG Translucent -- GFG02: Bambu PETG HF -- GFG50: Bambu PETG-CF -- GFG60: PolyLite PETG -- GFG96: Generic PETG HF -- GFG97: Generic PCTG -- GFG98: Generic PETG-CF -- GFG99: Generic PETG -- GFL00: PolyLite PLA -- GFL01: PolyTerra PLA -- GFL03: eSUN PLA+ -- GFL04: Overture PLA -- GFL05: Overture Matte PLA -- GFL06: Fiberon PETG-ESD -- GFL50: Fiberon PA6-CF -- GFL51: Fiberon PA6-GF -- GFL52: Fiberon PA12-CF -- GFL53: Fiberon PA612-CF -- GFL54: Fiberon PET-CF -- GFL55: Fiberon PETG-rCF -- GFL95: Generic PLA High Speed -- GFL96: Generic PLA Silk -- GFL98: Generic PLA-CF -- GFL99: Generic PLA -- GFN03: Bambu PA-CF -- GFN04: Bambu PAHT-CF -- GFN05: Bambu PA6-CF -- GFN06: Bambu PPA-CF -- GFN08: Bambu PA6-GF -- GFN96: Generic PPA-GF -- GFN97: Generic PPA-CF -- GFN98: Generic PA-CF -- GFN98: Generic PA-CF P1P -- GFN99: Generic PA -- GFN99: Generic PA P1P -- GFP95: Generic PP-GF -- GFP96: Generic PP-CF -- GFP97: Generic PP -- GFP98: Generic PE-CF -- GFP99: Generic PE -- GFR98: Generic PHA -- GFR99: Generic EVA -- GFS00: Bambu Support W -- GFS01: Bambu Support G -- GFS02: Bambu Support for PLA -- GFS03: Bambu Support for PA/PET -- GFS04: Bambu PVA -- GFS05: Bambu Support for PLA/PETG -- GFS06: Bambu Support for ABS -- GFS97: Generic BVOH -- GFS98: Generic HIPS -- GFS99: Generic PVA -- GFT01: Bambu PET-CF -- GFT02: Bambu PPS-CF -- GFT97: Generic PPS -- GFT98: Generic PPS-CF -- GFU00: Bambu TPU 95A HF -- GFU01: Bambu TPU 95A -- GFU02: Bambu TPU for AMS -- GFU98: Generic TPU for AMS -- GFU99: Generic TPU -- GFU99: Generic TPU P1P - -Known Color IDs: - -- A0: - - For A00: Orange (#FF671FFF) - - For G00: Orange (#FF6A13FF) -- B3: Marine Blue (#0078BFFF) -- B4: Blue (#0085ADFF) -- B7: Royal Purple (#483D8BFF) -- D0: Grey (#8E9089FF) -- D1: Silver (#A6A9AAFF) -- G1: - - For A15: Nebulae (#424379FF) - - Others: Green (#00AE42FF) -- G6: Green (#00AE42FF) -- K0, K1: Black (#000000FF) -- P0: Purple (#D6ABFF80) -- T3: Neon City (Blue-Magenta) (#0047BBFF / #BB22A3F) -- W0, W1: White (#FFFFFFFF) -- W2: Ivory White (#FFFFFFFF) -- Y3: Bronze (#84754EFF) - +The material IDs all start with the letters "GF" (so far), and the material variant IDs start with the last three letters of the material ID. For example, a variant ID of `A50-K0` is associated with a material ID of `GFA50`. ## Block 2 From c18a6161b55715ad18fd934ed3e59e53fffacb14 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 20:44:33 -0800 Subject: [PATCH 29/36] Slight tweaks --- README.md | 14 ++++++++------ TagSniffing.md | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6010bcf..8602daf 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ We are currently working on a way to submit the tag data in a secure way so anal * [FAQs](#faqs) * [How to contribute](#how-to-contribute) * [Todos/Timeline/Next steps](#todostimelinenext-steps) - * [Required Equipment](#required-equipment) + * [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) * [Proxmark3 fm11rf08s recovery script](#proxmark3-fm11rf08s-recovery-script) - * [Sniffing the tag data (legacy method)](#sniffing-the-tag-data-legacy-method) + * [Sniffing the tag data with a Proxmark3 (legacy method)](#sniffing-the-tag-data-with-a-proxmark3-legacy-method) * [Tag Documentation](#tag-documentation) * [How do RFID tags work?](#how-do-rfid-tags-work) * [Compatible RFID tags - By generation](#compatible-rfid-tags---by-generation) @@ -43,7 +43,7 @@ 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 sniff and 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). 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 @@ -53,8 +53,10 @@ A lot of the contents have been deciphered, but the more data we have, the easie - [ ] Tag content analysis - [ ] Generate keys based on an arbitrary UID -## Required Equipment +## Requirements +- A computer running macOS or Linux, or a Windows computer with a WSL installation +- Python 3.6 or higher - Bambu Lab Filament spool **or** the related tags - A Proxmark3-compatible RFID reader - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) @@ -87,7 +89,7 @@ To visualize the data on the tag, run the following: `script run fm11rf08_full -b` -### Sniffing the tag data (legacy method) +### Sniffing the tag data with a Proxmark3 (legacy method) Before the above script was created, tag data had to be obtained by sniffing the data between the RFID tag and the AMS. @@ -125,7 +127,7 @@ Here's a high-level summary of how everything works: - To clone a tag, it must have the same UID, identical content from the data blocks, and the identical RSA signature - Changing even one byte will cause the signature to be invalid, and the tag will be rejected - Custom Tags - - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu has their "Private Key" which is used to digitally sign these tags. + - This is very unlikely to happen, mostly due to the RSA signature. Only Bambu Lab has their "Private Key" which is used to digitally sign these tags. - To create a custom key, you need to know the following info: - 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 diff --git a/TagSniffing.md b/TagSniffing.md index fb687f4..f98a34e 100644 --- a/TagSniffing.md +++ b/TagSniffing.md @@ -59,7 +59,7 @@ print([a.hex() for a in keys]) - Load a strand of filament into the AMS. This is what triggers the AMS to attempt to read the RFID tag. - Press the button on the ProxMark to end capture after the filament has completed loading -3. **Extract the Keys** +3. **Obtain the Keys** 1. **Automatic** (recommended) From 956a1e9eaec4cf03c50dfbaaa9b946cd51347385 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 22:03:37 -0800 Subject: [PATCH 30/36] Move key derivation script to its own .py file --- TagSniffing.md | 16 ---------------- deriveKeys.py | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 deriveKeys.py diff --git a/TagSniffing.md b/TagSniffing.md index f98a34e..52edee4 100644 --- a/TagSniffing.md +++ b/TagSniffing.md @@ -28,22 +28,6 @@ The Bambu Lab AMS Lite RFID readers are located at the base of each spool holder You must place your Proxmark3 device between the reader and the spool. -## Key Derivation - -As of 2024-11-19, keys can now be derived from the UID of a tag. - -```python -from Cryptodome.Protocol.KDF import HKDF -from Cryptodome.Hash import SHA256 - -uid = bytes([0x02,0x3b,0x44,0x74]) # Replace this with the tag's UID -master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) - -keys = HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") - -print([a.hex() for a in keys]) -``` - ## Dump RFID Contents (.bin) 1. **Run ProxMark3 Software** diff --git a/deriveKeys.py b/deriveKeys.py new file mode 100644 index 0000000..60ac788 --- /dev/null +++ b/deriveKeys.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +# Python script to generate keys for Bambu Lab RFID tags +# Created for https://github.com/Bambu-Research-Group/RFID-Tag-Guide +# Written by thekakester (https://github.com/thekakester) and Vinyl Da.i'gyu-Kazotetsu (www.queengoob.org), 2024 + +import sys +from Cryptodome.Protocol.KDF import HKDF +from Cryptodome.Hash import SHA256 + +if not sys.version_info >= (3, 6): + print("Python 3.6 or higher is required!") + exit(-1) + +def kdf(uid): + master = bytes([0x9a,0x75,0x9c,0xf2,0xc4,0xf7,0xca,0xff,0x22,0x2c,0xb9,0x76,0x9b,0x41,0xbc,0x96]) + return HKDF(uid, 6, master, SHA256, 16, context=b"RFID-A\0") + +if __name__ == '__main__': + uid = bytes.fromhex(sys.argv[1]) + keys = kdf(uid) + + output = [a.hex().upper() for a in keys] + print("\n".join(output)) From f04b81009811f070ee5852dcab49c25d1170c4bb Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 22:05:05 -0800 Subject: [PATCH 31/36] Add instructions on how to use key derivation to read tags --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8602daf..0416d27 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ We are currently working on a way to submit the tag data in a secure way so anal * [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) @@ -75,6 +76,30 @@ A Proxmark3 Easy is sufficient for all the tasks that need to be done. You can b We document here the most simple approach to get all required A-Keys and the data of the tag. The easiest way is to use the `fm11rf08s` script included in the Proxmark3 software. +### 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 +- 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 + ### 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. @@ -91,7 +116,7 @@ To visualize the data on the tag, run the following: ### Sniffing the tag data with a Proxmark3 (legacy method) -Before the above script was created, tag data had to be obtained by sniffing the data between the RFID tag and the AMS. +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). From 6e6b519cfe8c922ed7d2ba5fdda44c82ea181f83 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sun, 8 Dec 2024 22:05:14 -0800 Subject: [PATCH 32/36] Add instructions for Flipper Zero usage --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0416d27..19b6f2f 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,12 @@ A lot of the contents have been deciphered, but the more data we have, the easie - A computer running macOS or Linux, or a Windows computer with a WSL installation - Python 3.6 or higher - Bambu Lab Filament spool **or** the related tags -- A Proxmark3-compatible RFID reader -- The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) - - Requires v4.18994 (codename "Backdoor") or higher - - You MUST use the Iceman fork as the original version of the software is unmaintained; all instructions and scripts are written for the Iceman fork and will not work on the original version +- An NFC/RFID reader that can read encrypted tags, such as... + - A Proxmark3-compatible RFID reader (recommended) + - The [proxmark3 (Iceman fork) software](https://github.com/RfidResearchGroup/proxmark3) + - Requires v4.18994 (codename "Backdoor") or higher + - You MUST use the Iceman fork as the original version of the software is unmaintained; all instructions and scripts are written for the Iceman fork and will not work on the original version + - A Flipper Zero ### Proxmark3 compatible readers @@ -86,6 +88,10 @@ First, obtain the tag's UID: 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 @@ -99,6 +105,14 @@ Then, use the keys file to extract the data from the RFID tag: 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 From 10faeb8e42602a2d4ca28d28ce1236725d3fb139 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Mon, 9 Dec 2024 19:56:39 -0800 Subject: [PATCH 33/36] Add details for the Creality RFID tags --- CrealityRfid.md | 25 +++++++++++++++++++++++++ README.md | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 CrealityRfid.md diff --git a/CrealityRfid.md b/CrealityRfid.md new file mode 100644 index 0000000..9e167b1 --- /dev/null +++ b/CrealityRfid.md @@ -0,0 +1,25 @@ +# Creality RFID Tag Documentation + +This contains documentation for the data that is contained in the RFID tags for Creality RFID spools. + +The data format has been primarily researched in the following Reddit thread: https://www.reddit.com/r/Creality_k2/comments/1h5egkv/introducing_rfid_for_cfs_an_android_app_for/?share_id=Vu3JVyAm0wjQzBbbYK9Yp&utm_name=androidcss + +## Overview + +The data in the tags for Creality RFID spools is stored in blocks 4 through 6. The data is ASCII-encoded and stored in a byte-like format. + +## Data + +Example Data: 7A3 24120 0A21 01001 #000000 016500 000100000000000000 + +`AAA BBBBB CCCC DDDDD #EEEEEE FFFFFF GGGGGGGGGGGGGGGGGG` + +| position | length | type | Description | +| -------- | ------ | ------- | --------------------------- | +| 0 (A) | 3 | hex | Batch number | +| 3 (B) | 5 | date | Manufacturing date as YYMDD | +| 8 (C) | 4 | hex | Supplier ID | +| 12 (D) | 5 | hex | Material ID | +| 17 (E) | 6 | RGB | Material Color | +| 23 (F) | 5 | hex | Spool ID...? | +| 28 (G) | 18 | unknown | Unknown | diff --git a/README.md b/README.md index 19b6f2f..edbbefd 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,9 @@ To read how to obtain the tag data using the legacy sniffing method, see the [Ta For a description of the blocks of a Bambu Lab RFID tag, see [BambuLabRfid.md](./BambuLabRfid.md). -For a description of an open-source standard proposal, see [OpenSourceRfid.md](./OpenSourceRfid.md). +For a description of the blocks of a Creality RFID tag, see [CrealityRfid.md](./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). ## How do RFID tags work? From 6a4d18dc378367ce049e2721433cf84e5c98d0d2 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 13 Mar 2025 11:28:42 -0700 Subject: [PATCH 34/36] Easiest way is deriving keys --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62fda0d..f0c7fa2 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ A Proxmark3 Easy is sufficient for all the tasks that need to be done. You can b ## 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 use the `fm11rf08s` script included in the Proxmark3 software. +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 From b5d5937054ba7142ea2850c4ec8c53e982d2a697 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sat, 7 Jun 2025 01:02:01 -0700 Subject: [PATCH 35/36] Mark completed to-do steps as such --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0c7fa2..ca39321 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ A lot of the contents have been deciphered, but the more data we have, the easie - [ ] Tool for automatic trace analysis - [ ] Web service for tag submisson with automatic anonymized data publishing to GitHub -- [ ] Tag content analysis -- [ ] Generate keys based on an arbitrary UID +- [x] Tag content analysis +- [x] Generate keys based on an arbitrary UID ## Requirements From 330594e11a85a28eecec54f5f50fff9c3e7c2638 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Sat, 7 Jun 2025 01:02:12 -0700 Subject: [PATCH 36/36] Link to new library repository --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ca39321..9827467 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Bambu Lab RFID Tag Guide -This guide gives you a basic overview how you can decrypt and read your tags. Since we don't know how Bambu Lab will react on this guide and the general reverse engineering of the tags: **Please don't share you tag's UID and the related keys for now.** +This guide gives you a basic overview how you can decrypt and read your tags. -We are currently working on a way to submit the tag data in a secure way so analysis on the data could be done. +[View Collection of Tags](https://github.com/queengooborg/Bambu-Lab-RFID-Library) [![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) @@ -32,11 +32,11 @@ This is a research group dedicated to documenting the data structures used by Ba ### FAQs -- **Can I clone tags?** - - Yes, you can read and clone tags using a tool such as a Proxmark3 - **Can I create custom tags?** - No, tags are digitally signed. Even if you modify the contents, the printer will reject any tags without a valid RSA signature - An [Open Source RFID Tag](OpenSourceRfid.md) has been proposed to allow anyone to create / modify their own tags. This must be adopted by printer manufacturers, or you can mod your own printer for support +- **Can I clone tags?** + - Yes, you can read and clone tags using a tool such as a Proxmark3. Check out our [collection of scanned tags](https://github.com/queengooborg/Bambu-Lab-RFID-Library) - **What are the next steps for this project?** - Decyphering the rest of the unknown tag content - Custom AMS firmware that allows custom tags to be read while ignoring the signature @@ -50,7 +50,6 @@ A lot of the contents have been deciphered, but the more data we have, the easie ### Todos/Timeline/Next steps - [ ] Tool for automatic trace analysis -- [ ] Web service for tag submisson with automatic anonymized data publishing to GitHub - [x] Tag content analysis - [x] Generate keys based on an arbitrary UID