WEBVTT

00:02.420 --> 00:03.960
Hello, DEF CON.

00:04.340 --> 00:06.780
Thank you for being here on a Saturday morning.

00:06.780 --> 00:08.940
I know everyone was partying yesterday until 5 a.m.

00:08.940 --> 00:11.160
probably, so I'm glad that you're here.

00:11.900 --> 00:18.480
So yeah, now we're talking about our talk, open CSAM, or how secure is your stuff in your lockers.

00:18.480 --> 00:21.720
And this is the main question, basically, which we will talk through the talk.

00:22.240 --> 00:28.080
As you might have heard, there have been some issues with the talk in the past, so I will address it later.

00:28.360 --> 00:33.660
So before we start with the topic, let me introduce myself real quick.

00:33.740 --> 00:37.900
So I'm Dennis, I'm a security researcher or also a hardware hacker.

00:38.320 --> 00:42.280
And I basically am interested in wireless and embedded security and privacy.

00:42.280 --> 00:45.620
So I take a look at all kinds of interesting devices which are around me.

00:46.180 --> 00:51.180
Primarily this is vacuum robots, but I generally look at all kinds of things.

00:51.460 --> 01:00.620
That's why I call myself also a vacuum robot and IoT collector, so I have probably way over 600, 700 devices and 60 or 70 vacuum robots by now.

01:01.400 --> 01:07.040
So my main goal typically is to root vacuum robots, but again, I look at all the other things.

01:07.040 --> 01:13.080
And if you're interested in vacuum robots, by the way, I have a website which documents all the hardware and everything.

01:15.320 --> 01:26.380
One thing which is kind of new in the slides, so I have been a target of a cease and desist at DEF CON, so I think this is like a, you know, interesting thing.

01:26.380 --> 01:30.680
Which by the way was withdrawn as today in the morning or at night, so yeah.

01:30.680 --> 01:33.140
And now we would like to introduce Braylyn.

01:36.340 --> 01:37.100
Cool.

01:37.100 --> 01:38.640
Hi, I'm Braylyn.

01:38.740 --> 01:47.280
I hack things for the Leviathan security group during the day, but I'm here representing myself as an independent security researcher and this talk does not reflect their views.

01:47.560 --> 01:53.720
My general focus has been application security and APIs, but I've started hardware hacking for fun.

01:55.380 --> 01:59.000
Looking at things like robots, cameras, and smart locks.

01:59.000 --> 02:06.860
And this is my first DEF CON talk and I was also named in the cease and desist, so that's pretty fun.

02:12.370 --> 02:13.270
All right.

02:13.270 --> 02:15.030
So let's talk about some previous work.

02:15.030 --> 02:18.110
So this is not necessarily the first lock which we took a look at.

02:18.110 --> 02:26.750
Like exactly ten years ago, well, a little bit more than ten years ago, I was working on a group which looked at Siemens and Foss door locks and we published a paper about that.

02:27.390 --> 02:35.110
Also some while ago I was taking a look at Schlage electronic locks which you find especially in America, like, you know, in government buildings, universities.

02:37.390 --> 02:39.590
So what are the goals of this talk?

02:39.590 --> 02:44.750
Well, first we want to give you some overview of the reverse engineering of digilock and SAG locks.

02:44.990 --> 02:55.070
We want to tell you something about vulnerabilities and we want to show you some ideas and methods how you can extract typically firmware and configurations from that kind of devices.

02:55.830 --> 03:01.390
One thing which is the most important part of this talk is basically we want to raise awareness about pin numbers.

03:02.190 --> 03:09.110
As a general side note, we use digilock and SAG as examples and we're not claiming that they're more or less secure than other companies.

03:09.110 --> 03:13.910
We're kind of just unlucky that they're one of the market leaders and that they build good products.

03:14.990 --> 03:21.390
So, yeah, so we basically have chosen them because they have a good reputation, they have a quality of products, we just might have made some mistakes.

03:21.830 --> 03:30.470
We reported the things also to the vendors and digilock is actively working on fixing the issues and I will tell, give you some information later on that.

03:31.110 --> 03:32.670
So, about this talk.

03:32.830 --> 03:38.690
It's basically a continuation of my Nulcon talk at Nulcon Berlin 24.

03:39.150 --> 03:47.790
The focus, and this is the important part, on offline locks which are managed, so if there's like a master key or something, if you think of a gem or, you know, master key systems.

03:48.450 --> 03:50.350
And we do not cover a couple of things.

03:50.350 --> 03:56.130
For example, we do not cover management software, we do not cover reprovisioning, so how to, you know, factory reset the lock.

03:56.310 --> 04:03.850
We also don't talk about physical attacks using magnets or destructive attacks like drilling, you know, decapping, all other kinds of things.

04:04.550 --> 04:09.750
And later on, we have included a statement of digilock in regard to their cease and desist.

04:10.830 --> 04:13.890
All right, so what is our motivation here?

04:13.890 --> 04:23.370
So, generally, back when I was, you know, looking at locks, I realized quite quickly that hacking locks is not that, you know, new.

04:23.410 --> 04:33.310
There's a lot of people who were hacking like high security locks, so a lot of researchers were kind of focusing on that, especially like safe locks, because there's probably very important stuff in there.

04:33.950 --> 04:42.190
A lot of research has been put into side channel attacks, you know, safes contain expensive things, and the impact is like very high if they're insecure.

04:42.750 --> 04:51.390
The general problem is for, you know, manufacturers or for even companies who have this kind of devices, it's very hard to defend against physical attacks and highly motivated attackers.

04:51.470 --> 04:56.190
So, if I'm an attacker, if I have unlimited time and money, then I will get into whatever it is.

04:57.450 --> 04:59.730
In regard to consumer devices, it's slightly different.

04:59.730 --> 05:09.230
Consumer locks, safes and cabinets are known to be bad, and there's mechanical flaws, there's trivial bypasses using magnets and other things, and there's insecure software.

05:09.590 --> 05:23.970
I have an example here from one of my favourite YouTubers, a lock-picking lawyer, where he has a gun safe kind of thing where you put the gun in, and you just pry open the plastic handle and you can just pull the gun out, you don't care about the lock.

