cstef
/posts/miele

Reverse Engineering the TMS 220 Miele Payment System

2024-08-29(3 min. read) - re

The TMS 220 is a payment system used in Miele washing machines and dryers. It's a simple device that allows users to pay for laundry cycles using so-called "Touch" devices. These devices are essentially iButtons (sold for 40 bucks btw) that can be loaded with credit and used to pay for laundry cycles.

Miele TMS 220

As the payment device is completely independent (not connected via GSM or whatever), I was curious to see how it works and if I could reverse-engineer it. I happened to have just bought a Flipper Zero, which is basically a Swiss Army knife for nerds, and it seemed like the perfect device for the job as it supports iButton reading, writing, and emulation.

Touch Device

The Touch device is a small iButton in a plastic holder. Underneath the plastic, there's a DS1992 iButton, which is a 1-wire device with 1Kb (128 bytes) of NVRAM. The device is powered by the reader, which provides power through the 1-wire interface.

Miele Touch Device

It provides 4 pages of 32 bytes each, with an additional 32 bytes scratchpad (used for checking the data before actually writing it).

There are also 8 bytes of ROM that hold the following information:

Address RangeData
0x1Family Code (0x08)
0x2 - 0x7Serial Number
0x8CRC byte

The 128 bytes of NVRAM were likely used to store the balance and other information about the user. This was the part I was most interested in, as I wanted to see if I could read and write the balance.

Reverse Engineering

Getting into the actual reverse engineering, I started by reading the iButton with the Flipper Zero. The Flipper Zero has a built-in iButton reader, so it was as simple as putting the iButton on the reader and pressing a button. The Flipper Zero then displayed the contents of the iButton, which I saved on the SD card for later analysis.

The following dump was obtained from the iButton:

┌────────┬─────────────────────┬─────────────────────┬──────────┬──────────┐
│0000000020c3 b108 01c2 87110f3e 0724 c399 c2bf ×ו•××>$×××× │
│00000010c2b2 23c2 93c3 b8c2b551 c3bf 7bc2 8cc2××#××××××Q××{××× │ 
│00000020b84f 001e 1b31 c29d7e6e 6f37 c28b 6fc3×O••1××~no7××o× │
│00000030a213 5e56 1ac2 9803c2b9 c38a c3ae 6cc3×^V××××××××l× │
│000000409923 c2af 1751 c2b5c381 c3a2 c3a7 c391×#××Q×××××××××× │ 
│0000005032c3 adc2 a073 6359c3ae c3b8 0e00 00002××××scY×××ו•• │ 
│000000600000 1105 1200 0000454c 4549 4d09 3565••••••••ELEIM_5e │ 
│00000070c2ac 2b4a 1dc2 b82bc3ad 0cc3 8b7b 5e6b××+J××+××_××{^k │ 
│00000080484c 6a26 c389 6ac3aac2 adc3 b4c2 9a57HLj&××j××××××××W │ 
│00000090c384 54c2 9b05 c2bf1800 0000 0000 0000××T×××ו•••••• │ 
│000000a00000 0000 0000 000000                 •••••••• │ 
└────────┴─────────────────────┴─────────────────────┴──────────┴──────────┘

We immediately notice the ELEIM string, which is just MIELE reversed. This tells us that the iButton NVRAM is (likely) not encrypted, as the string is stored in plain text.

At the time of this dump, there was no balance on this iButton, so it was near impossible to determine where the balance was stored. We needed another dump with an amount on it to perform a differential analysis.

Getting another dump

TODO