start	end	text
0	2100	Yeah, hello.
2460	4880	I know I'm at the mic, I don't want to get too close.
5280	7020	Right, so hello everybody.
7420	9060	Most people here I know.
9920	14620	So, my name is Ikwip, I am Alexander, and this is Lew.
14780	15060	What?
15280	16400	Uh, hi.
16500	18800	Oh yeah, no, I do get to say hi.
19280	24140	So, today we are presenting our paper, which is a white paper.
24140	29800	It's called Hung Out to Dry, and it's airing the dirty laundry of store value washcards.
31440	32300	Go back?
32300	32940	Oh, good.
33280	40380	If you guys want the paper, or the Google Slides, or whatever, you can just scan into our code.
43690	44830	Right, okie dokie.
45690	46710	No, wait, wait, wait.
47110	47970	Scanning it.
48330	49890	All right, okay.
52230	54050	So, we get the thought in the outline?
54330	55050	No.
55090	56610	All right, so this is our outline.
56610	58050	Take a quick look, because I'm not going to...
58050	60370	Take a quick look, because I'm not going to read through it.
61230	79750	Okay, so a quick disclaimer is that this is educational research only, and we have omitted the point about creating transaction IDs on the cards, because they aren't needed for the washing machine, but they are needed for the encoder, and it was just a courtesy that we gave to KeoSoft.
83120	89320	All right, so we did all this in good faith.
89320	98520	We put $47 legitimately loaded, and we used $15 of those dollars, and yeah.
98760	105060	Yeah, so we didn't spend any money that we didn't add, legally, I promise.
105900	106960	All right, go on then.
107460	144280	Okay, so it was last year after DEF CON, I was going to Miami, and I had these washing machines, which had stored value laundry carts, and they were MyFairClassic RFID cards, which can store the money of whatever you put in the encoder, and one day I was like,
144280	147940	hey Equip, are these hackable?
147940	149280	Can I put money on them?
149840	152340	And he's like, let's have a look.
154200	171100	Yeah, so we'd just been at DEF CON the previous year, it was still late, late August, when he sent me a message and said, they've got these cards at this condo thing that I'm staying at, they say they're MyFairClassic, what do you think the values, what are the trends of the value being inside?
171100	175740	And I was like, not impossible, you know, security does suck, income in places.
175920	181480	So he sent me over a dump bin, and I said how much was in it, and I went, I've spotted it, have you spotted it?
181480	183600	And then we worked backwards from there.
184840	187340	Okay, so, hold on now.
187580	198380	These are all the affected systems, the main one being Kiosoft, which is the company which provides the data structure for these cards.
198840	212840	And the companies that you see all around, and the universities which have their campuses, self student laundry, have this vulnerable system.
214860	223420	So, yeah, so we do have a demo video that we were able to get from Miami, that we've stuck at the end, because it's a little bit of a long one.
224140	231280	So, getting into the card structure, I'm not sure if anybody is aware of how MyFairClassic looks underneath the hood.
231300	240960	MyFairClassic is one of the most commonly used domestic low to medium security cards used for storing about a kilobyte of data, about 720 bytes of data.
240960	252680	But in the block zero, you have the UID, the BCC, a vanity SAK, an ATQA, and original equipment manufacturer usable data, which makes up the last 16 bytes.
252680	260520	This just is, it's immutable data on normal cards, can't be changed, can't be cloned, or it can be cloned, but not onto that same card.
260780	276120	As for the memory, which is the more important part of this, because we are dealing with stored value in the memory, is you have three blocks of data per sector protected by two keys with access bits in between that determine how those keys can be used with that sector.
286830	291290	So this is how the general structure of MyFairClassic does look.
291670	296490	There is a lot more blocks than this, but trying to get a one big zoom out, visibly impossible.
296730	301370	So yeah, so you've got 16 sectors with each containing four blocks.
301370	303410	One of those blocks is a sector trailer.
303890	307510	So now moving on to finding the balance.
307510	316970	So we initially looked onto the card for the balance of $18.75, because we knew that was how much was on it from the last check of going to the room.
317070	332110	So we started thinking, in common systems you usually find them decimalizing it as a whole number, so like 1-8-7-5, or doing 18 and then 75.
332110	342430	So we just tried looking backwards from what was the most obvious, and unsurprisingly Arkham's Razor does always prove to be true, and it was the most obvious answer as they were storing it as a whole cent amount.
342590	356290	So $18.75 was $18.75, and then we converted that into hex, and then we were able to look into the memory and see does this appear anywhere in the memory.
357590	371510	So we were looking for 0-7-5-3 in the memory, because that's the standard forward endian decimalization of $18.75.
371510	389850	But very quickly we noticed, taking a look, that they were in fact just endianness reverse, and the value was noted in multiple places in the memory in reverse endian, so $53.07, and it was also in the previous updated block.
389850	393490	So we have four representations of the same value.
394230	408890	So the value positions were in block 2, bytes 9 and 10, which is the value at the last top up, which tells you how much money was the last added to it.
408890	411450	And then we have blocks 4 and 8, which are both mirrored.
411450	415870	So everything that happens in both of those blocks is mirrored to each other.
418370	427330	Before we get into the technical part, just to be curious, who here loves to spend $7 for laundry every single day?
428190	430410	Yeah, that's what I thought.
430930	436110	All right, so we have labeled the variables.
436110	443730	I know you guys might not be able to see everything in the text, but we will explain each part in detail.
449470	462510	Okay, so we have omitted and changed the actual data in the blocks, because a lot of what is written to each individual card in each individual location is very easily identified.
462510	466870	And while we did disclose to them, we still don't want them coming after us.
466870	470490	So the first bit is the second trailer, which has the keys.
470490	472510	So we've obviously changed the keys.
472610	485110	And it's got the access conditions that say they were typical write conditions, which were 078069, which were just standard write transfer restore permissions.
485830	490450	Then was the card number, which was printed on the back of the card.
490590	495410	So the back number on the back of the card was 0129889.
495430	500870	And they stored this as decimalized hexadecimal.
500870	504910	So in the memory, it said 0129889.
504910	509850	So that was decimal converted into hectodecimal to look like the decimal.
509850	523350	So if you convert that back to decimal, it's not the same number, but it's very visibly obvious So we started using shorthand K soon after because we had to label a lot of variables.
523350	525010	So we started pulling this, the vault byte.
525010	526910	This is our value at last top up.
526910	531950	And whenever you add money onto the card, the vault byte gets updated.
531950	538970	So if your value, if you have $45 on and you add $5, it goes up to $50.
538970	542850	So the value at last top up is shown here in block two.
542850	544090	And that is immutable.
544090	545870	When you spend money, that doesn't go down.
545870	548590	It only changes whenever you next top up money.
548590	554090	So if you spend $25 and then add $5 more to be up to $30, it goes up to $30.
555150	557330	So we have our transaction identifier.
557330	564970	Oh, we have our transaction identifier in block two, which is also been changed from a real one.
565110	572710	This is used on the encoders to verify that the memory on the card is succinct with what it's expecting.
572830	582150	So if you have, you know, a balance that doesn't reflect the transaction identifier, then it goes, no, sorry, you're not allowed to add any more money, you're getting banned.
582450	585270	It doesn't do any reporting, though.
585270	586930	It just doesn't like you.
588150	597130	Okay, so we have some incremental mirror bytes, because everything gets mirrored in this card.
597310	598430	Everything.
598610	608730	So next to our transaction ID, we have the incremental mirror byte, which is then also reflected next to the value bytes in every single block.
608770	615810	So every single time you spend or add money to it, the mirror byte goes up.
615810	618830	Oh, it's only when you add money to the card that it goes up.
619710	621890	Okay, yeah.
621890	626270	So this increases in all places at the exact same time.
628070	631370	So there is a terminal byte.
631970	635090	We've called it a terminal byte because it was the last byte.
635090	637390	And this changes in between every read.
637390	650050	So as we tested the cards, when we were noticing changes between them, the last byte on the end of block two always changed, and it didn't seem to have a reason or purpose.
650050	653990	You could change it to absolutely anything you want, they wouldn't care.
654130	665310	But after talking with a Discord member of the RFIDhack community called Duru Steve, he told us it was a XOR, because he was looking into it at the same time a few months ago.
665310	667650	And he goes, it's just a XOR of block two.
667650	676910	And we've noticed the same was apparent with block one, because block one also has a terminal byte, but all of the data in block one does not change.
677190	678630	Yeah, is that...
680370	700390	So the value bad consists of the actual value in in little endian, which is reversing the bytes backwards, except for the last byte in the value block, which is the incremental mirror byte.
704810	706690	So the middle bytes
709730	715550	are basically unknown at this point, what their purpose is.
715550	723160	We have found patterns according to the value paths, but I will explain that later.
723160	729560	And they are mirrored also in block four and block eight.
733500	744140	So the under value byte is, are just one byte under both of the value pads that are on block eight.
744160	757600	And they are also a counter of when the washing machine is used, or when you do a load, and they go up a value.
760960	765340	Yeah, so the second one is the under middle byte, and these will all...
767500	776740	Okay, this is the under middle byte, and it is, as appropriately named, the middle byte underneath the middle block.
777240	780580	And this is, what did that change?
780580	781700	Yeah, no, it changes.
781700	787540	Yeah, it's just an, it's a XOR of the above value block.
787940	801020	And it is one of many, many, many mirrored functions throughout the card that do not contribute to the use case of the card, and you can nix them with absolutely zero consequence to the usage of the card.
801840	804760	Okay, yeah, this is your bit, bro.
804860	820180	So to figure out the purpose, and the reason why at this point, we're not able to add money in a correct way is because of the middle bytes.
820180	827760	The middle bytes are things that they're the bytes that we don't know how they work yet, but we will explain them now.
827760	834900	So first, we take the value bytes.
835180	840560	And let's just take the first byte of the value bytes and the middle byte.
844100	853000	Then after a top up, we're going to take the first byte of value pad and the first byte of the middle bytes.
855220	861040	So this, we can put our data together.
861040	867720	And then we can create a linear relation with these bytes.
867760	890720	Because we thought that the incremental mirror bytes and the last byte of the middle bytes had a relation, because every time you would top up, you would see a decrease in the third middle byte, which means that there could be some relation between the last value byte,
890720	894140	which is the incremental byte and the third middle byte.
896300	902880	So we put in our values that we gathered before, and we get a slope of negative one.
903880	906920	Then let's try to find our actual equation.
907800	915500	So for any of you guys that have done sixth grade math, this is a linear algebra for you.
915660	929020	So we brought our data and we saw that if we did this experiment again, adding three dollars, we can get gather another point.
929760	935650	Let's put ten dollars, same point, it goes in a linear relationship.
937710	948870	Until we reach the y-intercept, which is the part where the line touches the y-axis, which is at 255.
949070	955910	And if you guys know a bit of hex stuff, 255 is just FF.
957190	965630	So we get a formula, which is just y equals minus one times x, so it's minus x plus 255.
968090	983150	But this is just an x-score of FF, which means that you could just take the value byte, the first value byte, and just xor it and get the first middle byte.
983430	986370	And this is also bitwise negation.
993590	1007430	So as we figured out eventually how to add in the amount of value that we wanted to add in, I was curious to know why certain things were happening within the card.
1007430	1013930	Because there was a lot of loose data in the card, a lot of things that did not contribute at all to the function of the card.
1013930	1017610	And as we were looking, we could notice value pairs.
1017610	1028190	So there was FF09, 0F0009F6, and those come out to total multiplications of 25.
1028730	1044410	And all across the card, as you can see down here in blocks nine, so we've got the value bytes, the middle bytes, these are all function mirrors that do not contribute to the function of the card, but they tell you exactly how to hack the card.
1044410	1056990	If you watch the relationship between them, they tell you exactly what you need to do to apply to the different bytes in the further up blocks to completely gain control over the card and give yourself as much credit as you would like.
1057890	1070010	So into the middle bytes of 07 and F8, so in between these just underneath the value bytes, they were applying the exact same equation to each other.
1070010	1075970	So you can see them, so they are non-static bytes, they are static bytes, they're not dynamic.
1075970	1077830	So they stayed the exact same.
1077830	1085290	And if you watch how they behave, they would show you exactly what is being applied to the value byte.
1085290	1097610	So here we have F8, the same function that's being applied to 71 to get 20 is applied to 07 to get F8.
1097910	1110330	So if you take a snapshot of this card from the very beginning of when we started researching it and picked up all those bytes and said what's the relationship between these bytes, you would have skipped about two months of research.
1111470	1119130	And then we're on to our last one which is of course the incremental mirror byte which is 0B and then F4.
1119130	1128570	And then if you look at the relationship between 0B and F4, you get the exact same thing of a function mirror that doesn't do absolutely anything to function.
1128570	1131410	It's just showing you exactly how to hack it.
1132310	1153550	Okay, so we have our undervalue bytes and these ones are entirely... no, so these ones did change but not in any formal fashion that was related to the amount that was being added.
1153550	1160790	They were the linear equation that was being discussed earlier so those would go in the same pattern regardless of what was happening.
1161110	1164650	And that just showed you if you watch one, watch another.
1164650	1168110	So if you XOR 36 through the appaf, you get C9.
1172190	1183510	So we know that there's a lot of numbers and stuff which is why we have left the doc at the beginning of the slide.
1183510	1190990	And now we're going to explain why a value card cannot be created from nothing.
1190990	1212210	So each card has site keys and these site keys are like related to the site of where they were created and they're only accessible from the washing machines of that building or college dorm floor.
1212210	1228410	So there's no way of knowing these keys without having an actual card and using modern MyFairClassic attacks to retrieve these keys and do crypto attacks.
1228410	1250930	So as well as card numbers, they cannot be created from nothing because they're in the system and they're only created by the encoder when you purchase a card and they are fully in the back end.
1252690	1258930	Yeah, so something that we observed during the enrollment of a blank card.
1258990	1266710	So in the washing machine rooms, there was a encoder machine that would give you the card and then you'd have to top it up for the first time.
1266810	1274710	As we watched what happened in between it going from being blank to encoded, it was given its location ID.
1275150	1281470	So specifically one from Florida, from Miami, that was already within the card and then it was given its printed card number.
1281830	1289210	And while you can't create a card from nothing, you can't rock up to a wash station and go, I now have a card that works in this location.
1289250	1292410	All you do need is one card from that location.
1294310	1304570	So we were thinking about, once we got to the end of this, we were having a conversation about what the challenges are when it comes to system upgrades.
1304570	1318310	And this is kind of aside from the research itself, but when we were speaking to people in between last DefCon and this DefCon about it, they were like, well, when we told them, they didn't really seem to care.
1318310	1336150	They couldn't really have the capacity to care because it costs way too much money to fix this problem, to go around to every single unit in North America across all these different companies and go and change the hardware in both the encoders, the chips,
1336150	1338630	the washing machines themselves.
1338630	1351650	So as many people as might watch this, they are willing to risk the amount of money that they are willing to lose because it costs too much money and they're like, it's been 20 years, we've had a good run.
1351650	1353790	So they don't really care.
1353790	1355430	And there's low risk perception.
1356750	1362090	So even if it became like, this is not groundbreaking stuff, this is washing machine money.
1362090	1371810	But if it became like a reputational risk , it still would not hit their key demographic areas of people living in, you know, HMOs, apartment buildings, university dorms.
1371810	1374750	They are the less likely people to hear about this news.
1374770	1384170	So even if it did become more known, the people who actually do use this service are unlikely to engage in extortionate behaviors.
1384650	1387750	And yeah, it's absolutely not profitable to be fixed.
1388190	1394810	So now we've got our little demo video from when we did the first top up, when we first successfully got top up.
1401710	1403250	So at this
1407980	1421820	moment , I was just testing cards and I was topping them up.
1421820	1425740	So let's see if we can get the videos load.
1427080	1430380	I had made a script that does this automatically.
1430380	1443160	It calculates the middle bytes, the value bytes, and everything that you need to get a perfect top up and get big money to wash.
1443160	1450040	So yeah, it's a bit lag.
1453180	1457960	So I use my Proxmark and a Python script.
1462710	1464310	You'll see.
1465470	1479330	What I also did was I created a Flipper plugin, which lets you read, well, this is on top of the Flipper plugin that Toron made for CSC.
1479470	1485490	And it reads the card ID, the balance, $85.
1485490	1487110	That's not even possible in the encoder.
1487110	1488850	We top that up.
1488850	1491870	And the last value of top up.
1491870	1498210	So obviously you can see that we loaded $20 and somehow we have $80 now.
1498490	1503230	And top up count, we set it to zero or whatever.
1505810	1509310	Yeah, so how can you top up $20 without a counter?
1510590	1513290	And let's try to see if this video works now.
1517290	1518450	Oh yeah, I do.
1521740	1523420	Oh, no, no, no, listen.
1524240	1527020	It's almost American boy.
1527140	1533240	The slide deck is in the link on the beginning.
1533240	1535180	I will show you guys that later.
1535180	1538060	Desktop Wi-Fi is not very accommodating.
1540680	1543140	So now we have acknowledgements.
1543800	1566500	I really want to thank my parents for supporting me throughout this challenge and letting me stay up until 3am to be testing on the washing machines, having to hide from the security guards and trying to sneak past to get to the encoder at like 5am sometimes.
1566800	1567080	Yeah.
1567700	1568640	Yeah.
1568640	1587160	I also want to thank Lou's parents because we had an 8 hour time difference between us and he was on holiday in Miami and they were perfectly fine with him staying up on voice call with me for absolutely insane hours.
1587420	1592920	So for the next people that we want to thank is Guru Steve who is in the RFIDhackers discord.
1593100	1598280	He did help us out quite a bit when it came to confirming what we already knew.
1598280	1614080	One thing I will say to Steve is I am very sorry that we did beat you because we noticed that they wanted to start on this about a year prior and there was no traction made when we were looking for a historical backlog of people talking about these kinds of cards.
1614260	1623500	And when we brought what we knew to him, he was able to confirm some of the stuff he knew and the same goes for Toran because Toran made the CSE parser.
1623500	1638580	There was some parts that he did know and some parts that he didn't know and together we were able to make a bunch of adjustments so that one, the flipper script could read a bit better and that we were able to show each other what we had found because this is,
1638580	1640580	it's come from so many different brands.
1640580	1647920	So his was CSE and the next person is The Champ who helped confirm that it was coin-o-matic.
1648040	1654900	So we were finding out all these different branches, we were finding all these different people who had started on researching them.
1655460	1668420	But yeah, and then someone's I just want to shout out is Betsy, NBX, ZBE8 and then everyone in the Pirates Plunder Discord because they put up with our absolutely insane ramblings on the constant and they are here to stay.
1669240	1670860	But yeah, that is us.
1670860	1672140	Thank you everybody.
1681720	1683740	Q&A?
1683740	1684980	No.
1685300	1689220	You want to ask him questions, he will answer all of them.
1689700	1691380	Anybody?
1691920	1693600	Yeah.
1699870	1711910	So, funny enough, we, well, I discovered that shadow mode existed on Gen 4 cards like maybe a month ago.
1712190	1713910	Oh, you found out.
1713910	1723610	Yeah, and I was just buying a bunch of My Fair Classic Gen 1 or Gen 2 cards and giving them out to everybody.
1723750	1725910	I didn't even know shadow mode existed.
1727170	1728410	I, yeah.
1729110	1737710	He learned, he found out, he discovered shadow mode a month ago and the Discord logs do say that I did tell him this 11 months ago.
1740230	1755710	But yeah, so one thing that we did learn while doing pre-research, because we weren't going to try and dig up like a kick a dead horse if someone had already taken it apart, we didn't want to build the wheel twice, was there was people using the shadow mode to do that.
1755710	1763810	But what we were like, it's more interesting as a reverse engineering project to know how the transactions made, what all the bytes means and things like that.
1763810	1773250	So instead of just being able to bounce back to the previous amount of value, we were able to add, you know, down to a set amount exactly how much we want.
1773250	1779970	So you now, you know, we do indeed have a shadow mode card that is permanently fixed at $69.69.
1781610	1787310	And for reference, the CSC parser does exist in the flipper already.
1787830	1792390	And that was made by this company right here.
1792430	1796890	And you can probably read some of the other cards of the CSC parser.
1797590	1799950	And yeah.
1800150	1808830	Yeah, that's one big thing is we don't know the totality of who's been who's on the KeoSoft until people see it and try with their flippers.
1808830	1817970	We don't know, which is why that was one big hurdle with finding out information is we would come across a new one and we'd be like, oh, the whole thing might be dead.
1817970	1819090	Someone might have already done it.
1819090	1821490	So we'd then spend days trolling through Reddit.
1821490	1825010	It would be like, oh, the champs told us that it's coin-o-matic.
1825010	1827590	So now we've got to find if someone's done it all for coin-o-matic.
1827590	1828770	It was an absolute nightmare.
1828770	1829310	He kept going.
1829310	1830130	We're so fucked.
1830130	1831270	It's so over.
1831270	1836010	But luckily, nobody had fully documented the actual information about it.
1836950	1839170	Well, do.
1841720	1842720	Not yet.
1842720	1843720	Not yet.
1844220	1844660	Tonight.
1844660	1845600	Yeah, tonight.
1846720	1847720	Maybe.
1848140	1850600	If we're about to.
1850600	1851980	Used in good day.
1852620	1853820	But yeah, that is us.
1853820	1855120	Thank you so much.
1856180	1856740	I'm a boy.