05:26.190 --> 05:30.150
Sometimes you don't need to even attack locks, there's other ways around that.

05:31.190 --> 05:31.770
Okay.

05:31.910 --> 05:35.050
So, how did we start with this particular research?

05:35.050 --> 05:40.350
So I was in the University around 2018, and they introduced lockers in the labs.

05:40.530 --> 05:48.550
One of the ideas was you can put your stuff in, and you just choose your own pen, lock it, and if you come back, you unlock it again and the next one can use it.

05:49.270 --> 05:56.750
But also, when we were travelling around, we saw these locks in many, many co-working spaces, banks, airports, hotels, gyms, so we were literally everywhere.

05:56.850 --> 06:00.410
At some point, you develop an eye for interesting things around you.

06:01.590 --> 06:14.970
And one thing which we figured out very quickly is there's only a few widely used vendors which are out there, so there's groups in the US in particular, like Digilock, or in Europe, SAG, there's some very limited kind of vendors out there.

06:15.270 --> 06:22.670
And these kind of locks, they stay for a very, very long time in use, because why would you change a gym lock after five years, or after four years, or whatever?

06:22.670 --> 06:27.010
These things typically stay in use for ten years, 20 years, until they're broken, basically.

06:28.250 --> 06:28.850
Okay.

06:28.850 --> 06:33.670
The question is now why do we hack cabinet lockers, or lockers generally, and not saves?

06:33.730 --> 06:41.210
Well, lockers and cabinets are basically everywhere, and they're used in public spaces, or spaces which are accessible to the public, or shared workspaces.

06:41.670 --> 06:43.630
And there might be many reasons why you want to hack them.

06:43.630 --> 06:47.870
For example, you forgot your pin, you lost your key, or you do a red team penetration test.

06:48.490 --> 06:53.430
Also, sometimes the audit locks are not super correct, so you want to correct them.

06:54.150 --> 06:57.830
And they might contain a lot of interesting stuff, including our own.

06:57.830 --> 07:06.590
And this is what I want to say, one of the reasons why we do the research is because we're kind of slightly annoyed because our stuff is also about kind of lockers, so this is one big motivation from us.

07:06.590 --> 07:09.090
So what kind of things do you might store there?

07:09.090 --> 07:18.630
Well, you might store your backpack, laptop, employee ID, phone, keys, money, credit cards, USB sticks, important documents, your bitcoins, or candy.

07:19.450 --> 07:27.070
So the question is, well, did you use the same pin which you used to lock the locker also for your phone, notebook, or credit card?

07:31.120 --> 07:34.740
Quick survey, who has a friend that does this?

07:34.740 --> 07:36.360
Who reuses their pins?

07:38.040 --> 07:39.860
No, you're not supposed to admit that.

07:41.960 --> 07:48.940
To be fair, I mean, in the beginning, before I was doing the research, I caught myself using the same pin all over again, so it gets a little bit complicated.

07:49.500 --> 07:53.220
Anyway, so what kind of attack ideas do we have, and how do we do it?

07:53.520 --> 07:56.580
So what are we looking for generally in this kind of devices?

07:56.580 --> 08:02.180
Well, we try to extract somehow the firmware, because firmware can give us some secret backdoors or bugs.

08:02.180 --> 08:08.140
It helps us to understand functionality, and it can allow an attacker to create custom firmware.

08:08.280 --> 08:11.700
You know, like basically de-clouding or n-certification of your smart locks.

08:12.920 --> 08:21.960
The other thing is, which is obviously the crown jewel here, is the interesting data in terms of key IDs, user pins, RFID IDs, or lock files.

08:22.540 --> 08:28.400
And the other thing, if you do lockpicking, you know you try to find any easy way to bypass things into open locks.

08:29.620 --> 08:38.820
So, our idea, and this is why we want to kind of stress on that, it's not necessary that we want to steal your stuff, but we don't want to steal your stuff anyway, but I mean, theoretically as attackers.

08:39.140 --> 08:42.300
But lateral movement, and that's the core idea of our talk.

08:42.440 --> 08:43.480
So how do we do it?

08:43.480 --> 08:51.200
So we have in this particular example three cabinets, basically one of them is open, two of them are locked, one is locked with a pin, the other one is locked with an RFID.

08:51.560 --> 08:55.740
And so what we do is we try to extract the manager key from the locker which is open.

08:55.800 --> 09:05.160
As soon as we have the manager key, this is like a key which you use to kind of unlock the locker, to audit things in there so that there's nothing, you know, like the Defcon hotel, it's like sketchy things, your flipper.

09:05.500 --> 09:07.860
And you can lock it again without resetting the pin.

09:08.160 --> 09:19.700
So, by having this manager key, what we can do is basically we can unlock other lockers, and we can extract from the lockers, like with the pin, we can extract the user pin.

09:19.940 --> 09:22.940
At the same time, we can obviously access whatever is in the locker.

09:22.940 --> 09:30.360
So, if you have a laptop in there, and if you have your phone in there, well, we might be able to use the pin which you use to lock the locker to, you know, unlock that.

09:30.440 --> 09:42.020
But it gets even more interesting because, well, we can also extract the RFID, you know, ID or secret, in some cases, from a lock which was used to lock the locker with an RFID or employee badge.

09:42.120 --> 09:46.600
And then we can go to an interesting door, like a server room or something, and can use that to unlock that.

09:46.860 --> 09:52.900
Especially SAG, they use test fire encryption, so they store the keys, which gets very, very interesting here.

09:53.760 --> 09:56.180
All right, so how do you get that kind of locks?

09:56.180 --> 09:57.940
What's the logistics behind that?

09:58.320 --> 10:05.600
The problem is, if you do that kind of research, you need to invest a lot of time and money, and experiments typically require multiple devices.

10:05.740 --> 10:12.740
And you obviously cannot use someone else's property because there might be one or two bricks in the process of reverse engineering that.

10:13.740 --> 10:21.820
These locks are also expensive, so typically you pay more than $100 for a lock and more than $50 for a key, or way more than $50.

10:21.820 --> 10:23.200
We will talk about that later.

