WEBVTT

00:00.350 --> 00:01.290
Alright.

00:01.990 --> 00:03.410
Are we ready?

00:04.650 --> 00:08.250
So today's talk is called mutual authentication is optional.

00:08.270 --> 00:15.750
And it's going to get into how we can get past HID I class SE readers that are enforcing secure credentials.

00:15.750 --> 00:20.190
We'll also go over a technical overview of all the other I class credentials.

00:21.150 --> 00:22.890
So who am I?

00:22.930 --> 00:24.650
So my name is Xavier.

00:25.010 --> 00:29.770
And I like all things physical security and I am a RFID researcher.

00:29.770 --> 00:32.290
I'm a HID credential enthusiast.

00:32.290 --> 00:33.750
I like NFC.

00:34.090 --> 00:35.890
So yeah, that's me.

00:39.100 --> 00:42.520
So today we're going to cover a few things in our agenda today.

00:42.520 --> 00:51.100
We're going to go over cloning, downgrading, emulation, and we're going to get into buildings enforcing secure credentials without one.

00:52.200 --> 01:01.060
So we're going to go over a few ways to get an exploit HID I class credentials to gain unauthorized access into a facility.

01:01.860 --> 01:05.920
So we're going to go over four different attacks today in varied degrees of complexity.

01:06.260 --> 01:13.300
So the most simple one attack we're going to go over is cloning, which is going to be the least complicated attack.

01:14.540 --> 01:26.320
Most I class legacy credentials use the standard authentication key, which has been obtained in the heart of darkness paper in 2010.

01:26.960 --> 01:31.540
Now, if you've not read this legendary paper yet, you should go, it's totally worth a read.

01:32.800 --> 01:40.760
If the systems are not standard key, those keys can be extracted using a attack called low class.

01:42.440 --> 01:45.980
Overall, these credentials are fairly trivial to make a copy of.

01:45.980 --> 01:49.140
It's been, it's, it's, it's been done for over a decade now.

01:49.140 --> 01:51.560
So nothing much to write home about.

01:51.940 --> 01:54.620
But we're going to have to cover it anyways.

01:55.420 --> 02:04.020
Our next attack we're going to go over is a downgrade attack, where we're going to take a secure credential, we're going to move the payload over to a insecure credential.

02:04.160 --> 02:09.440
So for example, this would be turning an SE credential into a legacy credential.

02:10.960 --> 02:13.520
We're also going to cover emulation today.

02:14.400 --> 02:17.400
So what if that downgrade didn't work?

02:17.400 --> 02:21.520
We're going to do something by emulating a virtual credential.

02:21.560 --> 02:26.260
So this can be done with like electronic tools such as the Proxmark 3 or the Flipper 0.

02:26.520 --> 02:32.760
This exploits the HID present transitional credentials, also known as SR.

02:34.400 --> 02:48.160
And finally, the fun part of today's talk is going to be exploiting the bugs in reader firmware to gain access to facilities that only only enforce using a secure credential.

02:50.540 --> 02:56.540
So we're going to go over some background tech today so you guys sort of know what we are talking about.

02:56.920 --> 03:00.520
So you guys are all familiar with physical access control systems, right?

03:02.240 --> 03:05.420
You probably interact with one without thinking twice.

03:05.580 --> 03:09.560
There are a ton of those HID rev e-readers scattered around this convention floor today.

03:11.760 --> 03:19.360
Uh, weekend protocol.

03:19.380 --> 03:22.940
That is the signaling protocol between the reader and the controller.

03:23.360 --> 03:26.160
Simple signaling protocol over two wires.

03:26.160 --> 03:27.340
Really old actually.

03:27.340 --> 03:29.840
Developed by John Wiegand in 1975.

03:29.960 --> 03:32.760
Still used today in the majority of installations.

03:33.480 --> 03:38.280
It is basically just binary data that is being transmitted to the reader to the door controller.

03:38.460 --> 03:41.360
And it is up to the controller to determine access.

03:41.360 --> 03:43.580
The reader is just there to read the credential.

03:44.200 --> 03:50.360
These are usually padded with a preamble to tell the controller what bit length the uh, the credential is.

03:50.380 --> 03:55.240
And also has a uh, checksum to ve- verify the data integrity.

03:56.920 --> 04:01.580
You know, access control systems, access control controllers are pretty dumb.

