start	end	text
2930	8530	Thanks everyone. Welcome to our talk titled Unsafe Lock, Unlocking Millions of Hotel Locks.
9110	14110	I'm Lennart, I'm a hardware security researcher at the KU Leuven University in Belgium.
14110	18870	I typically do research related to voltage glitching and other hardware attacks.
19450	24810	I'm Ian, I'm an application security researcher. I was formerly at the red team at Robin Hood.
24810	29290	And now I run a point search engine called Cicero. We got sued by Air Canada.
32410	39530	So as you can probably tell from the first slide, neither of us is really working on locks or RFID stuff all of the time.
39530	43050	So when we started working on this, it was all relatively new to us.
43390	52370	And the reason we started looking at these locks is that a group of us got invited to hack some Las Vegas hotels back in 2022.
52370	54330	And they were running a bug bounty program.
54590	58750	And one of the elements of the hotel room that was in scope were the hotel locks.
58750	63110	And that's how we got nerd sniped and started looking at these hotel locks.
63490	66410	Now it wasn't just Ian and me, there were more people involved.
66410	70130	And some of them are sitting here on the first row. So thanks everyone.
74900	78100	So here's some related research of other researchers.
78100	85500	So back in 2012, Sarah looked at the Onity locks.
85720	89240	And she found that there is a programming part on the outside of the door.
89240	93900	And if you plug into this, you can actually start reading memory of the lock itself.
94160	98380	And if you analyze this memory, you can extract a side code.
98480	102640	And this side code is enough to send an unlock command to the door and then open it up.
103380	107440	Back then, Sarah immediately published all of the details of the attack.
107440	114560	And this resulted in some people making their own devices, going to hotels, opening all of the doors, stealing TVs, and so on.
114560	120900	There's a very nice Wired article about this hacking spree that some people went on.
121040	123200	It's well worth the read, I would say.
124020	130660	Then six years later, in 2018, there was an attack on the VIN card system by Essa Abloy.
130820	133300	This was an attack by researchers from F-Secure.
133300	137500	And they figured out that if you can read one card from the hotel,
137500	141800	that they can make a master key and then open every door in the hotel, essentially.
141800	145940	In this case, F-Secure worked with Essa Abloy on a fix.
145940	149960	And this also meant that the talk didn't include a lot of technical details.
150400	153420	And this is something where we want to strike a balance.
153420	159400	So instead of publishing all of the details immediately, we went to a long, responsible disclosure process.
159400	162860	And now we are sharing some of the details of what we found.
164100	167520	So, this talk is about Dormakabos Saflock.
167520	171320	It was introduced in 1988 by Computerized Security Systems.
171320	175140	Back then, it was a mag stripe lock, and then they became RFID locks.
175480	181000	It has kind of a weird corporate history. Computerized Security Systems was acquired by Kava in 2006.
181220	187160	And then in 2015, two companies called Dorma and Kava merged, and now it's called Dormakaba.
188560	193440	Saflock is used on 3 million doors in 13,000 hotels in 131 countries.
193440	195940	So, this is one of the biggest brands of hotel locks.
197180	199760	It's important to talk about the architecture before we start.
199760	202440	So, these locks are usually entirely offline.
202580	206320	So, there's the front desk server, and the front desk computers have a connection.
206320	208620	But, they're not connected to the actual hotel locks.
208620	213420	And so, the front desk will write the key card that contains the information of what doors it should open.
213480	217080	And then, the locks make the decisions entirely themselves.
217080	219360	They don't contact any server or anything.
219620	225940	But, in the case of when the lock needs to be upgraded, or if you need to see the access history, there's this unit called the HH6.
226060	229300	And you can plug into a USB port on the bottom of the lock to use this.
229300	232220	So, generally, that's the only connection these locks have.
233340	238820	In some places, especially in large Vegas hotels, they use kind of a semi-online architecture.
238820	241900	So, in this case, the hallways have Zigbee coordinators in them.
241900	244780	And this allows the front desk to kind of see the audit log.
245120	247060	It still doesn't make it an online system.
247060	251300	The key cards are still read by the lock, and the lock determines if it opens or not.
251300	255480	But, afterwards, it tells the front desk, hey, this key opened this lock.
255480	260040	This might be beneficial for hotels, because you can kind of detect what keys are being used.
263140	268220	So, when we were starting out, we needed a hotel to do our research on.
268220	271100	We don't own a hotel, so we had to build one ourselves.
271460	274860	And that first meant acquiring the System 6000 software.
275260	279980	As with any software, this is software you can find on some places on the internet.
280420	283040	The other thing you need is an RFID encoder.
283040	287860	So, this is the device that the front desk will use to encode a new key card.
288080	291520	Back in 2022, these were very expensive on eBay.
291580	293600	$600 to just get one.
294100	297080	Now, thanks to our research, these have really come down in price.
297080	299740	So, now you can find them for $45 online.
304780	308820	So, the reason they are much cheaper these days is they all have to be replaced.
308820	312000	So, all of the hotels are essentially selling their old encoders online.
312720	315840	So, another thing you need are MiFair Classic 1K cards.
315840	318980	These are very common, very cheap. You can find them everywhere.
319940	325700	And optionally, if you want to actually open some doors, you can also buy on eBay some door locks.
325980	329400	Or an HH6 programmer if you want to play with one of those.
330320	333880	So, now that we have all of the elements for our hotel, we have to set it up.
333880	335980	So, we start by installing the software.
335980	343140	If you open the manual, the installation manual, the first step it tells you is to disable all of the Windows security features.
343140	346060	And then you're good to start running the installer.
346860	352580	Once you've installed the software, you copy over a GDB database file to the installation directory.
352580	354440	And then you can start the software.
355000	357920	This database file is very useful to us.
357920	360140	It's a Firebird database file.
360140	363080	It has a default username and password on there.
363080	366440	And so you can start reading all of the elements in the database.
366440	369880	So, this contains configuration data for your specific hotel.
370180	373900	But also all of the cards that were created by the hotel software.
374220	380940	So, this means that if you create a card, you can go look in the database and look at all of the different fields that are encoded on the card.
382280	386480	Now, as I said, back in 2022, real encoders were very expensive.
386480	394380	But we figured out that this system used to support just commercial RFID reader writers at some point.
394940	400800	So, that means that you can go into the Firebird database and you can set the hide legacy encoders flag to zero.
400800	405060	And now you can use a cheap off-the-shelf encoder essentially.
405320	407760	So, this is what we used back in 2012.
407760	408780	Yeah.
411240	413520	So, about the handheld programmer.
413520	418040	So, as I mentioned before, all of these locks have a mini USB port on the bottom of it.
418040	423040	And obviously, that struck our interest pretty quickly because it's, you know, behind... it's in the hallway.
423660	426340	So, we bought the H86 off of eBay.
427140	429300	And we tried to use it in a lock at first.
429300	432980	And we hit an issue where it detected it was being used at the wrong property.
433140	436160	And so, we were like, okay, there's some kind of authentication here.
436160	442720	But then we quickly realized that if we just changed the property ID in our database to the property we were staying at, it would start working.
444080	446480	And so, there's a lot of interesting features in here.
446480	448180	And we didn't use it too much in our attack.
448180	451740	But the main interesting thing is you can actually interrogate these locks.
451740	454660	And you can view every entry and every exit to the room.
454660	459720	So, for example, you can even see, you know, when housekeeping entered your room, you can see when they left.
459840	461580	You can see the previous guest.
461580	463380	You can see when they were coming and going.
463380	467500	And if you know the property ID, you can actually do this to any door on any hotel.
468140	469900	It was also useful for our purposes.
469900	471840	It will tell you why it refused to open the door.
471840	476060	So, for a long time, we were making fake keycards and we couldn't figure out why it wasn't opening.
476060	479440	But the HH6 will actually tell you, hey, this is why your keycard didn't work.
479440	481500	So, it was very useful for our purposes.
484690	488650	So, the next step was to reverse engineer the System 6000 software.
489350	494310	The software consists out of some Delphi executables, which are very annoying to reverse engineer.
494310	498230	But luckily, there are also some .NET binaries in there.
498230	500430	And those are very easy to reverse engineer.
500430	503610	We can simply decompile them and look at the code in .wik.
504050	506850	Now, we had a few goals for reverse engineering the system.
506850	513670	We wanted to understand how the MIFARE sector keys are derived, how the data stored on the card is encrypted.
514110	519770	And then, once the data is decrypted, what is actually the meaning of the different fields of this data.
520970	523690	So, first, a quick introduction to MIFARE Classic.
523690	527570	Most of the CephLog deployments use MIFARE Classic 1K cards.
527590	532450	These 1K cards have 16 sectors, each containing four 16-byte blocks.
532490	535150	So, they are essentially just storing data.
535690	538750	Block 0 is special. It's the manufacturer block.
538750	542350	It contains the UID and the manufacturer data.
542750	546250	And then, the last block of every sector contains the keys.
546250	550690	So, the keys that you need to authenticate and to read the data on the card.
551030	553570	Every sector has two keys associated to it.
553570	555070	Key A and key B.
555630	562890	And then, essentially, the access conditions indicate what actions you are allowed to perform with either of these keys.
564350	572590	Now, if you look specifically at the CephLog cards, in the case of the CephLog system, all of the interesting data is stored in sector 0.
573190	576570	And the key to read that sector is derived from the UID.
576750	582810	So, all of the keys marked in orange on the slide are unique for every key card, so they always change.
582810	587430	But they are derived from the UID, which is not a very secure way of implementing this.
588070	592830	The key for sector 1 is the same on every CephLog card across all of the deployments.
592830	598910	And that means that if you read one of these cards and you see this key, then you immediately know it's a CephLog system.
600030	602050	So, the key derivation function.
602610	607150	To read the data from the card, we need the keys to authenticate to this sector.
607430	609630	There's a few ways you can get those keys.
609630	615870	You can use a Proxmark3, run hfmfautopwn, and it will immediately spit out all of the keys for you.
616370	620850	The other way to do it is to actually reverse-engineer the key derivation function.
621130	625970	And it turns out that back in 2022, multiple people had already done this.
625970	629030	They had reverse-engineered the KDF, but they hadn't published it.
629190	632090	So, at the time, we had to reverse-engineer it ourselves.
632410	635690	In the meantime, someone has published the KDF.
635690	640670	And now it's also implemented in the Proxmark3 project and in the Flipper0.
642650	648890	It's maybe interesting to know that knowing the KDF is not strictly necessary for our attack.
648890	653050	And that's because there are cryptographic attacks on the MyFairClassic cards.
654410	656570	So, reverse-engineering the KDF.
656570	665030	We figured out that the CephLog card encoder DLL contains a kaba.getSecuredKeys function, which implements this KDF.
665690	670070	Initially, we weren't 100% sure that this is the correct function we wanted to reverse-engineer.
670070	673710	So, we made a simple Python wrapper that uses the DLL.
673850	681330	And then we could feed in some UIDs and check if the response was the same key as what we were seeing in the Proxmark project, essentially.
681770	688210	And then later on, when we were sure this was the correct function, we translated it to Python so that we had our own library for it.
689870	693510	So, now we have a pretty good way of reading the data on the MyFair card.
693510	697810	But, of course, our goal is not just to clone it. We want to modify what rooms the key can open.
698150	705290	And so, we learned that really the only data that matters is the 16 bytes on block 1, which kind of tells the lock which doors the lock can open.
705290	708790	And then the first byte on block 2 is a checksum of the first block.
709170	715290	And so, we wanted to figure out... it looked like the data was encrypted on the sector because we didn't really see anything meaningful in it.
715290	719770	And we found this encryptCard and decryptCard function in the Firebird services DLL.
719770	726010	And so, using that, we discovered that the data on the card was actually encrypted using just a substitution table.
726150	731170	And we unfortunately also learned that that substitution table is the same for every SAFLOC hotel.
731170	736710	So, every SAFLOC installation has the keys to decrypt and encrypt every SAFLOC card.
738610	743410	And so, now we know how to decrypt it. And now we want to start changing what the fields are.
743410	747630	But, we had to decrypt the data, but we still didn't really know what the 16 bytes represented.
747630	751670	Luckily, in the same DLL, we found a function that we didn't think was actually being used.
751670	755590	But, it basically assembled the 16 bytes for an emergency card.
755590	760970	And so, we kind of took a look at this function and saw, you know, what fields is it writing to on sector 1.
761070	768030	And we were able to kind of work from there, work backwards and say, okay, these bytes are the expiration, these bytes are the room number, stuff like that.
768510	770810	And being able to create cards was also very useful.
770810	777610	We had our fake hotel, so we created some cards and we were able to decrypt that data and see, you know, do these fields align with what we expected.
777630	782130	And so, slowly, byte by byte, we figured out what the data was starting to mean.
784590	788710	So, this is the full card data format for the Cephalog systems.
789310	794950	It is in alphabetical order, so if you want to reproduce it, you will have to figure out the correct order of the fields.
795510	798510	There's a few logical fields in here. There's the card creation date.
798510	803230	So, this is, like, up to the second when the card was created at the front desk.
803230	809110	There are card levels, indicating if this is a guest key, a master key, or an emergency key.
809110	810830	There's quite a few of these levels.
811130	815050	There's a few different types of cards, but we'll get into those later on.
815590	819330	There's a deadbolt override bit, which sounds very interesting, obviously.
819330	821750	And then, there's a few more fields.
822250	824130	So, the lock ID is an interesting one.
824130	830190	This is just a numerical indicator in a database linking to a specific lock.
830190	835130	So, you can't simply figure out what the lock ID is for a specific room number.
835450	842190	But if you know the lock ID for your room number, you can sort of guess what the room next door has as a lock ID.
843230	847770	The other thing that we need to know to make cards for every deployment is the property ID.
847850	853030	So, this is a 12-bit number that is supposed to be different for every hotel.
853590	856590	And to make a card for a hotel, you need to know this property ID.
857090	860010	And finally, there's a sequence and combination field.
860010	864030	And this was by far the most annoying field in this entire data format.
864170	868050	And it took us quite a while to figure out how to work around this.
869290	873850	So, as I mentioned before, multiple card levels and card types.
874510	878990	Most of the keys you will get when you check into a hotel will have lower levels.
878990	882330	So, guest keys, connector keys, suite keys, and so on.
882370	885470	And they typically only open a single room in the property.
886590	891750	There are more special cards, like housekeeping keys, that typically open a range of rooms.
891750	894630	So, maybe a floor or a specific tower in the hotel.
895150	898450	And then finally, we get to the interesting ones, like the emergency key.
898450	904970	And the emergency key is interesting, because since it's used for emergencies, it also overrides the deadbolt.
905150	912450	So, if someone inside of the room flips the deadbolt, and someone taps an emergency key on the card, it will allow them to override this deadbolt.
912890	916570	I think it's important to realize if you're staying in a hotel, the deadbolt is just software.
916590	917530	It's not software controlled.
918550	924510	Two more interesting key levels are the primary programming key and secondary programming key.
924970	932570	And we think the idea here is that you would tap one of these cards to a lock, before you can actually reprogram the lock with an H86 programmer.
935240	939080	So, as Leonard said, we spent quite a lot of time on the sequence and combination.
939080	944020	Because we knew what every field meant, but we couldn't figure out the valid sequence and combination for a lock.
944020	948040	So, each lock has its own combination value between 0 and 4095.
948640	953260	And, as Leonard said, you can kind of guess what lock IDs are, but guessing the combination is very painful.
953620	959080	And there's also a sequence number, and so this is used just as you check in and check out, each guest gets their own sequence number.
959080	964100	So, for example, if someone checks in after you, they'll tap their sequence number, and that will invalidate all the previous ones.
964100	969080	So, that prevents, you know, two people from having a valid key to the same room, as that would be pretty bad.
969580	972960	And the field is just the sequence encrypted and combined with a combination.
972960	978540	And, as I said, this is really the only field that gave us any trouble in making a valid guest key.
979800	982580	At first, we tried to brute force the field.
982900	989160	Leonard tapped the Proxmark about 4,000 times, trying to guess what the valid sequence number was.
989200	991520	This doesn't work. I don't suggest it.
991540	996820	The lock does detect that you're trying to just guess key cards, and it kind of shuts itself down.
996820	999440	It's also very physically strenuous and annoying.
1001000	1005600	Later, kind of the crux of our discovery was that we found that, because these locks are offline,
1005600	1009660	they sometimes have to be re-sequenced if they become desynchronized with the front desk.
1010260	1013380	And what a re-sequencing card does is it just simply tells the lock,
1013380	1016060	hey, this is your new sequence, and this is your new combination.
1016120	1018860	And that's perfect for us, because those were the only two fields we didn't know.
1018860	1023180	So, we were able to create a key card that simply re-sequenced this lock and tells it,
1023180	1027020	hey, this is your new secret value, and that's the only one you need to create a forged key card.
1029440	1032580	So, now we have all the elements to make a full attack.
1032900	1038340	So, the idea is that you would start by obtaining any card from the hotel, just to get the property ID.
1038480	1041680	This can be your own card. This can be an expired card.
1041680	1046700	It can be a card you found on the floor, from the express checkout box, or simply one you bought from eBay.
1047560	1051340	So, once you have the property ID, we can start forging keys.
1051340	1057540	So, we forge a re-sequencing key card for a privileged level, so emergency or grandmaster.
1057540	1061800	And the reason for picking emergency is that it works on all of the doors.
1061800	1064080	So, you don't have to guess a lock ID anymore.
1065200	1070520	Then, you walk up to a door, you tap your re-sequencing key card, it re-sequences the lock,
1070520	1075640	and then you have your second key card that has an opening key for the same level, and it will open the door.
1076040	1079900	And the nice thing is, you make this pair of cards once for every property,
1079900	1084020	and you can now walk around and open every single door in the hotel.
1091960	1096180	So, of course, we also implemented this as a full proof of concept attack.
1096300	1099540	At this point, we had already written a PySafelock module.
1099580	1104780	So, it's a Python module that supports doing the key derivation function, decrypting the card data,
1104780	1107140	deserializing it into the different fields.
1107140	1113520	Then, we can change fields, re-encrypt it, or re-serialize it, re-encrypt it, and then write it back to a card.
1113880	1119360	And instead of implementing all of this within the Proxmark codebase, since we already had the Python script,
1119360	1126080	we sort of made simple wrapper functions that call Proxmark code to read and write stuff to a card.
1126740	1132120	Then, obviously, these days we have to implement the same thing on a Flipper 0.
1132200	1134420	This was relatively straightforward.
1134740	1141160	You can make an NFC-supported card plugin, and that essentially has to implement three functions.
1141240	1148060	So, the first function is verify, and that's essentially a function that tries to verify if the card you tapped is a Safelock card.
1148060	1155360	As I mentioned earlier, Sector 1 has a default key, and you can use that default key to detect if the card is a Safelock card.
1155740	1159340	Now that you should have a Safelock card, you go to the read function.
1159520	1165660	The read function derives the key, so implements the KDF, and then reads the relevant data blocks.
1166120	1170320	Now that you have those data blocks, you can decrypt them, parse out the data,
1170320	1176500	and then from there generate, re-sequence an emergency card that gets stored on the Flipper's file system.
1177480	1181340	Before anyone asks, we are not releasing this plugin.
1181980	1185660	But there is a KDF plugin available on GitHub that someone else made,
1185660	1190440	and you can actually use that plugin to check if you're staying at a Safelock hotel.
1193790	1197550	So, as I mentioned previously, we actually found this at DEF CON two years ago,
1197550	1200570	and it was a very long disclosure process.
1200970	1205710	So, in August, we kind of found the decryption key, and we were able to read and write to the card,
1205710	1209290	but we didn't actually figure out the re-sequencing thing until a month later.
1209810	1215170	Finally, we were able to figure that out, and we created a complete proof of concept.
1215350	1221050	Unfortunately, Dorma Kava didn't have any disclosure process, and so I had to message their CSO on LinkedIn.
1222290	1225270	Luckily, he actually took it seriously and responded quickly.
1225390	1228370	And they actually have a VDP now, I think, which is great.
1228870	1232210	We had our first meeting with them in October,
1232210	1235990	and from there, I think we had at least 13 meetings with Dorma Kava
1235990	1239070	talking about the vulnerability and how they were going to fix it.
1239450	1241650	As I mentioned, it's three million hotel locks,
1241650	1245870	and I don't think they were fully ready to do that upgrade for a while,
1245870	1248110	and it was quite a painful change.
1248570	1253510	But in November of 2023, they upgraded the first hotels to resolve the vulnerability, which was great.
1254110	1256890	And then, as you may have seen, in March of 2024,
1256890	1261310	we did a limited disclosure of saying, you know, these hotel locks have a vulnerability,
1261310	1263570	but, you know, we're not going to say exactly what it is.
1263910	1267530	At the time we published it, 36% of the locks have been upgraded.
1268330	1269930	Today is our DEF CON talk.
1270070	1272510	They only told us the majority of the locks have been updated.
1272510	1274550	We don't have a specific percentage anymore.
1274870	1281690	And they said nearly all Las Vegas properties are in the process of being mitigated or have been mitigated, more or less.
1285190	1290470	Remediation, they added a new enhanced security mode, and this is to their Ambion software.
1290470	1292650	So we mostly looked at System 6000.
1292810	1294330	That's kind of deprecated now.
1294330	1298110	There is a fix for it, but it's not as good as the enhanced security mode.
1298490	1301010	The enhanced security mode has a new KDF.
1301030	1306010	It encrypts the card data using AES, which is much better than a hard-coded substitution cipher.
1306630	1310790	And it also uses MyFair Ultralight C, so even if you're able to decrypt the card data,
1310790	1314270	it's still hard to actually write it to the card because you don't know the card keys.
1314670	1317810	And as I mentioned previously, they also replaced all of the encoders.
1317810	1322130	And so there's a new encoder for making the keys that also has a secure element inside of it.
1325270	1328770	So a lot of people ask us, why did it take so long to fix these hotel locks?
1328770	1330230	Why did it take two years?
1330510	1333630	And it turns out that the main issue are the integrations.
1333630	1337670	So of course, first, Tomacabra had to come up with a fix for their own hotel locks.
1337810	1341330	But then if you start thinking about especially big Las Vegas properties,
1341330	1344170	they have so many integrations with the hotel locks.
1344310	1346590	So maybe you use the kiosk to check in.
1346810	1348630	You've used the elevators.
1348710	1350910	There's payment solutions in some hotels.
1350910	1353130	And some hotels even have towel machines.
1353690	1359210	And so when a hotel decides to upgrade their hotel locks, all of these systems have to be upgraded as well.
1359210	1362690	And that typically means that they have to contact the manufacturers of these systems.
1362690	1365110	And so you can imagine this takes a long time.
1366690	1369090	Most of the locks have to be updated manually.
1369090	1373910	That means that someone has to walk up to the door and hold the programmer in front of the lock for two minutes.
1374250	1378030	Three million locks times two minutes is a lot of minutes.
1378030	1379950	So it takes a long time.
1380710	1385950	Then additionally, you have to convince property owners to perform this update.
1385950	1389410	And that's also one of the reasons we had this limited disclosure initially.
1389410	1394630	To make hotel owners aware of the vulnerability and give them some extra time to implement the fix.
1394630	1402670	We were told that at the peak of deploying this fix, Tomacabo was resolving 500 properties per week.
1404090	1411050	Another thing that has changed now in the new update is that the standard guest cards will be using Ultralight-C.
1411610	1420350	And one of the reasons people are making the switch over to Ultralight-C now is that the cost of Ultralight-C cards has come down a lot over the last few years.
1420350	1425030	So if we talk about card cost, we found a few statistics online.
1425550	1429350	So on average, a hotel is occupied 65%.
1430570	1434810	An average stay at a hotel takes 1.8 nights.
1434990	1438670	The average number of cards that gets made per stay is two.
1438830	1443270	And only 25% of all cards are returned when you check out.
1443590	1448890	Now if we think about big Las Vegas properties that have between 3,000 and 7,000 rooms,
1448890	1450830	then you can imagine they make a lot of cards.
1450830	1462670	So if we do a bit of simple math, then we end up with a hotel with 5,000 rooms having roughly 660,000 stays per year.
1462810	1471810	That means that around 1.3 million cards are made at one of these big properties, of which only 300,000 are being returned after stays.
1471950	1476910	So that means that a hotel needs to buy roughly 1 million cards per year.
1476910	1482230	If you assume $0.10 per card, that's $100,000 just in RFID cards.
1482570	1487990	Now if you think about a MyFair Classic card, which is very cheap, and maybe those were $0.10,
1487990	1495410	if an Ultralight C card a few years back was $0.20, then that would mean $200,000 in cards.
1495410	1498870	And that's the reason you still find a lot of MyFair Classic cards around.
1499510	1506470	But luckily, prices have been coming down, also because there's more of these systems asking for Ultralight C cards.
1506910	1511750	So they've become cheap enough to the point where hotels are now using Ultralight C.
1513270	1516530	So I guess most of the people in this room are staying at a hotel this week.
1516530	1521850	So how can you tell if the hotel you're staying at is using CephLock and if it's fixed or not?
1522630	1526590	It's relatively easy to see if a hotel is using CephLock.
1526590	1528910	Typically, you can only tell when you're checking in.
1528910	1532170	If you look over the counter, you can see the encoders.
1532470	1535450	So we have two pictures of encoders on the slide here.
1535450	1538230	The leftmost one is an old encoder.
1538270	1540010	It's thicker, it's bigger.
1540250	1542470	And the one on the right is a new one.
1542950	1546030	Now, if you see the old one, you know it's a vulnerable system.
1546210	1553910	If you see the new one, it could be a fixed system or it can be a system that is in the progress of being mitigated to the new solution.
1554650	1558790	You can also quickly recognize the locks that are used in these systems.
1558790	1564450	So the small black puck-type lock with the S going to it is very common here.
1565350	1567430	And those are CephLock locks.
1567430	1570490	So if you see those, you know it's a CephLock system.
1571330	1575770	Then the next thing you can do is you get a card from when checking in.
1575770	1579410	You can tell if it's a Mifac Classic or an Ultralight C card.
1580170	1585450	So then you use your favorite RFID tool, which we all know is the Flipper Zero with Iceman firmware.
1586390	1591950	Or you use an Android phone with the NFC Tag Info app, and that allows you to tell what type of card it is.
1593130	1598230	So if it's a Mifac Classic card, then you know that the system is still vulnerable to this attack.
1598690	1603450	Or it's not a CephLock deployment, so you have to really do all three of the steps.
1605370	1607610	So how to protect yourself in a hotel?
1607610	1611410	You see it's CephLock, you see it's Mifac Classic, well you're probably screwed.
1612210	1614410	But there's some things you can buy.
1615210	1619950	There's a door bolt deadbolt Velcro strap, and that kind of holds the deadbolt closed.
1619950	1622030	And so that kind of prevents it from opening externally.
1622410	1627110	You can also get under door wedges, which kind of drill themselves into the carpet and prevent the door from opening.
1627550	1630670	Obviously these are kind of hacks, but they could be good if you travel a lot.
1630750	1633910	And Deviant has some great videos about hotel security as well.
1633910	1639570	And just in general, even if you're not staying in a CephLock hotel, maybe next year there will be more vulnerabilities.
1641870	1648130	So that's it. Summary, reading a single card at a hotel allows us to open any door at the property if it's vulnerable.
1648690	1651330	This system has been in use since 1988.
1651890	1657370	You'd say, hey, they didn't have Mifac Classic back then, and it's true, but they did the same thing for MagStripe cards.
1657370	1662630	So unfortunately the system has been vulnerable since before Leonard and I were even born.
1665810	1669230	And many aspects of these systems still haven't been looked at.
1669230	1673990	Once we found a way to make these master keys, we didn't really care about the rest of it.
1674010	1677130	But there's a wide scope. The locks have USB ports.
1677850	1682430	There's many, many aspects to these systems, and more vulnerabilities likely exist somewhere.
1683110	1685630	Luckily, the cost of the secure cards have come down a lot.
1685630	1687910	Ultralight C, Deathfire, stuff like that.
1688110	1691690	Obviously it's a lot better than using Mifac Classic, which has been broken forever.
1692190	1697370	And overall, even though we had to message them on LinkedIn at first that we did have a positive experience working with Dorma Kava,
1697370	1701130	they didn't take it seriously, and they didn't sue me, so that's always great.
1702490	1703830	It's time for a demo.
1714260	1718720	Okay, we have two demos. We're going to attempt to show two demos.
1727100	1730280	So for the first demo, we'll be using the Proxmark 3.
1733660	1736380	I have a few RFID cards here.
1736660	1738400	One of them says valid.
1742500	1744620	As you can tell, it opens the lock.
1744800	1748720	Now, if someone is staying inside of the room and they have the deadbolt on,
1748720	1751180	then this card no longer works.
1753740	1757340	So that's the normal behavior of regular guest cards.
1759120	1762580	The second card I have says expired or invalid.
1767310	1769230	And that card obviously doesn't work.
1769570	1772670	So let's assume that this is the card the attacker finds in the hallway,
1772670	1775170	or it's maybe the card to their room.
1776490	1780290	And finally, I have the two attacker cards labeled 1 and 2.
1780430	1783150	And just to show you that I'm not cheating for the demo,
1783150	1785650	I'll tap these to the lock and show that the lock doesn't open.
1791730	1796830	Okay, so now we'll start by reading the expired or the invalid card with the Proxmark.
1802440	1806100	So what we do here is we take the UID that we read from the card,
1806100	1808740	we derive the key for the sectors,
1808740	1812880	we read the data from the card, we decrypt it, we deserialize it,
1812880	1816140	and here we're printing a few of the fields that are stored on the card.
1816320	1819740	So you can see this is a level 1 card, so it's a regular guest key.
1819820	1822520	It was made for the lead room.
1822800	1825480	And you can also see that the card was created in 1990.
1825780	1829720	And that means the card is expired, and that's why it no longer works on this lock.
1830100	1833320	Now, what we really need from this card is the property ID.
1833320	1837240	And using this property ID, we can now start making new cards.
1839780	1842640	So I'll first reprogram the first card.
1846010	1851050	So what we're making now is an emergency level re-sequence card.
1851630	1853830	So that's the re-sequencing key.
1856430	1859830	And the next key we make is an opening key.
1861950	1864910	And now we're ready to break into hotel rooms.
1864910	1868610	I'm going to assume the person that's staying in this room has the deadbolt turned on,
1868610	1870510	and then we'll start carrying out the attack.
1874440	1879320	So the first key re-sequences the lock, and essentially enables the second card.
1895490	1899170	And like I mentioned before, you can use these two cards over and over again
1899170	1902250	in the same property and open all of the doors.
1903190	1907130	Now the second demo is essentially the same thing, but using the flipper 0.
1908870	1911230	I hope it's visible on the screen.
1911230	1914610	But the idea is that whatever I'm doing here on the flipper
1914610	1917310	is the same thing as you see on the screen over there.
1917650	1920650	So essentially we just go into the NFC menu.
1922750	1925210	I'm using the expired card again.
1927950	1930690	So I'll read the expired card.
1937110	1941650	It tells us it's a Zephyr card, we can again see the card level,
1941650	1946610	the property ID, the lock ID, and that this card was created in the 1990s.
1947710	1949750	And in the background, what this flipper app has done
1949750	1953930	is it has automatically created two extra cards.
1953930	1957270	So this first entry is a copy of the card we just read.
1957490	1960130	And then the second one is the re-sequencing key.
1960130	1962350	So we can start emulating this one.
1966780	1967740	So now...
1970720	1972960	Now the lock has been re-sequenced.
1973280	1977860	We go back into the menu, we take our opening key, we emulate it.
1981870	1983710	And it opens the lock.
1992380	1994840	So thanks everyone for coming to the talk.
1994840	1997700	If anyone has questions, we'll try to answer them.
2009850	2011710	I'm too short for this, hello.
2012410	2015590	Is that the Iceman firmware up there?
2016070	2018490	Yeah, it's a special beta release.
2018670	2021310	Alright. Okay, actual question.
2022970	2027790	Considering what you said about the software from Dormakaba,
2028190	2031690	do you think the responsibility lies on Dormakaba or the hotels
2031690	2034510	for how long it's taking them to upgrade their systems?
2034510	2039130	Thinking about the logging and even the encryption method used for their cards.
2040330	2042270	That's a good question.
2042990	2046650	We also don't know entirely how Dormakaba is handling the...
2047290	2049570	resolving or doing the updates.
2049570	2053490	How much hotels have to pay, how much Dormakaba pays and so on.
2054070	2058090	I think the logging stuff is more an idea we came up with ourselves.
2058090	2063530	Our idea was if the front desk can see logs of who is entering the rooms and so on,
2063530	2069090	then in theory it shouldn't be too difficult to check if someone is using a re-sequencing card, for example.
2069090	2072550	And you could have some alerts triggered when something like that happens.
2072670	2077650	And then Ian, I heard you were a degenerate gambler. Are you up or down?
2077650	2079810	I think I'm even now.
2086370	2087750	What's going on?
2087950	2090830	Thank you so much for talking about the disclosure process
2090830	2096150	and explaining all the other factors that weigh on timelines and things like that.
2096230	2099910	It's really important for all the researchers to understand that and I think it's wonderful.
2099910	2104210	Did you find the process of working with them to be smooth the whole time?
2104210	2107390	Or was it like smooth with an executive and then like lawyers?
2107770	2109010	How did that go?
2110070	2113610	They did ask us to sign an NDA at first, but we said no.
2113610	2115850	And from there it was pretty good.
2116350	2121390	I think obviously it was one of their first times going through this process.
2121390	2128010	And so we just had to set our expectations of like we're eventually going to disclose this and it needs to be fixed.
2128010	2131330	And I think once we all understood that it was okay.
2131350	2133830	They never threatened to sue us or anything.
2133830	2135690	So it was never hostile at all.
2135690	2138170	Cool. We're really proud of you. Thank you guys.
2138170	2140870	I'll just add that I think for them it was very new.
2141630	2142430	Thanks.
2144110	2150230	And like the picture you see in this slide is actually a video set that they had at their facilities.
2150830	2154750	And on the website, on unsafelock.com, we have a small video showing the attack.
2154750	2158310	And that video was actually shot at a facility from Dormakado.
2160210	2161710	Thank you to them for that.
2163730	2167550	Did you say that the substitution table was the same for every property?
2167550	2169710	So you said they replaced that with AES?
2170550	2173150	In the enhanced mode it uses AES.
2173150	2179330	I think they made, if you're still using the old system 6000, my understanding is it's no longer a substitution table.
2179330	2181090	I don't know if it uses AES.
2181390	2186090	But it's something that's specific to each hotel at least, which is better than what they had before.
2186090	2189430	That was my question. Are the keys now specific to each property?
2189710	2191450	Or do you know one way or the other?
2191450	2192630	That's our understanding.
2193390	2195250	Fingers crossed. All right. Thank you.
2197550	2207050	Hi. So you mentioned when you re-sequence a lock, it invalidates all of the existing cards with, I'm assuming, lower sequence numbers.
2207050	2211830	Does that also happen with the emergency card that you re-sequenced the lock with?
2214490	2218910	So I think you were asking about invalidating older cards and sequence numbers, right?
2218910	2219210	Yeah.
2220370	2226070	So the idea, or at least the way we think it works, is if you check in at the hotel, the sequence gets incremented.
2226090	2232090	And once a lock sees a higher sequence number, it stops accepting older sequence numbers.
2232090	2234870	And the same thing is probably true for emergency cards.
2235010	2242030	But since our first card re-sequences the lock and tells it, this is now your sequence number, we can then use our lock.
2242030	2245630	So the re-sequencing card can have any sequence number you want.
2246090	2252910	So then the older cards that worked on the lock before that will get invalidated as a result?
2253010	2254310	I couldn't get it.
2254510	2258390	So I think you're asking if we do our attack, do the guest key cards get invalidated?
2258510	2262670	So the sequence is specific to each level. So in our attack, we're doing the emergency key cards.
2262670	2267370	So it would break the emergency key cards for the hotel, but the guest keys would be unaffected.
2268890	2270330	Gotcha. Thank you.
2271050	2272250	Thank you.
2275330	2280810	Is it possible to brute force the property ID so then you wouldn't need another key from the same hotel?
2282630	2287890	We could speculate that there's a way to do it. I don't know if I would do it via brute forcing because it is pretty painful.
2287890	2291450	You have to physically move the device across the lock each time.
2291790	2297470	But as I said, the USB port seemed pretty interesting to us and there may be a way to get that info from it.
2297470	2299770	We just didn't look at that surface at all really.
2300190	2300870	Thanks.
2302730	2310570	Two questions. One, are you staying at Resort World? Two, is Resort World a Safelock hotel?
2312570	2314970	I'm sorry, I couldn't hear the question.
2314970	2319030	The second one was, is Resort World a Safelock hotel?
2319570	2327510	Yeah, we've both stayed at Resort World and we believe it's been fixed there. I believe all the cards are ultra latency there.
2331130	2342110	So for the legacy encoder that Dorma Kaba is replacing, it appears that that can also write ultralight C. So do you know why they replaced that encoder?
2343770	2347470	I'm sorry, I think the mic is a little low, so I'm having trouble hearing the question. Sorry.
2347470	2357450	Sorry. I was saying, so for the legacy encoder that Dorma Kaba is replacing, it appears that with the System 6000 software, it can also read and write the ultralight C cards.
2357510	2361470	So do you know what additional security they got by replacing it?
2362330	2376670	They told us that they added a secure element to the new encoder. We didn't look and they didn't tell us exactly how that's used. But I think that was part of the reason. I'm not sure if the old encoder supported ultralight C or not as well. I'm not sure.
2376670	2390270	I think the older system supported other cards, not just MyFair Classic. I think they had even support for ultralight for a while. It's just no one really seemed to use it. Like all of the SAF log deployments we've seen were MyFair Classic.
2390810	2392050	Thank you. Awesome talk.
2394270	2402090	Hi, I read my photos card and it's not MyFair, but it's ST-CHIP. Do you know if it's vulnerable or not?
2402970	2404210	ST-CHIP?
2404910	2407530	It's quite difficult to understand the questions up here.
2407530	2411810	I have a card with ST-CHIP, not MyFair. Did you look at those?
2412730	2418750	I haven't looked at any hotels that had ST-CHIPs in them, but maybe Iceman knows about this specific card for a moment.
2421430	2422750	I don't know, sorry.
2422910	2423970	Okay, thank you.
2434830	2438070	Hi, I'm Iceman. I have a question to you.
2440410	2448190	No, the SD card is not vulnerable in that sense. Yes, it's true. But Benjamin Dipli did some work with it.
2448570	2455310	Awesome fucking research. I'm in awe by it. It's amazing.
2456750	2460090	I bow to the gods of 3D hacking.
2464070	2471830	But to be honest, it was MyFair Classic and it did have .NET. So I think that's cheating. I thought you would have done more hardware.
2472750	2478530	With that said, give them a well-rounded applause for us. They are fucking amazing.
2485280	2486680	I guess that's it.
2486680	2488580	Alright, thank you so much. Appreciate it.