10:23.780 --> 10:27.000
But the good thing was, for us, there's surplus on eBay.

10:27.380 --> 10:35.020
And it's a little mean, but COVID kind of helped us a little bit because a lot of gyms kind of got bankrupt, so they kind of offset their locks and other things on eBay.

10:35.360 --> 10:42.820
And we got a lot of cheap provisioned locks, so locks which were already provisioned to some manager key or programming key, which we were able to play around with.

10:43.080 --> 10:47.120
And the other thing is, especially in Germany, we got a lot of locks from failed projects.

10:47.120 --> 10:54.680
Basically, we have a big gym, which didn't happen, so we had stacks and stacks of these locks, and we kind of sell them on eBay for a cheap price.

10:55.300 --> 11:02.060
So we spent probably more than $1,000 or $2,000 on buying random locks, which we don't even have so many lockers for.

11:02.620 --> 11:09.460
So as mentioned, we were going on a shopping tour on eBay and bought a lot of locks.

11:10.400 --> 11:16.360
So let's talk about the DigiLock ecosystem, and this is our first candidate for which devices we looked at.

11:16.560 --> 11:23.300
So DigiLock itself, we're like a brand of Security People Inc., which is U.S.-based, and they are in the industry for a very, very long time.

11:23.300 --> 11:26.140
So they're very experienced, especially also with mechanical locks.

11:26.500 --> 11:31.220
They call themselves the global leader in keyless lock solutions, and they have many different bands of locks.

11:31.220 --> 11:33.420
So they have connected locks, which we're not talking about.

11:33.420 --> 11:34.300
We have offline locks.

11:34.300 --> 11:35.540
We have mechanical locks.

11:35.680 --> 11:41.300
And as access media, you can use RFIDs, the pins, key fobs, smartphones with the newest generation.

11:41.780 --> 11:43.520
And you might see them under different brands.

11:43.520 --> 11:46.340
For example, DigiLock, Nex, Numeris, so there's different ones.

11:46.860 --> 11:58.300
If you take a look at their website, I mean, they kind of say we're literally in all the industries, which is like, I mean, that's the reason why we kind of saw them in the first place, because we're in education, in gyms, in some professional sports organizations,

11:58.300 --> 11:59.560
so we're literally everywhere.

12:00.560 --> 12:09.880
The way how you can typically identify them is, this is some examples right now, by the three-pin connector, which we use, which is very specific for DigiLock.

12:09.900 --> 12:15.480
Other lock vendors use slightly different kind of connectors, but this is like a thing, if you see that, it's kind of like, you know, kind of know what it is.

12:16.280 --> 12:24.860
If you take a look at the lock hardware itself, the good thing for us is that they use more or less the same or very similar hardware, so they use a similar type of MCU.

12:25.100 --> 12:28.980
So if you're kind of familiar with one of them, you kind of know how the others work in a way.

12:29.040 --> 12:32.660
So this makes it also a great kind of thing for us as reverse engineers.

12:33.380 --> 12:43.640
And they didn't have tamper switches, so if you just assemble one, then there's nothing which triggers, which is, by the way, very, very normal for low security or middle security locks.

12:43.640 --> 12:46.160
Only safe locks have some tamper switches and other things.

12:46.920 --> 12:51.180
The lock state is controlled by the latch, which is kind of interesting for us, and we'll kind of talk about that later.

12:52.100 --> 12:57.640
And because we have so much experience with mechanical locks, we added a lot of mechanical protections against physical attacks.

12:57.640 --> 13:00.100
So for example, you cannot use bypassing things.

13:00.100 --> 13:03.720
We tried a couple things with needles, so there's no way to kind of, you know, bypass things.

13:03.720 --> 13:05.320
So we did a very good job there.

13:05.760 --> 13:14.440
The features which you get per lock are kind of dependent on the brand, so some of them support audit locks, so you can basically record who opened or locked the locker.

13:14.860 --> 13:25.280
And they have assigned and shared locker functionality, which means sometimes you can give an employee just one locker and only that person can use it, or you have a scenario like in the gym.

13:25.840 --> 13:32.260
If you take a look closer at the hardware, one thing which is kind of great for us is all of them have a PIC programming interface exposed.

13:32.580 --> 13:33.940
Many of them have EEPROM.

13:33.940 --> 13:35.200
We have obviously an MCU.

13:35.340 --> 13:42.540
We have a connection to the inside unit, which kind of contains the latch and the motor, and it gets also power from there.

13:42.540 --> 13:44.260
We have a piezo for the sound.

13:44.440 --> 13:47.520
And the most interesting thing for us was the interface.

13:47.520 --> 13:52.760
As you see, we soldered some wires to that to kind of intercept that, which is basically one wire.

13:54.800 --> 14:03.700
Hardware-wise, if you take a closer look at the microcontrollers, we use most of the time PIC18 controllers, but sometimes, especially newer models, we use PIC24s.

14:03.740 --> 14:08.720
We have EEPROM for audit locks and for credential storage in some of them devices.

14:08.920 --> 14:15.440
And if you have a device which supports RFIDs, you have an ST controller for NFCs.

14:15.560 --> 14:20.140
All the newer ones have a logic IC, which is also an HSM.

14:20.520 --> 14:30.420
And from what they told us, basically, in new generations of these locks, we use the HSM to store some kind of secrets, which we can confirm because it's not on eBay right now.

14:30.420 --> 14:32.700
So I need to wait until it shows up on eBay.

14:34.740 --> 14:43.940
So if you look inside at the locker hardware, the thing which was for me, as someone who's like doing physical security for quite a while, is like it's extremely well-built and engineered.

14:44.240 --> 14:47.700
And what I mentioned before is that the inside lock kind of defines if it's locked or unlocked.

14:47.700 --> 14:53.820
You have some read contacts, which are kind of sensing if the latch is locked or not locked.

14:54.920 --> 15:02.880
There's also different variants of the lock, where everything is just in the front, and we have, again , read contacts, which kind of detect a couple things.

15:02.880 --> 15:05.940
But all of the locks have some kind of debug pins.

15:06.920 --> 15:08.840
So let's talk about the keys.

15:09.060 --> 15:13.320
So there's a bunch of keys, and you see we have a stack of them because we were going on shopping trips.