04:02.020 --> 04:05.840
They can't tell what type of credential is presented for the most part.

04:06.420 --> 04:08.420
So they only read credentials.

04:08.420 --> 04:12.500
So in the case of my class, it is going to read any credential that has the same key.

04:12.500 --> 04:15.740
And we know, well the cards have the same key for the most part.

04:16.160 --> 04:27.020
This just doesn't cover like, special functions such as readers in key rolling or any uh, and they're just gonna, it's up to the controller to determine access.

04:27.020 --> 04:29.520
Whether to allow or deny the access.

04:30.380 --> 04:32.520
And finally, card cloning.

04:32.760 --> 04:36.860
That is just gonna be making a physical copy of a credential onto another credential.

04:36.860 --> 04:38.340
Just a direct copy.

04:39.260 --> 04:42.980
Card emulation would be to make a digital copy of a physical credential.

04:43.160 --> 04:47.620
With the, and emulating that with a device, like a Proxmark 3 or a Flipper 0.

04:48.000 --> 04:55.100
A real world use case for this would be the HIV transitional credentials called SR, I-class SR.

04:55.560 --> 05:08.320
And uh, those have a unique part where these uh, the secure part of the credential, the secure identity object is actually s- is actually cryptographically bound to the card's serial number.

05:08.720 --> 05:17.860
And since there are no uh, serial number changeable I-class cards, you're unable to make a uh, direct copy, which means we're going to emulate those.

05:19.900 --> 05:23.800
Here are just an overview of all the different uh, HIV credential types.

05:23.800 --> 05:25.100
Starting with Prox.

05:25.100 --> 05:28.920
It's a bit out of scope for today's topic, but we have a reader here anyway.

05:30.220 --> 05:32.400
It's a, it's a low frequency credential.

05:32.720 --> 05:37.980
And then moving on to around 2000, we have I-class Legacy that first came out.

05:38.220 --> 05:43.940
And uh, those were unique because those were actually encrypted with a 64-bit key.

05:44.500 --> 05:55.480
These were broken in 2010 by a Milos Mariak during the Heart of Darkness attack, where two readers were actually destructively attacked in a way to dump the firmware to derive the master identification keys.

05:56.840 --> 06:05.020
Going on to around the 2010s, we have the uh, we have I-class SE, also known as the SIO-enabled.

06:05.120 --> 06:08.040
SIO meaning secure identity object.

06:09.900 --> 06:16.520
And SEOS would still be the uh, flagship credential from HID up to today.

06:17.960 --> 06:21.040
So we're going to go over a few possible attack vectors.

06:21.340 --> 06:26.680
So we're going to go over card-only attacks, and card and reader attacks.

06:26.720 --> 06:32.580
Card-only attacks are very simple because it involves one thing, the physical credential itself, and that's it.

06:32.580 --> 06:35.900
But you can only do a limited things with um, with just a card.

06:36.380 --> 06:45.220
One attack that's possible is just a downgrade to IPOC Legacy, because they would just send the same PAX payload on a different type of media.

06:46.180 --> 06:51.140
You can think of cards as just an encrypted storage device, like a USB stick, but crappier.

06:51.920 --> 06:55.740
Since you can just read the distance from quite a distance in the case of I-class.

06:56.840 --> 07:06.580
The power efficiency, simple cryptography, and the ISO 15693 protocol all contribute to enhanced read ranges, using long-range readers.

07:09.440 --> 07:12.620
This is when card and reader attacks come in.

07:12.820 --> 07:21.060
Card and reader attacks are very fun, because you would think the reader on the building is there to secure the, secure the building, right?

07:22.320 --> 07:31.320
But we're going to use that exact reader that's outside the building, and use that to compromise the security of the building, which we'll get into a bit later.

07:36.270 --> 07:39.470
So how secure are each of these HID credentials?

07:40.430 --> 07:45.850
So starting with the least secure one that is broken for over a decade now, we have I-class Legacy.

07:46.530 --> 07:49.730
The cryptography is completely broken, keys are leaked.

07:49.890 --> 07:55.750
Card's serial number is not relevant in the PAX payload, which means cloning is extremely trivial.

07:56.570 --> 08:00.610
And elite keys are recoverable by low-class attack.

08:01.190 --> 08:07.970
PAX payload is easily transferable by copying block six to nine to another card.

