start	end	text
2420	7840	Hello, DEF CON. Thank you for being here on a Saturday morning. I know everyone was partying
7840	13560	yesterday until 5 a.m. probably, so I'm glad that you're here. So yeah, now we're talking
13560	18880	about our talk, open CSAM, or how secure is your stuff in your lockers. And this is the
18880	23620	main question, basically, which we will talk through the talk. As you might have heard,
23620	28580	there have been some issues with the talk in the past, so I will address it later. So
28580	35600	before we start with the topic, let me introduce myself real quick. So I'm Dennis, I'm a security
35600	41000	researcher or also a hardware hacker. And I basically am interested in wireless and
41000	44560	embedded security and privacy. So I take a look at all kinds of interesting devices which
44560	51180	are around me. Primarily this is vacuum robots, but I generally look at all kinds of things.
51460	55540	That's why I call myself also a vacuum robot and IoT collector, so I have probably way
55540	63360	over 600, 700 devices and 60 or 70 vacuum robots by now. So my main goal typically is
63360	67540	to root vacuum robots, but again, I look at all the other things. And if you're interested
67540	73080	in vacuum robots, by the way, I have a website which documents all the hardware and everything.
75320	81720	One thing which is kind of new in the slides, so I have been a target of a cease and desist
81720	87060	at DEF CON, so I think this is like a, you know, interesting thing. Which by the way
87060	92380	was withdrawn as today in the morning or at night, so yeah. And now we would like to introduce
92380	93140	Braylyn.
96340	101980	Cool. Hi, I'm Braylyn. I hack things for the Leviathan security group during the day, but
101980	105840	I'm here representing myself as an independent security researcher and this talk does not
105840	112100	reflect their views. My general focus has been application security and APIs, but I've
112100	118340	started hardware hacking for fun. Looking at things like robots, cameras, and smart
118340	124240	locks. And this is my first DEF CON talk and I was also named in the cease and desist,
124240	126860	so that's pretty fun.
132370	136270	All right. So let's talk about some previous work. So this is not necessarily the first
136270	140310	lock which we took a look at. Like exactly ten years ago, well, a little bit more than
140310	145050	ten years ago, I was working on a group which looked at Siemens and Foss door locks and
145050	150870	we published a paper about that. Also some while ago I was taking a look at Schlage electronic
150870	155110	locks which you find especially in America, like, you know, in government buildings, universities.
157390	161830	So what are the goals of this talk? Well, first we want to give you some overview of
161830	166630	the reverse engineering of digilock and SAG locks. We want to tell you something about
166630	172430	vulnerabilities and we want to show you some ideas and methods how you can extract typically
172430	177670	firmware and configurations from that kind of devices. One thing which is the most important
177670	182630	part of this talk is basically we want to raise awareness about pin numbers. As a general
182630	187650	side note, we use digilock and SAG as examples and we're not claiming that they're more or
187650	191630	less secure than other companies. We're kind of just unlucky that they're one of the market
191630	196910	leaders and that they build good products. So, yeah, so we basically have chosen them
196910	200110	because they have a good reputation, they have a quality of products, we just might
200110	205030	have made some mistakes. We reported the things also to the vendors and digilock is
205030	209430	actively working on fixing the issues and I will tell, give you some information later
209430	217270	on that. So, about this talk. It's basically a continuation of my Nulcon talk at Nulcon
217270	223110	Berlin 24. The focus, and this is the important part, on offline locks which are managed,
223110	226850	so if there's like a master key or something, if you think of a gem or, you know, master
226850	231610	key systems. And we do not cover a couple of things. For example, we do not cover management
231610	236710	software, we do not cover reprovisioning, so how to, you know, factory reset the lock. We
236710	241770	also don't talk about physical attacks using magnets or destructive attacks like drilling,
241770	247090	you know, decapping, all other kinds of things. And later on, we have included a statement
247090	253890	of digilock in regard to their cease and desist. All right, so what is our motivation here?
253890	260230	So, generally, back when I was, you know, looking at locks, I realized quite quickly
260230	265550	that hacking locks is not that, you know, new. There's a lot of people who were hacking
265550	269590	like high security locks, so a lot of researchers were kind of focusing on that, especially
269590	274870	like safe locks, because there's probably very important stuff in there. A lot of research
274870	279290	has been put into side channel attacks, you know, safes contain expensive things, and
279290	285090	the impact is like very high if they're insecure. The general problem is for, you know, manufacturers
285090	288450	or for even companies who have this kind of devices, it's very hard to defend against
288450	293030	physical attacks and highly motivated attackers. So, if I'm an attacker, if I have unlimited
293030	298970	time and money, then I will get into whatever it is. In regard to consumer devices, it's
298970	303670	slightly different. Consumer locks, safes and cabinets are known to be bad, and there's
303670	308150	mechanical flaws, there's trivial bypasses using magnets and other things, and there's
308150	313210	insecure software. I have an example here from one of my favourite YouTubers, a lock-picking
313210	318770	lawyer, where he has a gun safe kind of thing where you put the gun in, and you just pry
318770	323970	open the plastic handle and you can just pull the gun out, you don't care about the lock.
326190	332390	Sometimes you don't need to even attack locks, there's other ways around that. Okay. So,
332990	338090	how did we start with this particular research? So I was in the University around 2018, and
338090	343410	they introduced lockers in the labs. One of the ideas was you can put your stuff in,
343410	347170	and you just choose your own pen, lock it, and if you come back, you unlock it again
347170	351550	and the next one can use it. But also, when we were travelling around, we saw these locks
351550	356750	in many, many co-working spaces, banks, airports, hotels, gyms, so we were literally everywhere.
356850	363310	At some point, you develop an eye for interesting things around you. And one thing which we
363310	367070	figured out very quickly is there's only a few widely used vendors which are out there,
367070	372330	so there's groups in the US in particular, like Digilock, or in Europe, SAG, there's
372330	377350	some very limited kind of vendors out there. And these kind of locks, they stay for a very,
377350	381830	very long time in use, because why would you change a gym lock after five years, or after
381830	385830	four years, or whatever? These things typically stay in use for ten years, 20 years, until
385830	391890	they're broken, basically. Okay. The question is now why do we hack cabinet lockers, or
391890	396810	lockers generally, and not saves? Well, lockers and cabinets are basically everywhere, and
396810	401210	they're used in public spaces, or spaces which are accessible to the public, or shared workspaces.
401670	404450	And there might be many reasons why you want to hack them. For example, you forgot your
404450	410230	pin, you lost your key, or you do a red team penetration test. Also, sometimes the audit
410230	415790	locks are not super correct, so you want to correct them. And they might contain a lot
415790	419850	of interesting stuff, including our own. And this is what I want to say, one of the reasons
419850	423330	why we do the research is because we're kind of slightly annoyed because our stuff is also
423330	427150	about kind of lockers, so this is one big motivation from us. So what kind of things
427150	431670	do you might store there? Well, you might store your backpack, laptop, employee ID,
431670	438630	phone, keys, money, credit cards, USB sticks, important documents, your bitcoins, or candy.
439450	444230	So the question is, well, did you use the same pin which you used to lock the locker
444230	454740	also for your phone, notebook, or credit card? Quick survey, who has a friend that does this?
454740	459860	Who reuses their pins? No, you're not supposed to admit that.
461960	465260	To be fair, I mean, in the beginning, before I was doing the research, I caught myself
465260	470780	using the same pin all over again, so it gets a little bit complicated. Anyway, so what
470780	475220	kind of attack ideas do we have, and how do we do it? So what are we looking for generally
475220	479840	in this kind of devices? Well, we try to extract somehow the firmware, because firmware can
479840	484560	give us some secret backdoors or bugs. It helps us to understand functionality, and
484560	489740	it can allow an attacker to create custom firmware. You know, like basically de-clouding
489740	495180	or n-certification of your smart locks. The other thing is, which is obviously the crown
495180	501960	jewel here, is the interesting data in terms of key IDs, user pins, RFID IDs, or lock files.
502540	506920	And the other thing, if you do lockpicking, you know you try to find any easy way to bypass
506920	513200	things into open locks. So, our idea, and this is why we want to kind of stress on that,
513200	516540	it's not necessary that we want to steal your stuff, but we don't want to steal your stuff
516540	521200	anyway, but I mean, theoretically as attackers. But lateral movement, and that's the core
521200	526420	idea of our talk. So how do we do it? So we have in this particular example three cabinets,
526420	529980	basically one of them is open, two of them are locked, one is locked with a pin, the other
529980	534380	one is locked with an RFID. And so what we do is we try to extract the manager key from the
534380	538200	locker which is open. As soon as we have the manager key, this is like a key which you use
538200	541620	to kind of unlock the locker, to audit things in there so that there's nothing, you know,
541620	546540	like the Defcon hotel, it's like sketchy things, your flipper. And you can lock it again
546540	551480	without resetting the pin. So, by having this manager key, what we can do is basically we
551480	558020	can unlock other lockers, and we can extract from the lockers, like with the pin, we can
558020	562940	extract the user pin. At the same time, we can obviously access whatever is in the locker.
562940	566420	So, if you have a laptop in there, and if you have your phone in there, well, we might be
566420	570900	able to use the pin which you use to lock the locker to, you know, unlock that. But it gets
570900	576640	even more interesting because, well, we can also extract the RFID, you know, ID or secret,
576640	582020	in some cases, from a lock which was used to lock the locker with an RFID or employee badge.
582120	585620	And then we can go to an interesting door, like a server room or something, and can use that
585620	590880	to unlock that. Especially SAG, they use test fire encryption, so they store the keys,
590880	596180	which gets very, very interesting here. All right, so how do you get that kind of locks?
596180	600900	What's the logistics behind that? The problem is, if you do that kind of research, you need to
600900	606340	invest a lot of time and money, and experiments typically require multiple devices. And you
606340	610840	obviously cannot use someone else's property because there might be one or two bricks in the
610840	616340	process of reverse engineering that. These locks are also expensive, so typically you pay
616340	622420	more than $100 for a lock and more than $50 for a key, or way more than $50. We will talk about
622420	628520	that later. But the good thing was, for us, there's surplus on eBay. And it's a little mean,
628520	632200	but COVID kind of helped us a little bit because a lot of gyms kind of got bankrupt, so they kind
632200	637440	of offset their locks and other things on eBay. And we got a lot of cheap provisioned locks,
637440	640740	so locks which were already provisioned to some manager key or programming key,
640740	645040	which we were able to play around with. And the other thing is, especially in Germany,
645040	650220	we got a lot of locks from failed projects. Basically, we have a big gym, which didn't
650220	654080	happen, so we had stacks and stacks of these locks, and we kind of sell them on eBay for a
654080	660600	cheap price. So we spent probably more than $1,000 or $2,000 on buying random locks, which
660600	666300	we don't even have so many lockers for. So as mentioned, we were going on a shopping tour on
666300	673500	eBay and bought a lot of locks. So let's talk about the DigiLock ecosystem, and this is our
673500	679120	first candidate for which devices we looked at. So DigiLock itself, we're like a brand of
679120	683020	Security People Inc., which is U.S.-based, and they are in the industry for a very, very long
683020	687400	time. So they're very experienced, especially also with mechanical locks. They call themselves
687400	691220	the global leader in keyless lock solutions, and they have many different bands of locks.
691220	694440	So they have connected locks, which we're not talking about. We have offline locks. We have
694440	699560	mechanical locks. And as access media, you can use RFIDs, the pins, key fobs,
699560	703580	smartphones with the newest generation. And you might see them under different brands. For
703580	707940	example, DigiLock, Nex, Numeris, so there's different ones. If you take a look at their
707940	712060	website, I mean, they kind of say we're literally in all the industries, which is like, I mean,
712060	715860	that's the reason why we kind of saw them in the first place, because we're in education,
715860	719560	in gyms, in some professional sports organizations, so we're literally everywhere.
720560	725140	The way how you can typically identify them is, this is some examples right now,
725140	730520	by the three-pin connector, which we use, which is very specific for DigiLock. Other lock vendors
730520	733660	use slightly different kind of connectors, but this is like a thing, if you see that,
733660	737600	it's kind of like, you know, kind of know what it is. If you take a look at the lock hardware
737600	743180	itself, the good thing for us is that they use more or less the same or very similar hardware,
743180	747060	so they use a similar type of MCU. So if you're kind of familiar with one of them, you kind of
747060	752040	know how the others work in a way. So this makes it also a great kind of thing for us as reverse
752040	757460	engineers. And they didn't have tamper switches, so if you just assemble one, then there's nothing
757460	763640	which triggers, which is, by the way, very, very normal for low security or middle security locks.
763640	768080	Only safe locks have some tamper switches and other things. The lock state is controlled by
768080	771180	the latch, which is kind of interesting for us, and we'll kind of talk about that later.
772100	775580	And because we have so much experience with mechanical locks, we added a lot of mechanical
776440	780220	protections against physical attacks. So for example, you cannot use bypassing things. We
780220	783920	tried a couple things with needles, so there's no way to kind of, you know, bypass things. So we
783920	788980	did a very good job there. The features which you get per lock are kind of dependent on the brand,
788980	794440	so some of them support audit locks, so you can basically record who opened or locked the locker.
794860	799560	And they have assigned and shared locker functionality, which means sometimes you can
799560	804580	give an employee just one locker and only that person can use it, or you have a scenario like
804580	809040	in the gym. If you take a look closer at the hardware, one thing which is kind of great for
809040	814120	us is all of them have a PIC programming interface exposed. Many of them have EEPROM. We have
814120	819560	obviously an MCU. We have a connection to the inside unit, which kind of contains the latch
819560	825040	and the motor, and it gets also power from there. We have a piezo for the sound. And the most
825480	829860	interesting thing for us was the interface. As you see, we soldered some wires to that to kind
829860	836560	of intercept that, which is basically one wire. Hardware-wise, if you take a closer look at the
836560	841860	microcontrollers, we use most of the time PIC18 controllers, but sometimes, especially newer
841860	847860	models, we use PIC24s. We have EEPROM for audit locks and for credential storage in some of them
847860	855440	devices. And if you have a device which supports RFIDs, you have an ST controller for NFCs.
855560	862720	All the newer ones have a logic IC, which is also an HSM. And from what they told us, basically,
862720	867680	in new generations of these locks, we use the HSM to store some kind of secrets, which we can
867680	872700	confirm because it's not on eBay right now. So I need to wait until it shows up on eBay.
874740	879520	So if you look inside at the locker hardware, the thing which was for me, as someone who's
879520	883940	like doing physical security for quite a while, is like it's extremely well-built and engineered.
884240	887700	And what I mentioned before is that the inside lock kind of defines if it's locked or unlocked.
887700	893820	You have some read contacts, which are kind of sensing if the latch is locked or not locked.
894920	900160	There's also different variants of the lock, where everything is just in the front, and we have,
900160	904820	again, read contacts, which kind of detect a couple things. But all of the locks have some
904820	910880	kind of debug pins. So let's talk about the keys. So there's a bunch of keys, and you see we have
911000	916220	a stack of them because we were going on shopping trips. The most important one is the yellow key,
916220	920800	which is the programming key. Only one of them exists in the locking system. This is basically
920800	925080	the main provisioning key. It allows you to add manager keys, to remove them, to overwrite the
925080	930520	lock, so if you need to open the lock. It also is used to power deadlocks. So if a battery is empty,
930520	935540	you can use it to power jump it. And it has some additional functions like cloning, functionality,
935540	940540	audits, and some other things. Another key which is important is the black key, which is the
940540	946200	manager key. And this is basically typically your administrator, whatever has it, you kind of,
946200	952720	to open the locker so that you can get your stuff, or to kind of check if you have a flipper in there,
952940	957480	a legal flipper in there. So this is kind of things which it's used for. And one thing which is very,
957480	961120	very special for Digilog, and this is kind of, I think, one very important feature for a lot of
961120	967080	people, is the so-called ADA key, which is in blue. And ADA means Americans with Disabilities
967080	972680	Act. So this key allows you basically for people who cannot enter a pin physically, you just tap
972680	980820	the key fob, and it will kind of act as a pin or as a key. Yeah, so if you take a look closer
980820	984940	into these keys, well, all of them are kind of the same. So programming the manager keys, by the way,
984940	989460	have exactly the same hardware, just the case is different. But price-wise, they are very different.
990180	995080	They have a battery in there, they have a PIC18, and they have, again, very nice for us, a PIC
995080	1001720	programming interface. The ADA key is basically an I button, which will be later we will use for
1001720	1007500	some things. There's one special key, which we're not going too deep into, it's a so-called data
1007500	1012340	key, and what it does is basically it connects over USB to a tablet, and you can basically use
1012340	1016440	it as a programming or manager key, you can have audit logs, you can pull things, you can clone
1016440	1020500	logs and some other things. So this is like an additional thing, which I think they have in
1020500	1026460	their fifth generation or something. It's a little more expensive, but it doesn't matter for us.
1026860	1033540	All right, so what is the communication between log and key?
1033660	1037040	And the thing here is, which you probably figured out very quickly already, is OneWire.
1037260	1041420	And OneWire, by the way, is a very standard protocol. You find it in a lot of alarm systems, you find it
1041420	1046480	like if you go to a restaurant to unlock the cash register and some other things, it's a
1046480	1051200	very standard kind of thing. Which makes it great to be intercepted with logic
1051200	1054920	analyzers, so there's some tools out there which you can use to basically decode the stream.
1055620	1062060	They use the readrom command to ask the key for its ID, and the key returns
1062060	1067760	eight bytes of ID to the log, and this is basically authentication. And the key types are
1067760	1073380	identified basically by the first byte of the ID. One thing which is important if you want to
1073380	1078400	do side-channel attacks or timing attacks, the bus resets for every transaction. In our talk at
1078400	1083440	the Nulcon, we described how you potentially could do side-channels. One key thing to take
1083440	1087940	away here is we don't use any crypto, so we kind of rely on whatever security guarantees
1088440	1095180	OneWire has. All right, I want to give a quick rundown of PIC MCUs because it's kind of
1095180	1100680	important to understand what's going on here. So PICs generally are microcontrollers by
1100680	1104840	microchip. They're very common in locks, so literally everyone is using them. Siemens and
1104840	1110860	Floss use them, Schlage use them, Kitlock uses them, so everyone uses them. And they are
1110860	1115300	ideal because they are low power and ideal for battery operations. There's two flavors which
1115300	1120860	we see for Digilock in particular, or for other locks. It's a PIC18, which is an 8-bit MCU which
1120860	1129640	was released back in 2000, and the PIC24, which has a 16-bit MCU, which has no EEPROM data on
1129640	1132880	board. So basically you can't flash the firmware onto it, but you need to store your data somewhere
1132880	1140000	else. Okay, so this is an example of a random PIC18. So we have some SRAM, we have flash,
1140000	1145920	we have EEPROM, as mentioned, and they support some protections. For example, you can enable
1145920	1149440	code protection, you can enable write protection, and there's also a thing which is called external
1149440	1155520	block table read. And on the right you can see it's consisting of multiple blocks, and at the
1155520	1161160	bottom is the EEPROM part. So let's talk about the code protection. Speaking of which, code
1161160	1166680	protection is, I think, a very PIC-specific term. If you work with other processors, you might know
1166680	1171640	it as readout protection. And the basic idea is we have here an example log, which is not an example
1171640	1176760	log, just an example chip, where the first two blocks are protected, the data is protected, and
1176760	1181020	if you connect our programmer to it, what will happen is we will get, for the blocks which are
1181020	1188040	protected, all zeros, but the blocks which are not protected, we get data back. So write protection,
1188040	1191880	similar thing. The first two blocks are protected, the last one is protected. If you try to write
1191880	1197360	with our programmer something to that, the writes will fail for them, but the other blocks are
1197360	1205100	programmed. Speaking of security of these chips, these MCUs, they offer basically only basic
1205100	1209320	protection against attacks. So there's many attacks which exist for these chips, even if
1209320	1216340	protections are enabled. There's optical laser attacks back in 2002, there's UV erasure attacks,
1216340	1220200	there's glitching, there's like overwriting of individual blocks. So there's a lot of attacks
1220200	1226000	out there. So a lot of people kind of already figured out how to break these chips.
1227180	1234060	Okay, let's talk about the attacks. So our naive approach was like, hey, what happens if you just
1234060	1238260	connect a debugger and we do some magic with power and other things? It's not as trivial as it seems.
1238900	1245780	And we try to dump the MCU. We had the luck that we exposed the data pins, both for the
1246280	1250660	locks and the keys. And one thing which we found is basically that the protection settings,
1250660	1256020	which we did on the locks, were very inconsistent. So what do we mean with that? So typically,
1256020	1261020	as mentioned, if readout protection is enabled, you get all back, all zeros back, like on the
1261020	1266200	right side. And one thing which we saw very quickly is that we didn't have the right protection
1266200	1271120	enabled, which is by itself not really an issue. But the bigger thing was that if you use an
1271120	1275160	external EEPROM, like this external chip, but it's not encrypted, so you can dump it basically.
1275820	1279760	And this is basically the result which we had for the manager keys, for the data keys,
1279760	1285900	and everything. One thing which you will see is for most locks which use more modern chips,
1285900	1291380	they are not protecting the code. And all of them are not protecting the EEPROM. Which is in the
1291380	1296440	case of some of them doesn't matter too much, but for especially the locks, it matters a lot.
1299800	1305340	So what are we doing? So for unprotected devices, which don't have any code protection enabled,
1305340	1309900	we can just dump the code memory and the EEPROM directly. So we need a programmer,
1309900	1312900	we need some other hardware, but generally, you know, if you work with embedded systems,
1312900	1316800	you know how to do that. For partially protected devices, it gets a little bit more tricky. So
1316800	1321580	and this is an example for a lock which had the first three blocks protected, but the code was
1321580	1327400	creeping into the fourth one, which was not protected. So what we were doing is we can dump
1327400	1334220	the fourth block, and you can put a custom dumper into that block, which hopefully gets hit by some
1334220	1339760	code or branch link, and then we can dump the other ones. There's some other methods out there,
1339760	1343540	but because we kind of cash strapped and don't want to spend too much time on like buying more
1343540	1347760	locks of the same kind of thing and hoping that it's the same firmware, this is basically, you
1347760	1352480	know, one of the things you can do. Otherwise, you can just access the EEPROM data directly.
1352920	1358760	So as the same as the other ones. We described this attack at Nucon in the talk. So if you're
1358760	1362860	interested in that, but it's a very generic attack. It's kind of well known for quite a while.
1363420	1368860	So basically the firmware extraction can be successful for all the locks, so we can get
1368860	1373720	back the firmware. You can analyze the firmware, you can modify it if you want, you can basically
1373720	1379280	load it into Ghidra because it has big support. There's no real signatures, integrity checks,
1379280	1384580	which is kind of normal for that kind of things. And the methods are well established. Basically,
1384580	1389080	but the thing for us is like we don't necessarily need to even look at the firmware if you have the
1389080	1393700	data. So that's just like a thing. So let's talk about the EEPROM contents, because that's where
1393700	1398680	the current rules are. And one thing is it requires quite a while and a lot of trial and error to
1398680	1402180	figure out which data fields are for what. Especially if you have only provisioned locks
1402180	1405200	and you don't have like clean locks, which are provisioned, you kind of see what the differences
1405200	1410600	are. And the data fields also differ slightly between lock generations and between lock types.
1410600	1414820	So this is not accurate for all the locks. It's just one example for like an older fourth
1414820	1420780	generation lock. But what we see typically is we have a partial programming ID. We see the amount
1420780	1427200	of manager keys. We see what kind of manager key is provisioned on that. We see if like a pin was
1427200	1435340	set, ADA key ID, or like RFID UID. So if you tap the UID, you know, RFID. And there's also failed
1435340	1440620	pin counter. And for older locks, bad things might happen if you run over that. Just don't.
1440620	1446880	Okay, as a general observation is some locks don't wipe the user pin or the key after it has been
1446880	1451400	unlocked by the user. And some, especially newer versions do. So at some point, I think we figured
1451400	1456300	out there's a problem and we kind of fixed that. All right, so let's talk about emulation and
1456300	1463660	cloning keys. Well, and this kind of thing applies to both RFIDs and keys. So we only need the ID
1463660	1469480	basically to clone the key. And we cannot extract from the key or the flash depending on, you know,
1469480	1474480	what kind of media we have. And we can emulate it with an Arduino, with a Flipper Zero, or in
1474480	1480780	case of RFIDs with a Proxmark. The thing is, it looks a little bit easy, but you have to kind of
1480780	1485020	build like a custom PCB, which does a couple things to kind of, you know, wake up the lock in
1485060	1488680	a particular way. So it's not as trivial as you can do it right now. You need to kind of put some
1488680	1493720	effort into that. So don't go home and just program an Arduino. It won't work. All right,
1493720	1497560	what kind of other ideas could you have if you want to attack them? Well, you could try to brute
1497560	1502260	force pins and keys, which works for older locks very well, but for newer locks not so much. You
1502260	1505380	can do side-channel attacks, which works for all of them as far as we know, but it's very
1505380	1510420	complicated, takes like days. You can clone the lock configuration by one wire if you have a valid
1510420	1516240	key, and you can try to modify the contents of EEPROMs. Also, you could think of like building
1516400	1520880	a malicious firmware. We thought about that, but I mean, it's not really necessary to do.
1521700	1525840	If you're interested in the first two attacks, you can take a look at the slides at NuCon.
1526800	1531520	Now, probably one of the reasons why you guys are here is the cease and desist incident.
1531580	1537140	So our talk was basically meant to be on Friday at 11 a.m., and the day before at 2 p.m., we basically
1537140	1542320	got an email, cease and desist, which kind of came to a couple of things, like Copyright Act,
1542320	1547800	Defend Trade Secrets Act, you know, obviously other things like the Computer Fraud and Abuse Act,
1547800	1553080	and the DMCA. And the interesting thing here is, and I want to especially thank
1554500	1559840	Corey to kind of connect us so quickly, who's sitting in the front, thank you. By 3.30,
1559840	1563580	basically slightly more than an hour later, we were sitting already in a hotel room and talking
1563580	1570100	to lawyers from the EFF and also from Kurt, and we were basically figuring out what was going on.
1570260	1573980	And so to kind of, because it was very short notice, we kind of moved the talk from Friday
1573980	1577480	to Sunday. We probably could have given the talk on Friday, but we decided like, okay,
1577480	1581860	it might be worth to kind of figure out what's going on. On Saturday, so yesterday, we had a
1581860	1587440	phone call in both of everyone, we kind of exchanged views, we kind of resolved our differences,
1587440	1591160	and in that call, we kind of pulled the cease and desist back. And officially today,
1591160	1595360	shortly after midnight, we got like the withdrawal in writing for the cease and desist.
1595800	1599980	One thing which I want to quickly say is like, there's like a kind of official response from
1599980	1603460	Digilog. They kind of acknowledged that we communicated with them prior to DEF CON,
1603460	1610100	we gave them the slides even, which was maybe a mistake, maybe not. They promised to do some
1610100	1614440	improvements. For example, they want to enable code protection on their logs. For the data
1614440	1620280	blocks, they want to enable for the firmware. They want to encrypt somehow the communication
1620280	1626600	between the keys and the log, so that you cannot clone the UID anymore, and they want to encrypt
1626600	1632720	EEPROM data if it's external. They also told us that in over 32 years, we had no reported security
1632720	1639100	incidents due to a hacked log, which I believe. And they also are very committed to the security
1639700	1645360	solution for their customers. And I put a full statement, which they sent us on slide 70. So
1645360	1650480	if you look later on the slides, you'll find it in the back. All right, that's all for Digilog.
1650660	1664730	Let's move on with the next company and Braylon. Cool. So let's shift gears and talk about a
1664730	1672790	being Schulte Schlagbaum AG. So this is a German company. They've been in business since 1833. So
1672790	1678570	quite an old company. These are more widely used in Europe and Germany. They produce both
1678570	1684230	mechanic and electronic locker locks. We took a look at the brand called Sabotronic. They also
1684230	1690770	produce door locks, but we didn't take a look at those. We think they might be on the same platform,
1690770	1699370	but we're not entirely sure. So the electronic locks accept both pin and RFIDs or RFID plus pins
1699370	1705790	as access mediums. And they do provide audit log support. So let's talk about the LS series
1705790	1712970	of locks. These are based on the STM32 MCU, and they also have SPI EEPROM. As for security,
1712970	1718290	we found that SWD and debugging was not disabled and their EEPROM is not encrypted.
1718930	1723050	And we noticed a lack of physical tamper switches in the locks.
1724050	1730850	So as you can see, these are PCBs for three different locks. We think that they tried to
1730850	1737230	save money by using the same design for nearly a decade. They use the same PCB, but they leave
1737230	1744010	ICs unpopulated. So if you buy a lock that has pin support, you'll get an MCU for the keypad
1744630	1751670	and a different MCU for RFID, and you'll get both for the RFID and pin supported locks.
1751670	1760430	We also noted a difference in SPI EEPROM sizes. Okay, so let's talk about the management keys for
1761610	1768990	some of the RFID SAG locks. So their RFID locks support MyFair Classic, MyFair Deskfire,
1768990	1775210	and some ISO compatible tags. For the higher end locks, there are special RFID keys that are
1775210	1779990	required for programming. There's a master key one and two. Those are used for unlocking and
1779990	1786790	relocking lockers. There's also a data RFID tag for data transport, if you need to like pull audit
1786790	1792230	logs off of certain locks. There's also like a physical communicator device, which is like
1792230	1797510	an advanced handheld programmer, but we didn't take a look at that. We tried to procure a set
1797510	1806210	of these programming keys, but they were $1,400 for eight MyFair Classic tags. So we didn't think
1806210	1812950	it was worth the money, so we didn't take a look at those. So just a quick overview on how we dumped
1812950	1819890	EEPROM contents just using an SOIC clip. We were able to interface with the EEPROM and dump the
1819890	1827170	context, as you can see in the hex file. We were able to pull the master pin and the user set pin,
1827170	1833590	this is just totally unencrypted EEPROM with pins that are available for anyone who can read it to
1833590	1840950	see it. We also found that there are audit logs on the EEPROM as well. There are 500 entries,
1840950	1847670	including a timestamp and a status code, with the status code 50 allowing you to see used pins and
1847670	1854670	the RFID UIDs that have been used. So the last 500 you can see, yeah, all of that.
1855670	1862490	So how did we extract firmware? We noticed on the PCB there was solder mask covering the SWD,
1862490	1866970	like copper pads, so we scratched that off and we were able to interface with it
1866970	1873730	and connect to SWD. And that allowed us to see that the devs didn't set the read protection byte.
1874330	1878230	And as such, we were able to get the full firmware from these locks.
1879450	1886150	So there are a couple of physical flaws on these locks. We noticed that the motor power wires
1886650	1892970	and potentially debug pins are accessible from outside of the lock through a clipped plastic
1892970	1903030	cover. So there's just a huge gap, as you can see, the power wires to the actual motor.
1904610	1909570	And yeah, as you can see on the right, we were able to fit like a whole card under there. So
1909570	1916230	that might allow us to tamper with the lock motor and do some physical hacking there.
1916910	1921550	So we'll take it, we'll talk about a couple of other manufacturers now. One of them being
1921550	1926950	Compact Security Company. This is a US company founded in 1903. So again, another pretty old
1926950	1934430	company. We took a look at the regulator series. These use the PIC-16 MCU. And these locks accept
1934430	1940750	user pins, technician pins, master pins. And there is some audit logging support for some models.
1941430	1946690	As for security, we found that code data and write protection were enabled on all these locks. So
1946690	1952470	that's good for them, but not very fun for us. So we kind of moved on. But we took a look at
1952470	1957430	their documentation and saw what they were using for a programming slash audit tool.
1957850	1966010	An Excel spreadsheet. I don't know what kind of Excel macro hell is happening here. I'm glad I'm
1966010	1971370	not the person who has to maintain this and write this. But if it works for them, I'm happy for them.
1971370	1979330	So next we'll talk about Kitlock. This is a sub-brand of CodeLocks. This is a UK-based
1979330	1986930	company founded in 1991. This also uses the PIC-16 MCU. And again, accepts user pins, technician
1986930	1992510	pins, and master pins. And again, they had code data and write protection enabled. So good for
1992510	1999970	them, not fun for us. So for good measure, we took a look at a couple of no-name RFID locks from
1999970	2006030	Amazon and eBay. These are just like $20 locks. Super cheap. We took them apart and found that
2006030	2012670	they had EPROM and some kind of mystery MCU. If you like mystery MCUs and know what this is, let
2012670	2022890	us know. Obviously, you can't really have many expectations of security on these cheap devices.
2022890	2028930	So there's no encryption, no protection, and plain text RFID UIDs are just there for anyone to read
2028930	2038810	it. Okay, so we're going to do a quick demo now to show how you can hack some of these locks.
2039630	2044170	All right, due to the season, we will change the demo slightly. So usually, we were kind of
2044170	2048890	thinking of doing a whole rundown on how we can extract manager keys and other things. What I
2048890	2053730	would do instead is I would showcase our custom PCB, which we built ourselves and took us some
2053730	2058670	time to develop it. What it basically does is it emulates the same function as a manager key,
2058670	2063290	so I will just show you. So I locked all the lockers from DigiLock in this case,
2063290	2068130	and I will just kind of show how I can hopefully open them again. Yeah.
2069370	2075930	Okay, just like a quick example of a theoretical scenario. So we're going to assume that the
2075930	2083350	attacker has access to any open locker or cabinet with the tools, the microchip,
2083630	2089010	a picket 3 debugger, a Phillips screwdriver, and an Arduino and or flipper. We're using the
2089010	2101750	flipper here. So our criminal has already set the key onto the flipper, and we are able to access
2101750	2110710	the locks. Yeah, so to be fair, we put a lot of effort into like figuring it out already. So this
2110710	2115770	is like basically if you got access to a lock, you somehow extracted that, you built that kind
2115770	2122970	of tool. There's a magic back set which we don't show. So the attack will work very quickly after
2122970	2126550	that. Now the obvious thing is if you want to extract secrets from these locks, you need to
2126550	2130610	kind of disassemble them, so you need a screwdriver. The locks which are kind of just having the front
2130610	2134630	part are super annoying because you need like a very special key to kind of unscrew them.
2134710	2139170	But generally, to open and relock them again without resetting the original pin,
2139170	2143530	that's basically all you need. But this might take you some time to do.
2143650	2148490	All right. That's for that. Let's go to the conclusion.
2149850	2155310	Okay. In summary, we were able to extract firmware and keys from these brands of locks.
2156450	2162530	So access to one lock can give you access to all locks in one system or one location.
2163170	2169490	Cloning and emulating keys is possible. And these attacks don't require complicated tools
2169490	2173750	and are sometimes cheap unless you're using the flipper. That's a little bit more expensive.
2174250	2180230	So how secure is your stuff in electronic lockers? Not super secure. But we need to be
2180230	2184990	fair because these locks are not being sold as high security devices. They're not promising
2184990	2192190	like military grade security or anything. These are just standard use locks. So how can we fix
2192190	2198090	this? Of course we would recommend a security by design approach from the beginning. So enable all
2198090	2203710	security features and always expect physical attacks when you're producing locks. Encrypt
2203710	2209430	your secrets, store them in a secure way. So the best solution for vulnerable locks would be to
2209430	2214370	have firmware updates for all of them. But depending on the age of the locks, this might
2214370	2221410	not be possible. And in our opinion, it seems unfixable. So the workaround could be to use a
2221410	2226610	programmer to enable code protection. But this only works if data is stored on the MCU and not
2226610	2233730	on an external EEPROM chip. So this task is kind of complicated for an average and non-tech savvy
2233730	2239890	user. So it's not a reasonable expectation. So the likely solution would be to buy new locks or just
2239890	2248610	ignore the problem and hope it goes away. So takeaway lessons. Please don't reuse your important
2248610	2256390	pins for lockers. Like public use lockers. Again, don't reuse your pins for your debit cards, your
2256390	2261290	phone. Use separate things. Use like we're all using separate passwords now for everything I
2261290	2269250	hope. So treat your pin like a password and never loan out your electronic keys. And always be
2269250	2275190	aware of security limitations of devices. And you cannot trust audit logs of these devices because
2275190	2280810	they can be tampered with. So even experienced and big companies make mistakes. And developing
2280810	2288950	stuff is way harder than breaking it in 90% of cases. So be nice to developers. It's hard when
2288950	2293410	people are attacking your stuff. And always remember there might be interesting cyber physical
2293410	2299670	systems around you. So don't forget the human factor. Can you just ask nicely for the manager
2299670	2307630	key? So final notes. Please don't break into lockers you don't own. I know these systems are
2307630	2314210	in a lot of places. Hotels and such. But please don't. Messing with these locks can also permanently
2314210	2318810	break them. Which is kind of the standard expectation when you're hardware hacking. You can
2318810	2325710	always break things quite easily. Be careful. There are more attacks that we haven't covered here.
2326390	2331450	Other companies and products are possibly vulnerable too. And just because they claim
2331450	2339390	that they've never been hacked doesn't mean they're unhackable. Of course. And yeah. Thanks all.
2345060	2350460	So I would like to also give special thanks to Corey who kind of connected us with Delorios.
2350460	2357600	To Tara who did that too. To our counsel Hannah and Kurt. And to Andrew. And everyone at EFF.
2357600	2364280	This kind of gave me again a motivation to definitely donate a lot of money to the EFF.
2364660	2370940	One maybe side story is that Braylon was at B-Sides before this event and was getting a
2370940	2374840	membership for EFF and was kind of joking like oh we might need you tomorrow. And lo and behold
2374840	2380840	literally one day after that, on her birthday of all effects, both of us got a cease and desist
2380840	2385920	letter. So if you have questions, we might be still around here. Otherwise feel free to contact
2385920	2393400	us. Yeah. And thank you very much for being here. Right. So yeah. If you also want to read the
2393400	2398260	statement, it will be in the slides. And I hope we will find a solution also to kind of fix the
2398260	2402560	older locks. So there's probably a way we will figure it out together. Thank you.