15:14.140 --> 15:17.540
The most important one is the yellow key, which is the programming key.

15:17.860 --> 15:20.320
Only one of them exists in the locking system.

15:20.320 --> 15:22.260
This is basically the main provisioning key.

15:22.260 --> 15:26.660
It allows you to add manager keys, to remove them, to overwrite the lock, so if you need to open the lock.

15:27.060 --> 15:29.340
It also is used to power deadlocks.

15:29.340 --> 15:32.280
So if a battery is empty, you can use it to power jump it.

15:32.400 --> 15:36.840
And it has some additional functions like cloning, functionality, audits, and some other things.

15:37.580 --> 15:41.380
Another key which is important is the black key, which is the manager key.

15:41.380 --> 15:53.860
And this is basically typically your administrator, whatever has it, you kind of, to open the locker so that you can get your stuff, or to kind of check if you have a flipper in there, a legal flipper in there.

15:53.860 --> 15:56.080
So this is kind of things which it's used for.

15:56.240 --> 16:04.360
And one thing which is very, very special for Digilog, and this is kind of, I think, one very important feature for a lot of people, is the so-called ADA key, which is in blue.

16:04.500 --> 16:07.780
And ADA means Americans with Disabilities Act.

16:07.780 --> 16:17.760
So this key allows you basically for people who cannot enter a pin physically, you just tap the key fob, and it will kind of act as a pin or as a key.

16:18.860 --> 16:23.500
Yeah, so if you take a look closer into these keys, well, all of them are kind of the same.

16:23.500 --> 16:26.820
So programming the manager keys, by the way, have exactly the same hardware, just the case is different.

16:26.820 --> 16:29.460
But price-wise, they are very different.

16:30.180 --> 16:36.180
They have a battery in there, they have a PIC18, and they have, again, very nice for us, a PIC programming interface.

16:36.800 --> 16:42.560
The ADA key is basically an I button, which will be later we will use for some things.

16:43.660 --> 16:55.960
There's one special key, which we're not going too deep into, it's a so-called data key, and what it does is basically it connects over USB to a tablet, and you can basically use it as a programming or manager key, you can have audit logs, you can pull things,

16:55.960 --> 16:57.760
you can clone logs and some other things.

16:57.980 --> 17:02.840
So this is like an additional thing, which I think they have in their fifth generation or something.

17:03.020 --> 17:06.460
It's a little more expensive, but it doesn't matter for us.

17:06.860 --> 17:13.540
All right, so what is the communication between log and key?

17:13.660 --> 17:17.040
And the thing here is, which you probably figured out very quickly already, is OneWire.

17:17.260 --> 17:19.700
And OneWire, by the way, is a very standard protocol.

17:19.700 --> 17:27.640
You find it in a lot of alarm systems, you find it like if you go to a restaurant to unlock the cash register and some other things, it's a very standard kind of thing.

17:28.060 --> 17:34.920
Which makes it great to be intercepted with logic analyzers , so there's some tools out there which you can use to basically decode the stream.

17:35.620 --> 17:46.580
They use the readrom command to ask the key for its ID, and the key returns eight bytes of ID to the log, and this is basically authentication.

17:46.920 --> 17:50.260
And the key types are identified basically by the first byte of the ID.

17:51.120 --> 17:56.960
One thing which is important if you want to do side-channel attacks or timing attacks, the bus resets for every transaction.

17:57.320 --> 18:02.100
In our talk at the Nulcon, we described how you potentially could do side-channels.

18:02.280 --> 18:09.800
One key thing to take away here is we don't use any crypto, so we kind of rely on whatever security guarantees OneWire has.

18:10.620 --> 18:17.120
All right, I want to give a quick rundown of PIC MCUs because it's kind of important to understand what's going on here.

18:17.480 --> 18:21.640
So PICs generally are microcontrollers by microchip.

18:21.880 --> 18:24.480
They're very common in locks, so literally everyone is using them.

18:24.480 --> 18:29.440
Siemens and Floss use them, Schlage use them, Kitlock uses them, so everyone uses them.

18:29.600 --> 18:34.100
And they are ideal because they are low power and ideal for battery operations.

18:34.440 --> 18:38.360
There's two flavors which we see for Digilock in particular, or for other locks.

18:38.480 --> 18:49.940
It's a PIC18, which is an 8-bit MCU which was released back in 2000, and the PIC24, which has a 16-bit MCU, which has no EEPROM data on board.

18:49.940 --> 18:53.560
So basically you can't flash the firmware onto it, but you need to store your data somewhere else.

18:54.300 --> 18:57.280
Okay, so this is an example of a random PIC18.

18:57.600 --> 19:04.620
So we have some SRAM, we have flash, we have EEPROM, as mentioned, and they support some protections.

19:04.780 --> 19:10.820
For example, you can enable code protection, you can enable write protection, and there's also a thing which is called external block table read.

19:11.320 --> 19:17.020
And on the right you can see it's consisting of multiple blocks, and at the bottom is the EEPROM part.

19:18.160 --> 19:19.860
So let's talk about the code protection.

19:20.080 --> 19:24.380
Speaking of which, code protection is, I think, a very PIC-specific term.

19:24.380 --> 19:28.080
If you work with other processors, you might know it as readout protection.

19:28.380 --> 19:41.420
And the basic idea is we have here an example log, which is not an example log, just an example chip, where the first two blocks are protected, the data is protected, and if you connect our programmer to it, what will happen is we will get, for the blocks which are protected,

19:41.420 --> 19:45.560
all zeros, but the blocks which are not protected, we get data back.

19:46.740 --> 19:49.000
So write protection, similar thing.

19:49.000 --> 19:50.980
The first two blocks are protected, the last one is protected.

19:50.980 --> 19:58.260
If you try to write with our programmer something to that, the writes will fail for them, but the other blocks are programmed.

19:58.860 --> 20:06.240
Speaking of security of these chips, these MCUs, they offer basically only basic protection against attacks.

20:06.240 --> 20:10.740
So there's many attacks which exist for these chips, even if protections are enabled.