08:08.830 --> 08:20.350
We have I-class SR, which is a transitional conditional, and the application instruction area on the card is going to tell the reader that it has a secure identity object.

08:21.170 --> 08:28.690
This is good for transitioning between buildings that have SE, secure readers, and legacy readers.

08:28.690 --> 08:37.590
And these are easily downgradable to I-class Legacy, or you can emulate this credential with the correct card's serial number for a complete clone.

08:38.770 --> 08:48.530
Going to I-class SE, standard key and the key deprivation function are not leaked, and the keys are not recoverable by low-class.

08:49.010 --> 08:53.090
Currently we still do not have the master authentication key for SE.

08:53.090 --> 09:11.910
These can be standard, elite keyed, or custom keyed, and these can also be duplicated if it's an open format, like HID 26-bit, and you'll be able to use a HID encoder to create another SE card, actually a legit copy, because they are freely encodable.

09:11.910 --> 09:13.090
It's an open format.

09:13.770 --> 09:22.010
These are also downgradable to Legacy or SR, and these can also be emulated, which we'll get into, and it will work on most readers.

09:23.250 --> 09:29.630
So we're going to get, so how are we going to get past HID readers that are enforcing secure credentials?

09:29.630 --> 09:31.550
The first would be a downgrade.

09:31.550 --> 09:36.250
So using official HID hardware against their credentials to perform downgrade attacks.

09:36.250 --> 09:55.690
So we're going to use a HID Omni-key reader, which is the official HID hardware that plugs into a computer, acts like a keyboard , and we're just going to configure it to spit out the payload data, along with the commands in the Proxmark 3 to just make another copy without ever typing on the computer.

09:55.990 --> 09:58.010
We have a quick demo of this here.

10:11.850 --> 10:15.150
And one of the cards is SE and one of the cards is Legacy.

10:15.150 --> 10:21.510
We're just going to put the Legacy card on the Proxmark, and we're going to read the SE card on the HID reader.

10:24.460 --> 10:28.320
Types out the command, and there you go.

10:28.320 --> 10:29.620
The downgrade is done.

10:39.220 --> 10:46.700
Like this person, said, like the cheapest way isn't even to use the flipper with that add-on board to downgrade the SE cards anymore.

10:46.700 --> 10:56.480
You can literally just buy that HID reader on Amazon for about $130, load up that config, and it's ready to downgrade any amount of standard keyed SE credentials.

10:59.380 --> 11:01.760
So now we're going to get into iClass SR.

11:01.760 --> 11:03.100
We have another way.

11:03.240 --> 11:08.880
So we're going to emulate an iClass SR with the correct card serial number and the secure identity object.

11:09.140 --> 11:15.900
And to accomplish this, we're going to actually need to do something special, which is dump the SIO, the secure identity object.

11:17.740 --> 11:29.540
So here in this example, we're going to get the publicly accessible parts of the card, which is the uh, the card serial number, the EPRS, and the application instruction area from that iClass SE card.

11:29.660 --> 11:33.900
And we're going to populate those values in a dump file and get them ready to emulate.

11:33.960 --> 11:39.840
And that those bytes 0006 instructs the reader that, hey, there is an SIO.

11:39.900 --> 11:49.600
We're going to use the reader on the building that's supposed to secure against, secure the building against, like attackers, to generate a successful challenge to dump the card.

11:51.940 --> 11:56.440
So once you have emulated that partial card against that reader, you're going to gather a trace.

11:56.440 --> 12:01.100
So that's what the reader is, that's what the reader is sending to the card and we're intercepting that data.

12:01.220 --> 12:07.320
And we see here, where we underline here, as that there is a MAC that we got.

12:07.320 --> 12:12.500
A message authentication code and that is what we're going to use to generate a successful challenge to dump that credential.

12:14.820 --> 12:21.440
So, after we have got, gotten that, we're going to run that standard dump command and what, what you got?

12:21.440 --> 12:25.100
The card just puked out all of its secure contents that's supposed to be secure.

12:25.900 --> 12:30.720
So manual dumping of that SIO is possible on the command line.

12:31.140 --> 12:38.900
But to build on that recently, Eric Betts, Betsy, also implemented NRMAC dumping on the Flipper Zero very recently with a very intuitive workflow.

12:39.020 --> 12:43.660
And this allows reading the publicly accessible parts of the card without authentication.

