[00:00.350 --> 00:08.630] Alright. Are we ready? So today's talk is called mutual authentication is optional. And it's [00:08.630 --> 00:14.610] going to get into how we can get past HID I class SE readers that are enforcing secure [00:14.610 --> 00:21.730] credentials. We'll also go over a technical overview of all the other I class credentials. So [00:21.730 --> 00:28.750] who am I? So my name is Xavier. And I like all things physical security and I am a RFID [00:28.750 --> 00:40.140] researcher. I'm a HID credential enthusiast. I like NFC. So yeah, that's me. So today we're [00:40.140 --> 00:44.960] going to cover a few things in our agenda today. We're going to go over cloning, [00:44.960 --> 00:49.560] downgrading, emulation, and we're going to get into buildings enforcing secure credentials [00:49.560 --> 00:58.340] without one. So we're going to go over a few ways to get an exploit HID I class credentials to [00:58.340 --> 01:03.560] gain unauthorized access into a facility. So we're going to go over four different attacks [01:03.560 --> 01:08.880] today in varied degrees of complexity. So the most simple one attack we're going to go over [01:08.880 --> 01:15.780] is cloning, which is going to be the least complicated attack. Most I class legacy [01:15.780 --> 01:24.560] credentials use the standard authentication key, which has been obtained in the heart of [01:24.560 --> 01:30.020] darkness paper in 2010. Now, if you've not read this legendary paper yet, you should go, [01:30.020 --> 01:38.160] it's totally worth a read. If the systems are not standard key, those keys can be extracted [01:38.160 --> 01:45.260] using a attack called low class. Overall, these credentials are fairly trivial to make a copy [01:45.260 --> 01:50.860] of. It's been, it's, it's, it's been done for over a decade now. So nothing much to write home [01:50.860 --> 01:58.040] about. But we're going to have to cover it anyways. Our next attack we're going to go over is a [01:58.040 --> 02:02.520] downgrade attack, where we're going to take a secure credential, we're going to move the payload [02:02.700 --> 02:09.440] over to a insecure credential. So for example, this would be turning an SE credential into a legacy [02:10.960 --> 02:17.400] credential. We're also going to cover emulation today. So what if that downgrade didn't work? [02:17.400 --> 02:22.760] We're going to do something by emulating a virtual credential. So this can be done with like [02:22.760 --> 02:28.980] electronic tools such as the Proxmark 3 or the Flipper 0. This exploits the HID present [02:28.980 --> 02:38.980] transitional credentials, also known as SR. And finally, the fun part of today's talk is going to [02:38.980 --> 02:46.820] be exploiting the bugs in reader firmware to gain access to facilities that only only enforce using [02:46.960 --> 02:54.880] a secure credential. So we're going to go over some background tech today so you guys sort of [02:54.880 --> 02:59.320] know what we are talking about. So you guys are all familiar with physical access control [02:59.320 --> 03:06.340] systems, right? You probably interact with one without thinking twice. There are a ton of those [03:06.340 --> 03:20.120] HID rev e-readers scattered around this convention floor today. Uh, weekend protocol. That is the [03:20.120 --> 03:25.200] signaling protocol between the reader and the controller. Simple signaling protocol over two [03:25.200 --> 03:31.560] wires. Really old actually. Developed by John Wiegand in 1975. Still used today in the majority [03:31.560 --> 03:37.180] of installations. It is basically just binary data that is being transmitted to the reader to the [03:37.180 --> 03:42.400] door controller. And it is up to the controller to determine access. The reader is just there to [03:42.400 --> 03:47.980] read the credential. These are usually padded with a preamble to tell the controller what bit [03:47.980 --> 03:54.320] length the uh, the credential is. And also has a uh, checksum to ve- verify the data [03:54.320 --> 04:02.500] integrity. You know, access control systems, access control controllers are pretty dumb. They [04:02.500 --> 04:07.580] can't tell what type of credential is presented for the most part. So they only read [04:07.580 --> 04:11.800] credentials. So in the case of my class, it is going to read any credential that has the same [04:11.800 --> 04:17.040] key. And we know, well the cards have the same key for the most part. This just doesn't cover [04:17.040 --> 04:24.780] like, special functions such as readers in key rolling or any uh, and they're just gonna, it's [04:24.780 --> 04:31.380] up to the controller to determine access. Whether to allow or deny the access. And finally, [04:31.380 --> 04:36.300] card cloning. That is just gonna be making a physical copy of a credential onto another [04:36.300 --> 04:42.380] credential. Just a direct copy. Card emulation would be to make a digital copy of a physical [04:42.380 --> 04:48.520] credential. With the, and emulating that with a device, like a Proxmark 3 or a Flipper 0. A [04:48.520 --> 04:55.100] real world use case for this would be the HIV transitional credentials called SR, I-class SR. [04:55.560 --> 05:03.120] And uh, those have a unique part where these uh, the secure part of the credential, the secure [05:03.120 --> 05:07.800] identity object is actually s- is actually cryptographically bound to the card's serial [05:07.800 --> 05:13.900] number. And since there are no uh, serial number changeable I-class cards, you're unable to [05:13.900 --> 05:21.380] make a uh, direct copy, which means we're going to emulate those. Here are just an overview of [05:21.380 --> 05:26.200] all the different uh, HIV credential types. Starting with Prox. It's a bit out of scope for [05:26.200 --> 05:32.920] today's topic, but we have a reader here anyway. It's a, it's a low frequency credential. And [05:32.920 --> 05:38.880] then moving on to around 2000, we have I-class Legacy that first came out. And uh, those were [05:38.880 --> 05:46.800] unique because those were actually encrypted with a 64-bit key. These were broken in 2010 by a [05:46.800 --> 05:50.740] Milos Mariak during the Heart of Darkness attack, where two readers were actually [05:51.280 --> 05:57.740] destructively attacked in a way to dump the firmware to derive the master identification keys. [05:57.740 --> 06:02.900] Going on to around the 2010s, we have the uh, we have I-class SE, also known as the [06:02.920 --> 06:13.820] SIO-enabled. SIO meaning secure identity object. And SEOS would still be the uh, flagship [06:13.820 --> 06:21.980] credential from HID up to today. So we're going to go over a few possible attack vectors. So [06:21.980 --> 06:27.980] we're going to go over card-only attacks, and card and reader attacks. Card-only attacks are [06:27.980 --> 06:32.580] very simple because it involves one thing, the physical credential itself, and that's it. [06:32.580 --> 06:37.660] But you can only do a limited things with um, with just a card. One attack that's possible is [06:37.660 --> 06:44.120] just a downgrade to IPOC Legacy, because they would just send the same PAX payload on a [06:44.120 --> 06:49.760] different type of media. You can think of cards as just an encrypted storage device, like a [06:49.760 --> 06:54.740] USB stick, but crappier. Since you can just read the distance from quite a distance in the [06:54.740 --> 07:02.240] case of I-class. The power efficiency, simple cryptography, and the ISO 15693 protocol all [07:02.240 --> 07:11.180] contribute to enhanced read ranges, using long-range readers. This is when card and reader [07:11.180 --> 07:17.320] attacks come in. Card and reader attacks are very fun, because you would think the reader on [07:17.320 --> 07:24.000] the building is there to secure the, secure the building, right? But we're going to use that [07:24.000 --> 07:29.280] exact reader that's outside the building, and use that to compromise the security of the [07:29.280 --> 07:40.630] building, which we'll get into a bit later. So how secure are each of these HID credentials? So [07:40.630 --> 07:45.010] starting with the least secure one that is broken for over a decade now, we have I-class [07:45.010 --> 07:51.570] Legacy. The cryptography is completely broken, keys are leaked. Card's serial number is not [07:51.570 --> 07:57.910] relevant in the PAX payload, which means cloning is extremely trivial. And elite keys are [07:57.910 --> 08:05.310] recoverable by low-class attack. PAX payload is easily transferable by copying block six to [08:05.310 --> 08:13.250] nine to another card. We have I-class SR, which is a transitional conditional, and the [08:13.250 --> 08:18.810] application instruction area on the card is going to tell the reader that it has a secure [08:18.810 --> 08:27.130] identity object. This is good for transitioning between buildings that have SE, secure readers, [08:27.130 --> 08:33.010] and legacy readers. And these are easily downgradable to I-class Legacy, or you can emulate [08:33.010 --> 08:39.970] this credential with the correct card's serial number for a complete clone. Going to I-class [08:39.970 --> 08:46.850] SE, standard key and the key deprivation function are not leaked, and the keys are not [08:46.850 --> 08:53.090] recoverable by low-class. Currently we still do not have the master authentication key for SE. [08:53.090 --> 08:58.930] These can be standard, elite keyed, or custom keyed, and these can also be duplicated if it's [08:58.930 --> 09:07.530] an open format, like HID 26-bit, and you'll be able to use a HID encoder to create another SE [09:07.530 --> 09:14.270] card, actually a legit copy, because they are freely encodable. It's an open format. These are [09:14.270 --> 09:20.270] also downgradable to Legacy or SR, and these can also be emulated, which we'll get into, and it [09:20.270 --> 09:27.590] will work on most readers. So we're going to get, so how are we going to get past HID readers [09:27.590 --> 09:33.050] that are enforcing secure credentials? The first would be a downgrade. So using official HID [09:33.050 --> 09:38.550] hardware against their credentials to perform downgrade attacks. So we're going to use a HID [09:38.550 --> 09:42.490] Omni-key reader, which is the official HID hardware that plugs into a computer, acts like a [09:42.490 --> 09:50.250] keyboard, and we're just going to configure it to spit out the payload data, along with the [09:50.250 --> 09:56.110] commands in the Proxmark 3 to just make another copy without ever typing on the computer. We [09:56.110 --> 10:15.370] have a quick demo of this here. And one of the cards is SE and one of the cards is Legacy. We're [10:15.370 --> 10:19.910] just going to put the Legacy card on the Proxmark, and we're going to read the SE card on [10:19.910 --> 10:40.200] the HID reader. Types out the command, and there you go. The downgrade is done. Like this person, [10:40.220 --> 10:45.480] said, like the cheapest way isn't even to use the flipper with that add-on board to downgrade the [10:45.480 --> 10:51.460] SE cards anymore. You can literally just buy that HID reader on Amazon for about $130, load up [10:51.460 --> 11:00.120] that config, and it's ready to downgrade any amount of standard keyed SE credentials. So now [11:00.120 --> 11:05.520] we're going to get into iClass SR. We have another way. So we're going to emulate an iClass SR [11:05.520 --> 11:10.820] with the correct card serial number and the secure identity object. And to accomplish this, we're [11:10.820 --> 11:14.980] going to actually need to do something special, which is dump the SIO, the secure identity [11:14.980 --> 11:23.020] object. So here in this example, we're going to get the publicly accessible parts of the card, [11:23.020 --> 11:27.920] which is the uh, the card serial number, the EPRS, and the application instruction area from [11:27.920 --> 11:33.020] that iClass SE card. And we're going to populate those values in a dump file and get them ready [11:33.020 --> 11:40.260] to emulate. And that those bytes 0006 instructs the reader that, hey, there is an SIO. We're [11:40.260 --> 11:43.740] going to use the reader on the building that's supposed to secure against, secure the [11:43.740 --> 11:52.740] building against, like attackers, to generate a successful challenge to dump the card. So once [11:52.740 --> 11:56.640] you have emulated that partial card against that reader, you're going to gather a trace. So [11:56.640 --> 12:00.240] that's what the reader is, that's what the reader is sending to the card and we're intercepting [12:00.240 --> 12:07.440] that data. And we see here, where we underline here, as that there is a MAC that we got. A [12:07.440 --> 12:10.620] message authentication code and that is what we're going to use to generate a successful [12:10.620 --> 12:17.660] challenge to dump that credential. So, after we have got, gotten that, we're going to run [12:17.660 --> 12:23.200] that standard dump command and what, what you got? The card just puked out all of its secure [12:23.200 --> 12:28.880] contents that's supposed to be secure. So manual dumping of that SIO is possible on the [12:28.880 --> 12:35.420] command line. But to build on that recently, Eric Betts, Betsy, also implemented NRMAC [12:35.420 --> 12:40.140] dumping on the Flipper Zero very recently with a very intuitive workflow. And this allows [12:40.140 --> 12:44.600] reading the publicly accessible parts of the card without authentication. Emulating that on [12:44.600 --> 12:52.700] the reader and, and using that to generate a successful challenge to dump the card. This as a [12:52.700 --> 12:57.880] side effect also allows users of the Flipper Zero who do not have a NARD add-on board or the [12:57.880 --> 13:06.040] secure access module to dump the credential, send it to someone who has that reader and to use [13:06.040 --> 13:14.240] that, to use that and use that to decrypt the copy and make a logical copy off-site. So, we're [13:14.240 --> 13:18.240] going to prepare our traditional, transitional credential by just transferring those over to [13:18.240 --> 13:27.580] the, to another card. Like we see here, those, the blue blocks are transferred under the, under [13:27.580 --> 13:38.890] the legacy payload and there we go, we have the SR credential already done. So, now we're [13:38.890 --> 13:45.490] going to get into the readers that enforce secure credentials. So, now we do have, since we [13:45.490 --> 13:50.910] have a full dump of that SE card already, we can emulate the high security SIO only secure [13:50.910 --> 13:55.750] credential using a bug in reader firmware that was originally discovered by NVX about a year [13:55.750 --> 14:02.630] and a half ago and also ported over to the Flipper Zero by editing some code. So, these [14:02.630 --> 14:10.090] actually work on signal readers, revision uh, on firmware 10.0, 5.6 or older and REV-E [14:10.090 --> 14:14.150] readers are still not patched at the moment. And you can also use reader manager to inspect [14:14.150 --> 14:17.570] those signal readers without even being close to them and you can verify what firmware they [14:17.570 --> 14:33.380] are running. So, we can make, we can make installations more secure in a few ways. By using a [14:33.380 --> 14:40.460] high security key set, such as standard two. Elite custom keys for SE installations. Updating [14:40.460 --> 14:45.220] firmware. Disabling or disabling all legacy technologies that issue secure credentials, such [14:45.220 --> 14:51.620] as SEOS, Desfire, mobile credentials. And now we're going to get into some fun stuff. What not [14:51.620 --> 14:57.180] to do. Over the years I've seen a lot of terrible installations of secure credentials being [14:57.180 --> 15:03.300] issued to clients. Such as this one here. You can see this is a very popular vendor in [15:03.300 --> 15:07.260] Canada. They're located in BC. And they have all the latest signal readers on all their [15:07.260 --> 15:11.640] buildings. But um, all their readers are pro- all their credentials are programmed with the [15:11.640 --> 15:15.080] same facility code as laid out in their official documentation that's available publicly [15:15.080 --> 15:22.920] online. And what do you know? All the, all the legacy technologies are enabled on that [15:22.920 --> 15:30.200] reader too. So, yeah. You can just, they are easily downgradable. And that's not even the [15:30.200 --> 15:35.220] worst part. Is that you don't even need the credential to make a copy. Because since we [15:35.220 --> 15:40.400] know that the facility code is the same, we can just uh, if the numbers aren't rubbed off on [15:40.400 --> 15:44.700] the back yet, we can just uh, take those numbers and just encode another one. And it's [15:44.700 --> 15:51.760] going to work. So given what we know, we can literally make a copy of that FOB in that [15:51.760 --> 15:56.420] picture there. And we can make a logical copy that is going to work on all of those readers [15:56.830 --> 16:04.730] from this specific integrator. And that concludes my presentation for today. I want to [16:04.730 --> 16:10.230] say I have a special thanks for the RFID hacking community. Uh, Eric Betts, also known as [16:10.230 --> 16:15.970] Betsy, has the uh, pretty good documentation on all the uh, I-class uh, credentials and how [16:15.970 --> 16:22.250] the data is laid out. NBX, who discovered, originally discovered the authentication [16:22.250 --> 16:29.950] bypass bug, which allows working uh, allows um, working I-class SE emulation, as well as the [16:29.950 --> 16:36.670] people class emulation code for the Flipper Zero. Kate, or Miss Steel Dev, genius on all [16:36.670 --> 16:43.430] things HID, and have to thank her for uh, taking in my uh, HID readers that I have [16:43.430 --> 16:52.150] ricked by bad firmware updates. And Iceman, and I wouldn't be here without Iceman urging me [16:52.150 --> 16:59.850] to do this talk on uh, I-class SE today. So if you have any questions, I'll be at the NFC [16:59.850 --> 17:05.170] table in the RF village. And thank you for attending.