20:10.740 --> 20:19.300
There's optical laser attacks back in 2002, there's UV erasure attacks, there's glitching, there's like overwriting of individual blocks.

20:19.300 --> 20:21.020
So there's a lot of attacks out there.

20:21.480 --> 20:26.000
So a lot of people kind of already figured out how to break these chips.

20:27.180 --> 20:28.940
Okay, let's talk about the attacks.

20:29.580 --> 20:36.640
So our naive approach was like, hey, what happens if you just connect a debugger and we do some magic with power and other things?

20:36.640 --> 20:38.260
It's not as trivial as it seems.

20:38.900 --> 20:40.500
And we try to dump the MCU.

20:41.160 --> 20:47.580
We had the luck that we exposed the data pins, both for the locks and the keys.

20:48.000 --> 20:53.160
And one thing which we found is basically that the protection settings, which we did on the locks, were very inconsistent.

20:53.820 --> 20:55.060
So what do we mean with that?

20:55.060 --> 21:01.800
So typically, as mentioned, if readout protection is enabled, you get all back, all zeros back, like on the right side.

21:02.700 --> 21:08.560
And one thing which we saw very quickly is that we didn't have the right protection enabled, which is by itself not really an issue.

21:09.060 --> 21:15.160
But the bigger thing was that if you use an external EEPROM, like this external chip, but it's not encrypted, so you can dump it basically.

21:15.820 --> 21:20.460
And this is basically the result which we had for the manager keys, for the data keys, and everything.

21:20.480 --> 21:28.540
One thing which you will see is for most locks which use more modern chips, they are not protecting the code.

21:28.780 --> 21:30.940
And all of them are not protecting the EEPROM.

21:30.940 --> 21:36.440
Which is in the case of some of them doesn't matter too much, but for especially the locks, it matters a lot.

21:39.800 --> 21:41.200
So what are we doing?

21:41.200 --> 21:49.180
So for unprotected devices, which don't have any code protection enabled, we can just dump the code memory and the EEPROM directly.

21:49.180 --> 21:53.980
So we need a programmer, we need some other hardware, but generally, you know, if you work with embedded systems, you know how to do that.

21:54.200 --> 21:56.700
For partially protected devices, it gets a little bit more tricky.

21:56.700 --> 22:04.920
So and this is an example for a lock which had the first three blocks protected, but the code was creeping into the fourth one, which was not protected.

22:04.920 --> 22:18.060
So what we were doing is we can dump the fourth block, and you can put a custom dumper into that block, which hopefully gets hit by some code or branch link, and then we can dump the other ones.

22:18.360 --> 22:29.240
There's some other methods out there, but because we kind of cash strapped and don't want to spend too much time on like buying more locks of the same kind of thing and hoping that it's the same firmware, this is basically, you know, one of the things you can do.

22:30.120 --> 22:32.480
Otherwise, you can just access the EEPROM data directly.

22:32.920 --> 22:34.680
So as the same as the other ones.

22:35.420 --> 22:38.320
We described this attack at Nucon in the talk.

22:38.320 --> 22:41.040
So if you're interested in that, but it's a very generic attack.

22:41.040 --> 22:42.860
It's kind of well known for quite a while.

22:43.420 --> 22:49.920
So basically the firmware extraction can be successful for all the locks, so we can get back the firmware.

22:50.300 --> 22:56.920
You can analyze the firmware, you can modify it if you want, you can basically load it into Ghidra because it has big support.

22:57.400 --> 23:01.040
There's no real signatures, integrity checks, which is kind of normal for that kind of things.

23:01.640 --> 23:03.620
And the methods are well established.

23:03.920 --> 23:09.460
Basically, but the thing for us is like we don't necessarily need to even look at the firmware if you have the data.

23:09.460 --> 23:10.980
So that's just like a thing.

23:11.540 --> 23:14.860
So let's talk about the EEPROM contents, because that's where the current rules are.

23:15.260 --> 23:20.820
And one thing is it requires quite a while and a lot of trial and error to figure out which data fields are for what.

23:20.820 --> 23:25.900
Especially if you have only provisioned locks and you don't have like clean locks, which are provisioned, you kind of see what the differences are.

23:26.640 --> 23:30.600
And the data fields also differ slightly between lock generations and between lock types.

23:30.600 --> 23:32.860
So this is not accurate for all the locks.

23:32.860 --> 23:35.880
It's just one example for like an older fourth generation lock.

23:36.100 --> 23:39.720
But what we see typically is we have a partial programming ID.

23:39.900 --> 23:41.840
We see the amount of manager keys.

23:41.840 --> 23:44.380
We see what kind of manager key is provisioned on that.

23:44.860 --> 23:50.260
We see if like a pin was set, ADA key ID, or like RFID UID.

23:50.260 --> 23:53.540
So if you tap the UID, you know, RFID.

23:54.180 --> 23:56.140
And there's also failed pin counter.

23:56.140 --> 23:58.980
And for older locks, bad things might happen if you run over that.

23:59.380 --> 24:00.620
Just don't.

24:00.620 --> 24:08.420
Okay, as a general observation is some locks don't wipe the user pin or the key after it has been unlocked by the user.

24:08.580 --> 24:10.300
And some, especially newer versions do.

24:10.300 --> 24:13.560
So at some point, I think we figured out there's a problem and we kind of fixed that.

24:14.200 --> 24:17.040
All right, so let's talk about emulation and cloning keys.

24:17.040 --> 24:20.480
Well, and this kind of thing applies to both RFIDs and keys.

24:20.780 --> 24:25.340
So we only need the ID basically to clone the key.

24:25.340 --> 24:30.920
And we cannot extract from the key or the flash depending on, you know, what kind of media we have.

24:31.120 --> 24:37.560
And we can emulate it with an Arduino, with a Flipper Zero, or in case of RFIDs with a Proxmark.

24:37.760 --> 24:45.660
The thing is, it looks a little bit easy, but you have to kind of build like a custom PCB, which does a couple things to kind of, you know, wake up the lock in a particular way.

24:45.660 --> 24:47.920
So it's not as trivial as you can do it right now.

24:47.920 --> 24:49.420
You need to kind of put some effort into that.

24:49.540 --> 24:51.480
So don't go home and just program an Arduino.