12:43.660 --> 12:50.840
Emulating that on the reader and, and using that to generate a successful challenge to dump the card.

12:51.700 --> 13:11.880
This as a side effect also allows users of the Flipper Zero who do not have a NARD add-on board or the secure access module to dump the credential, send it to someone who has that reader and to use that, to use that and use that to decrypt the copy and make a logical copy off-site.

13:12.840 --> 13:19.680
So, we're going to prepare our traditional, transitional credential by just transferring those over to the, to another card.

13:19.680 --> 13:32.380
Like we see here, those, the blue blocks are transferred under the, under the legacy payload and there we go, we have the SR credential already done.

13:38.030 --> 13:43.530
So, now we're going to get into the readers that enforce secure credentials.

13:43.850 --> 14:00.810
So, now we do have, since we have a full dump of that SE card already, we can emulate the high security SIO only secure credential using a bug in reader firmware that was originally discovered by NVX about a year and a half ago and also ported over to the Flipper Zero by editing some code.

14:01.850 --> 14:11.870
So, these actually work on signal readers, revision uh, on firmware 10.0, 5.6 or older and REV-E readers are still not patched at the moment.

14:11.870 --> 14:18.430
And you can also use reader manager to inspect those signal readers without even being close to them and you can verify what firmware they are running.

14:27.420 --> 14:32.460
So, we can make, we can make installations more secure in a few ways.

14:32.480 --> 14:36.040
By using a high security key set, such as standard two.

14:36.280 --> 14:39.380
Elite custom keys for SE installations.

14:39.920 --> 14:41.460
Updating firmware.

14:41.660 --> 14:47.920
Disabling or disabling all legacy technologies that issue secure credentials, such as SEOS, Desfire, mobile credentials.

14:49.060 --> 14:51.260
And now we're going to get into some fun stuff.

14:51.260 --> 14:52.560
What not to do.

14:52.980 --> 14:59.080
Over the years I've seen a lot of terrible installations of secure credentials being issued to clients.

14:59.080 --> 15:00.840
Such as this one here.

15:01.340 --> 15:03.800
You can see this is a very popular vendor in Canada.

15:03.800 --> 15:05.080
They're located in BC.

15:05.120 --> 15:08.060
And they have all the latest signal readers on all their buildings.

15:08.740 --> 15:15.960
But um, all their readers are pro- all their credentials are programmed with the same facility code as laid out in their official documentation that's available publicly online.

15:18.960 --> 15:20.060
And what do you know?

15:20.060 --> 15:23.560
All the, all the legacy technologies are enabled on that reader too.

15:23.560 --> 15:25.460
So, yeah.

15:25.680 --> 15:28.400
You can just, they are easily downgradable.

15:28.820 --> 15:31.120
And that's not even the worst part.

15:31.320 --> 15:34.680
Is that you don't even need the credential to make a copy.

15:34.680 --> 15:44.200
Because since we know that the facility code is the same, we can just uh, if the numbers aren't rubbed off on the back yet, we can just uh, take those numbers and just encode another one.

15:44.200 --> 15:45.640
And it's going to work.

15:48.180 --> 15:52.520
So given what we know, we can literally make a copy of that FOB in that picture there.

15:52.700 --> 15:59.040
And we can make a logical copy that is going to work on all of those readers from this specific integrator.

16:01.990 --> 16:04.470
And that concludes my presentation for today.

16:04.470 --> 16:08.150
I want to say I have a special thanks for the RFID hacking community.

16:08.430 --> 16:17.510
Uh, Eric Betts, also known as Betsy, has the uh, pretty good documentation on all the uh, I-class uh, credentials and how the data is laid out.

16:18.890 --> 16:32.650
NBX, who discovered, originally discovered the authentication bypass bug, which allows working uh, allows um, working I-class SE emulation, as well as the people class emulation code for the Flipper Zero.

16:33.770 --> 16:46.110
Kate, or Miss Steel Dev, genius on all things HID, and have to thank her for uh, taking in my uh, HID readers that I have ricked by bad firmware updates.

16:46.530 --> 16:55.430
And Iceman, and I wouldn't be here without Iceman urging me to do this talk on uh, I-class SE today.

16:57.290 --> 17:01.630
So if you have any questions, I'll be at the NFC table in the RF village.

17:02.970 --> 17:05.170
And thank you for attending.