24:51.480 --> 24:52.520
It won't work.

24:53.120 --> 24:56.620
All right, what kind of other ideas could you have if you want to attack them?

24:56.620 --> 25:01.840
Well, you could try to brute force pins and keys, which works for older locks very well, but for newer locks not so much.

25:02.040 --> 25:06.780
You can do side-channel attacks, which works for all of them as far as we know, but it's very complicated, takes like days.

25:07.560 --> 25:13.820
You can clone the lock configuration by one wire if you have a valid key, and you can try to modify the contents of EEPROMs.

25:14.280 --> 25:17.420
Also, you could think of like building a malicious firmware.

25:17.740 --> 25:20.880
We thought about that, but I mean, it's not really necessary to do.

25:21.700 --> 25:25.840
If you're interested in the first two attacks, you can take a look at the slides at NuCon.

25:26.800 --> 25:31.520
Now, probably one of the reasons why you guys are here is the cease and desist incident.

25:31.580 --> 25:47.800
So our talk was basically meant to be on Friday at 11 a.m., and the day before at 2 p.m., we basically got an email, cease and desist, which kind of came to a couple of things, like Copyright Act, Defend Trade Secrets Act, you know, obviously other things like the Computer Fraud and Abuse Act,

25:47.800 --> 25:49.060
and the DMCA.

25:49.740 --> 25:58.200
And the interesting thing here is, and I want to especially thank Corey to kind of connect us so quickly, who's sitting in the front, thank you.

25:58.700 --> 26:10.100
By 3.30, basically slightly more than an hour later, we were sitting already in a hotel room and talking to lawyers from the EFF and also from Kurt, and we were basically figuring out what was going on.

26:10.260 --> 26:14.840
And so to kind of, because it was very short notice, we kind of moved the talk from Friday to Sunday.

26:15.020 --> 26:19.840
We probably could have given the talk on Friday, but we decided like, okay, it might be worth to kind of figure out what's going on.

26:20.160 --> 26:29.900
On Saturday, so yesterday, we had a phone call in both of everyone, we kind of exchanged views, we kind of resolved our differences, and in that call, we kind of pulled the cease and desist back.

26:30.160 --> 26:35.360
And officially today, shortly after midnight, we got like the withdrawal in writing for the cease and desist.

26:35.800 --> 26:40.700
One thing which I want to quickly say is like, there's like a kind of official response from Digilog.

26:40.700 --> 26:46.820
They kind of acknowledged that we communicated with them prior to DEF CON, we gave them the slides even, which was maybe a mistake, maybe not.

26:47.740 --> 26:50.700
They promised to do some improvements.

26:50.700 --> 26:53.920
For example, they want to enable code protection on their logs.

26:53.940 --> 26:56.780
For the data blocks, they want to enable for the firmware.

26:57.060 --> 27:08.300
They want to encrypt somehow the communication between the keys and the log, so that you cannot clone the UID anymore, and they want to encrypt EEPROM data if it's external.

27:08.840 --> 27:15.860
They also told us that in over 32 years, we had no reported security incidents due to a hacked log, which I believe.

27:16.200 --> 27:21.480
And they also are very committed to the security solution for their customers.

27:22.060 --> 27:25.280
And I put a full statement, which they sent us on slide 70.

27:25.280 --> 27:28.500
So if you look later on the slides, you'll find it in the back.

27:28.940 --> 27:30.480
All right, that's all for Digilog.

27:30.660 --> 27:33.220
Let's move on with the next company and Braylon.

27:36.590 --> 27:37.230
Cool.

27:37.230 --> 27:47.390
So let's shift gears and talk about a being Schulte Schlagbaum AG.

27:47.690 --> 27:49.650
So this is a German company.

27:49.650 --> 27:52.550
They've been in business since 1833.

27:52.550 --> 27:54.570
So quite an old company.

27:54.570 --> 27:57.270
These are more widely used in Europe and Germany.

27:57.270 --> 28:00.670
They produce both mechanic and electronic locker locks.

28:00.670 --> 28:03.630
We took a look at the brand called Sabotronic.

28:03.630 --> 28:08.850
They also produce door locks, but we didn't take a look at those.

28:08.850 --> 28:12.750
We think they might be on the same platform, but we're not entirely sure.

28:12.890 --> 28:20.670
So the electronic locks accept both pin and RFIDs or RFID plus pins as access mediums.

28:20.950 --> 28:23.790
And they do provide audit log support.

28:23.970 --> 28:26.370
So let's talk about the LS series of locks.

28:26.370 --> 28:31.870
These are based on the STM32 MCU, and they also have SPI EEPROM.

28:31.870 --> 28:38.290
As for security, we found that SWD and debugging was not disabled and their EEPROM is not encrypted.

28:38.930 --> 28:43.050
And we noticed a lack of physical tamper switches in the locks.

28:44.050 --> 28:49.010
So as you can see, these are PCBs for three different locks.

28:49.010 --> 28:53.770
We think that they tried to save money by using the same design for nearly a decade.

28:54.630 --> 28:58.650
They use the same PCB, but they leave ICs unpopulated.

28:58.650 --> 29:11.670
So if you buy a lock that has pin support, you'll get an MCU for the keypad and a different MCU for RFID, and you'll get both for the RFID and pin supported locks.

29:11.670 --> 29:16.530
We also noted a difference in SPI EEPROM sizes.

29:17.270 --> 29:25.470
Okay, so let's talk about the management keys for some of the RFID SAG locks.

29:25.470 --> 29:31.490
So their RFID locks support MyFair Classic, MyFair Deskfire, and some ISO compatible tags.

29:31.790 --> 29:36.390
For the higher end locks, there are special RFID keys that are required for programming.

29:36.390 --> 29:38.610
There's a master key one and two.

29:38.610 --> 29:41.570
Those are used for unlocking and relocking lockers.

29:41.570 --> 29:48.690
There's also a data RFID tag for data transport, if you need to like pull audit logs off of certain locks.

29:48.690 --> 29:55.370
There's also like a physical communicator device, which is like an advanced handheld programmer, but we didn't take a look at that.

29:55.430 --> 30:04.290
We tried to procure a set of these programming keys, but they were $1,400 for eight MyFair Classic tags.

30:04.310 --> 30:09.170
So we didn't think it was worth the money, so we didn't take a look at those.

30:10.290 --> 30:16.130
So just a quick overview on how we dumped EEPROM contents just using an SOIC clip.

30:16.430 --> 30:22.870
We were able to interface with the EEPROM and dump the context, as you can see in the hex file.

30:22.870 --> 30:34.550
We were able to pull the master pin and the user set pin, this is just totally unencrypted EEPROM with pins that are available for anyone who can read it to see it.

30:34.930 --> 30:38.950
We also found that there are audit logs on the EEPROM as well.

30:38.950 --> 30:50.270
There are 500 entries, including a timestamp and a status code, with the status code 50 allowing you to see used pins and the RFID UIDs that have been used.

30:50.270 --> 30:54.670
So the last 500 you can see, yeah, all of that.

30:55.670 --> 30:58.030
So how did we extract firmware?

30:58.030 --> 31:08.970
We noticed on the PCB there was solder mask covering the SWD, like copper pads, so we scratched that off and we were able to interface with it and connect to SWD.

31:09.210 --> 31:13.730
And that allowed us to see that the devs didn't set the read protection byte.

31:14.330 --> 31:18.230
And as such, we were able to get the full firmware from these locks.

31:19.450 --> 31:24.050
So there are a couple of physical flaws on these locks.

31:24.050 --> 31:34.070
We noticed that the motor power wires and potentially debug pins are accessible from outside of the lock through a clipped plastic cover.

31:34.530 --> 31:43.030
So there's just a huge gap, as you can see, the power wires to the actual motor.

31:44.610 --> 31:49.410
And yeah, as you can see on the right, we were able to fit like a whole card under there.

31:49.410 --> 31:56.230
So that might allow us to tamper with the lock motor and do some physical hacking there.

31:56.910 --> 32:00.550
So we'll take it, we'll talk about a couple of other manufacturers now.

32:00.750 --> 32:03.170
One of them being Compact Security Company.

32:03.170 --> 32:05.690
This is a US company founded in 1903.

32:05.690 --> 32:07.530
So again, another pretty old company.

32:07.930 --> 32:10.170
We took a look at the regulator series.

32:10.170 --> 32:13.070
These use the PIC-16 MCU.

32:13.330 --> 32:17.010
And these locks accept user pins, technician pins, master pins.

32:17.010 --> 32:20.750
And there is some audit logging support for some models.

32:21.430 --> 32:26.570
As for security, we found that code data and write protection were enabled on all these locks.

32:26.570 --> 32:29.110
So that's good for them, but not very fun for us.

32:29.110 --> 32:31.770
So we kind of moved on.

32:31.770 --> 32:37.430
But we took a look at their documentation and saw what they were using for a programming slash audit tool.

32:37.850 --> 32:39.230
An Excel spreadsheet.

32:40.350 --> 32:45.250
I don't know what kind of Excel macro hell is happening here.

32:45.470 --> 32:48.710
I'm glad I'm not the person who has to maintain this and write this.

32:48.710 --> 32:51.370
But if it works for them, I'm happy for them.

32:51.370 --> 32:55.390
So next we'll talk about Kitlock.

32:55.390 --> 32:58.350
This is a sub-brand of CodeLocks.

32:58.350 --> 33:01.150
This is a UK-based company founded in 1991.

33:01.350 --> 33:04.110
This also uses the PIC-16 MCU.

33:04.230 --> 33:08.510
And again, accepts user pins, technician pins, and master pins.

33:08.750 --> 33:11.410
And again, they had code data and write protection enabled.

33:11.410 --> 33:14.790
So good for them, not fun for us.

33:14.870 --> 33:21.330
So for good measure, we took a look at a couple of no-name RFID locks from Amazon and eBay.

33:21.330 --> 33:23.390
These are just like $20 locks.

33:23.390 --> 33:24.570
Super cheap.

33:24.790 --> 33:29.250
We took them apart and found that they had EPROM and some kind of mystery MCU.

33:29.250 --> 33:33.750
If you like mystery MCUs and know what this is, let us know.

33:34.870 --> 33:42.890
Obviously, you can't really have many expectations of security on these cheap devices.

33:42.890 --> 33:49.510
So there's no encryption, no protection, and plain text RFID UIDs are just there for anyone to read it.

33:50.970 --> 33:58.810
Okay, so we're going to do a quick demo now to show how you can hack some of these locks.

33:59.630 --> 34:02.750
All right, due to the season, we will change the demo slightly.

34:02.750 --> 34:08.110
So usually, we were kind of thinking of doing a whole rundown on how we can extract manager keys and other things.

34:08.510 --> 34:14.970
What I would do instead is I would showcase our custom PCB, which we built ourselves and took us some time to develop it.

34:15.190 --> 34:20.210
What it basically does is it emulates the same function as a manager key, so I will just show you.

34:20.210 --> 34:27.250
So I locked all the lockers from DigiLock in this case, and I will just kind of show how I can hopefully open them again.

34:27.290 --> 34:28.130
Yeah.

34:29.370 --> 34:34.690
Okay, just like a quick example of a theoretical scenario.

34:34.690 --> 34:48.550
So we're going to assume that the attacker has access to any open locker or cabinet with the tools, the microchip, a picket 3 debugger, a Phillips screwdriver, and an Arduino and or flipper.

34:48.550 --> 34:50.010
We're using the flipper here.

34:50.390 --> 35:02.870
So our criminal has already set the key onto the flipper, and we are able to access the locks.

35:05.530 --> 35:10.290
Yeah, so to be fair, we put a lot of effort into like figuring it out already.

35:10.290 --> 35:16.470
So this is like basically if you got access to a lock, you somehow extracted that, you built that kind of tool.

35:16.530 --> 35:18.350
There's a magic back set which we don't show.

35:19.270 --> 35:23.230
So the attack will work very quickly after that.

35:23.230 --> 35:28.410
Now the obvious thing is if you want to extract secrets from these locks, you need to kind of disassemble them, so you need a screwdriver.

35:28.910 --> 35:34.630
The locks which are kind of just having the front part are super annoying because you need like a very special key to kind of unscrew them.

35:34.710 --> 35:41.130
But generally, to open and relock them again without resetting the original pin, that's basically all you need.

35:41.230 --> 35:43.530
But this might take you some time to do.

35:43.650 --> 35:44.710
All right.

35:44.890 --> 35:46.830
That's for that.

35:46.830 --> 35:48.490
Let's go to the conclusion.

35:49.850 --> 35:50.190
Okay.

35:50.190 --> 35:55.310
In summary, we were able to extract firmware and keys from these brands of locks.

35:56.450 --> 36:02.530
So access to one lock can give you access to all locks in one system or one location.

36:03.170 --> 36:06.130
Cloning and emulating keys is possible.

36:06.770 --> 36:12.250
And these attacks don't require complicated tools and are sometimes cheap unless you're using the flipper.

36:12.250 --> 36:13.750
That's a little bit more expensive.

36:14.250 --> 36:17.630
So how secure is your stuff in electronic lockers?

36:17.650 --> 36:19.450
Not super secure.

36:19.450 --> 36:24.030
But we need to be fair because these locks are not being sold as high security devices.

36:24.130 --> 36:27.550
They're not promising like military grade security or anything.

36:27.550 --> 36:30.650
These are just standard use locks.

36:30.830 --> 36:32.990
So how can we fix this?

36:33.050 --> 36:36.710
Of course we would recommend a security by design approach from the beginning.

36:36.950 --> 36:42.450
So enable all security features and always expect physical attacks when you're producing locks.

36:43.190 --> 36:46.410
Encrypt your secrets, store them in a secure way.

36:46.990 --> 36:52.050
So the best solution for vulnerable locks would be to have firmware updates for all of them.

36:52.050 --> 36:55.430
But depending on the age of the locks, this might not be possible.

36:55.430 --> 36:59.830
And in our opinion, it seems unfixable.

36:59.830 --> 37:03.590
So the workaround could be to use a programmer to enable code protection.

37:03.690 --> 37:08.490
But this only works if data is stored on the MCU and not on an external EEPROM chip.

37:08.650 --> 37:14.270
So this task is kind of complicated for an average and non-tech savvy user.

37:14.270 --> 37:16.730
So it's not a reasonable expectation.

37:16.730 --> 37:22.950
So the likely solution would be to buy new locks or just ignore the problem and hope it goes away.

37:24.630 --> 37:26.870
So takeaway lessons.

37:27.010 --> 37:30.790
Please don't reuse your important pins for lockers.

37:30.790 --> 37:32.610
Like public use lockers.

37:32.610 --> 37:36.930
Again, don't reuse your pins for your debit cards, your phone.

37:36.930 --> 37:38.390
Use separate things.

37:38.390 --> 37:42.270
Use like we're all using separate passwords now for everything I hope.

37:43.190 --> 37:48.590
So treat your pin like a password and never loan out your electronic keys.

37:48.590 --> 37:51.850
And always be aware of security limitations of devices.

37:52.390 --> 37:57.230
And you cannot trust audit logs of these devices because they can be tampered with.

37:57.230 --> 38:00.190
So even experienced and big companies make mistakes.

38:00.310 --> 38:04.190
And developing stuff is way harder than breaking it in 90% of cases.

38:04.190 --> 38:07.210
So be nice to developers.

38:07.270 --> 38:10.670
It's hard when people are attacking your stuff.

38:10.830 --> 38:14.930
And always remember there might be interesting cyber physical systems around you.

38:15.090 --> 38:17.910
So don't forget the human factor.

38:17.910 --> 38:20.510
Can you just ask nicely for the manager key?

38:22.130 --> 38:24.030
So final notes.

38:24.030 --> 38:26.590
Please don't break into lockers you don't own.

38:26.590 --> 38:28.810
I know these systems are in a lot of places.

38:28.810 --> 38:29.910
Hotels and such.

38:29.910 --> 38:32.030
But please don't.

38:32.330 --> 38:35.330
Messing with these locks can also permanently break them.

38:35.330 --> 38:38.590
Which is kind of the standard expectation when you're hardware hacking.

38:38.590 --> 38:41.070
You can always break things quite easily.

38:41.090 --> 38:42.150
Be careful.

38:42.450 --> 38:45.710
There are more attacks that we haven't covered here.

38:46.390 --> 38:50.450
Other companies and products are possibly vulnerable too.

38:50.450 --> 38:55.170
And just because they claim that they've never been hacked doesn't mean they're unhackable.

38:55.230 --> 38:56.250
Of course.

38:56.830 --> 38:58.130
And yeah.

38:58.230 --> 38:59.390
Thanks all.

39:05.060 --> 39:10.460
So I would like to also give special thanks to Corey who kind of connected us with Delorios.

39:10.460 --> 39:12.060
To Tara who did that too.

39:12.060 --> 39:14.840
To our counsel Hannah and Kurt.

39:14.840 --> 39:16.260
And to Andrew.

39:16.260 --> 39:17.600
And everyone at EFF.

39:17.600 --> 39:24.280
This kind of gave me again a motivation to definitely donate a lot of money to the EFF.

39:24.660 --> 39:34.000
One maybe side story is that Braylon was at B-Sides before this event and was getting a membership for EFF and was kind of joking like oh we might need you tomorrow.

39:34.060 --> 39:41.320
And lo and behold literally one day after that, on her birthday of all effects, both of us got a cease and desist letter .

39:41.480 --> 39:44.360
So if you have questions, we might be still around here.

39:44.440 --> 39:46.660
Otherwise feel free to contact us.

39:47.500 --> 39:48.040
Yeah.

39:48.040 --> 39:49.720
And thank you very much for being here.

39:51.140 --> 39:51.780
Right.

39:51.780 --> 39:52.240
So yeah.

39:52.240 --> 39:54.940
If you also want to read the statement, it will be in the slides.

39:55.080 --> 39:58.920
And I hope we will find a solution also to kind of fix the older locks.

39:58.920 --> 40:01.800
So there's probably a way we will figure it out together.

40:01.800 --> 40:02.560
Thank you.

