WEBVTT

00:01.280 --> 00:06.860
Greetings and salutations and finally now good afternoon, the RF village.

00:08.240 --> 00:14.340
Our next speaker is going to bring to you a wonderful presentation on some iClass information.

00:17.940 --> 00:23.820
This might actually be slightly helpful for some stuff in the village, competitors.

00:24.540 --> 00:29.340
So, without further ado, I will turn it over to our speaker and he will take things from there.

00:35.490 --> 00:37.190
Hello, DEF CON.

00:39.760 --> 00:42.740
So, I've got to talk to you guys today.

00:43.280 --> 00:47.800
Is this set up so I can talk hands-free?

00:50.480 --> 00:53.140
So, I'm going to be talking about iClass today.

00:53.940 --> 00:58.500
And as the title might give away, throwing away the keys.

00:58.500 --> 01:04.340
Because we all know that for authenticated systems, you only need keys to talk to them.

01:04.340 --> 01:08.480
And sometimes you can get those keys easily, like iClass Legacy.

01:09.340 --> 01:11.040
And sometimes you can't.

01:12.420 --> 01:15.900
And this talk will be about what you do when you can't.

01:15.900 --> 01:19.680
And some of the interesting options that you have available to you.

01:19.940 --> 01:28.260
Because you think that normally you don't have keys, you can't do much.

01:28.260 --> 01:31.480
But that might not always be the case.

01:39.870 --> 01:42.450
All right, can you guys still hear me?

01:42.550 --> 01:43.490
Excellent.

01:45.110 --> 01:46.910
Mic a bit closer.

01:48.730 --> 01:49.850
That's a bit...

01:49.850 --> 01:50.970
What about now?

01:51.870 --> 01:52.670
Good?

01:52.830 --> 01:53.510
More?

01:53.510 --> 01:54.370
More!

01:54.990 --> 01:56.270
All right.

01:56.810 --> 02:01.590
So, what I'm going to talk to you about today, I'm going to give an introduction to who I am.

02:01.590 --> 02:04.110
Current state in iClass.

02:04.170 --> 02:07.230
My adventure is writing an iClass emulator, twice.

02:08.770 --> 02:12.230
The interesting authentication bypass I found.

02:12.250 --> 02:15.390
A bit of version analysis of what is and isn't affected.

02:15.630 --> 02:19.050
And then the adventure doing responsible disclosure.

02:19.410 --> 02:21.010
And where to from here.

02:22.830 --> 02:23.690
So, who am I?

02:23.690 --> 02:24.830
I'm Tianan.

02:24.830 --> 02:27.450
Or nvx on a lot of social things.

02:27.450 --> 02:28.350
GitHub.

02:28.630 --> 02:29.710
Discord.

02:30.190 --> 02:32.070
I'm just some guy that likes breaking things.

02:32.070 --> 02:33.690
I don't do this for a living.

02:33.870 --> 02:36.010
But I find it fun.

02:36.010 --> 02:39.570
So, I get home from being a software engineer.

02:39.670 --> 02:41.190
And break things.

02:41.190 --> 02:42.790
And sit in front of a computer more.

02:42.850 --> 02:44.650
Go from the bad screen to the good screen.

02:45.330 --> 02:51.590
I wrote the iClass, which is Picopass emulation code for the Chameleon Mini and Tiny platforms.

02:51.610 --> 02:54.030
And then later also for the Flipper Zero.

02:54.030 --> 02:55.010
Everyone's favorite.

02:55.630 --> 03:00.070
I also occasionally contribute to the Proxmark 3, Iceman 4 code base.

03:00.070 --> 03:02.310
And sometimes what I contribute even works.

03:04.010 --> 03:05.370
Sometimes not on the first attempt.

03:05.370 --> 03:06.870
But we get there in the end.

03:08.010 --> 03:10.930
And what I'm going to talk to you today is about iClass.

03:10.930 --> 03:13.570
Why you should stop using it in any forms.

03:13.850 --> 03:15.530
And dropping a new vulnerability.

03:15.530 --> 03:22.950
And the fun of responsibly disclosing vulnerabilities to vendors in this security space.

03:23.770 --> 03:29.490
So, I'm going to go through a brief current state of iClass.

03:29.490 --> 03:35.350
I'm going to assume a little bit of prior knowledge about RFID and packs in general.

03:35.950 --> 03:40.290
So, apologies if some of it, if you're brand new to RFID.

03:40.290 --> 03:43.730
I just don't think I've got the time to go super in-depth.

03:43.990 --> 03:49.030
Hopefully a lot of you came from the awesome talk that Babak, Nick and Aaron just did in the main stage.

03:49.030 --> 03:51.110
That would have covered quite a lot of it.

03:51.110 --> 03:51.950
That was a great talk.

03:51.950 --> 03:53.490
If you haven't, check the recording.

03:53.490 --> 03:54.470
It was great.

03:55.050 --> 03:56.990
So, what the fuck is iClass?

03:56.990 --> 04:00.850
So, it's RFID technology from HID Global.

04:00.910 --> 04:03.050
And it's mostly using corporate environments.

04:03.050 --> 04:05.830
It's fairly rare that you're going to see that at a hotel.

04:05.830 --> 04:09.770
It's for business, corporate, sort of where it's aimed at.

04:10.350 --> 04:12.430
And the chance that you've seen these in the wild.

04:12.430 --> 04:15.670
If it's not at your work, you've probably walked through an airport and seen them.

04:15.670 --> 04:25.810
Or walked through the Las Vegas Convention Center West Hall and seen these little black squares on the wall with a little red line at the top.

04:25.950 --> 04:27.170
I've got one here.

04:27.730 --> 04:29.130
They're super common.

04:29.130 --> 04:34.130
And to the right are those newer, sleeker looking ones.

04:34.130 --> 04:38.350
They're a newer version of those readers called Signo.

04:38.430 --> 04:40.670
But same sort of thing.

04:41.630 --> 04:46.190
And they talk to lots of different cards.

04:46.190 --> 04:48.170
What we're focusing on today is iClass.

04:48.170 --> 04:54.630
That can be a little white card like this that may or may not be printed with your employee badge on it.

04:54.630 --> 04:57.250
It could be a little key fob that you've got on your key chain.

04:57.250 --> 05:00.250
Sometimes they're used in apartment buildings for like the front door.

05:00.250 --> 05:04.570
You might have a key to your apartment, but the front door might be a little tappy tap thing.

05:04.870 --> 05:06.310
There's also like a sticker thing.

05:06.310 --> 05:08.570
That's that little black one at the top in the middle there.

05:09.350 --> 05:12.430
Haven't really seen those in the wild as much, but they exist.

05:12.430 --> 05:14.010
So chances are you've seen these.

05:14.090 --> 05:16.670
If not, actually use them.

05:17.330 --> 05:19.250
iClass is made by a company called Hid Global.

05:19.250 --> 05:21.310
They're a subsidiary of Assa Abloy.

05:21.550 --> 05:27.230
And one of the sort of original guys in the PAX world.

05:27.250 --> 05:33.230
They've got a pretty big market share, especially in US, Australia, and Singapore.

05:33.650 --> 05:36.090
But they're probably elsewhere too.

05:36.590 --> 05:38.470
And they've been around for ages.

05:38.510 --> 05:44.150
They started off with Hid Procs type stuff, just completely unsecured.

05:44.270 --> 05:47.490
And then went from there, I think that was in the 90s.

05:47.490 --> 05:51.130
So they're not one of these companies that have just sprung up.

05:52.470 --> 05:54.510
So a brief history of iClass.

05:54.510 --> 06:00.190
So in 2002, Hid iClass Legacy was released.

06:00.190 --> 06:03.530
And that was as a secure alternative to the 125 kHz Procs.

06:03.530 --> 06:08.050
That was just basically, you put the card in the field and it just starts shitting out some data.

06:08.450 --> 06:10.610
And that data is what let you into the building.

06:10.610 --> 06:17.070
So as you can imagine, not a super secure model where any reader could just put a 125 kHz field.

06:17.070 --> 06:18.810
And it'll start modulating it back.

06:20.350 --> 06:23.770
So they used a chip from Inside Contactless.

06:23.770 --> 06:26.530
I think they're Inside Secure now, or maybe it was the other way around.

06:26.730 --> 06:29.890
And they had a line of cards called Picopass.

06:29.990 --> 06:35.950
And they were based on 15693, ISO 15693 that is.

06:36.150 --> 06:40.850
And they had some proprietary command set, including anti-collision.

06:40.850 --> 06:45.310
So you can't just read it with your phone, even though your phone can read 15693 tags.

06:45.310 --> 06:48.190
Just because it's that proprietary command set.

06:48.390 --> 06:53.370
But it has some features that the 125 kHz Procs doesn't have.

06:53.770 --> 06:57.030
It's a bi-directional, so the reader actually talks first to the card.

06:57.030 --> 07:00.590
And back and forth, and part of that back and forth is a mutual authentication.

07:01.170 --> 07:05.030
To make sure that both the reader and the card are using the same keys.

07:05.050 --> 07:08.510
And if either doesn't match, it'll bomb out and, hey, you can't read the card.

07:08.510 --> 07:10.890
So, you know, your credential is a bit more secure.

07:12.010 --> 07:18.070
To make it even more secure again, and this is generally best practice, rather than just having like one key on every card.

07:18.070 --> 07:21.290
Like if I broke this one card, hey, I've got everyone's key, right?

07:21.290 --> 07:29.510
They'll have like a master key and then take like the serial number of the card and use that key to actually talk to the individual cards.

07:29.510 --> 07:31.650
And that's what's called key diversification.

07:32.190 --> 07:36.970
And following best practice, people add key diversification function.

07:37.170 --> 07:39.470
In fact, they implemented two for some reason.

07:39.470 --> 07:41.750
One for their what's called standard key.

07:42.690 --> 07:45.610
Standard keys is basically everyone's using the same key.

07:45.610 --> 07:47.250
Sounds like a bad idea, doesn't it?

07:47.250 --> 08:06.790
And their elite program was where you could have your own customer-specific key, fully managed by HID, so you sign up for their elite program and then you could get cards from them or later encode your own cards with your key and that meant that no one else's cards would work on your system at all because the keys were different.

08:07.850 --> 08:15.970
Fast forward to 2010, there was a really, really interesting bit of research published called The Heart of Darkness, Exploring the Uncharted Backwaters of HID iClass.

08:16.730 --> 08:26.530
They basically found that if you got one of the original readers, ripped it apart, you could dump the firmware off it through some very clever tricks that they did.

08:27.150 --> 08:30.770
And suddenly, anyone using standard keys, rip.

08:30.810 --> 08:35.510
Your keys are now known, anyone can read your cards, anyone can write new cards, game over.

08:35.830 --> 08:38.450
So the recommendation was move to elite.

08:40.010 --> 08:43.950
Just after that, the iClass SE platform was released.

08:43.950 --> 08:50.930
It may have actually been 2010, not 2011, but I was googling about that era.

08:51.430 --> 08:59.930
And they had moved on the newer reader platforms to what's called a secure element or a SAM.

08:59.930 --> 09:12.670
And that SAM has... it's basically a really small microcontroller that can do cryptographic operations and store keys to do those cryptographic operations that really harden them.

09:12.670 --> 09:16.750
So they're fairly resource limited, so you don't want to use it just for everything, because you can't.

09:16.750 --> 09:23.230
But they're designed with one job, and one job that it does really well is protecting those keys so you can't get those keys out.

09:23.410 --> 09:28.330
And with that, they launched a few new technologies.

09:28.330 --> 09:35.030
But iClass SE is basically... confusing, because they called the readers that and a whole bunch of stuff.

09:35.030 --> 09:37.510
But what we're focusing on is the iClass SE cards.

09:37.510 --> 09:45.270
And they're the same silicon as the original iClass legacy cards, but they changed the data on it.

09:45.270 --> 09:58.390
So rather than just being a optionally desk-based encrypted payload that was not diversified at all, it's now got a payload that's diversified on the card serial number as well.

09:58.390 --> 10:06.670
So rather than just the card keys to talk to the card being diversified, the actual encrypted data is now diversified based on the card as well, which is a good move.

10:06.670 --> 10:11.110
Because you can't just copy the data from one card to another even if you knew the card keys.

10:11.110 --> 10:12.170
A lot more secure.

10:12.370 --> 10:17.490
They also changed the keys from DES to AS.

10:18.790 --> 10:25.770
And with that, used NIST standard KDF function to make those diversified keys.

10:25.770 --> 10:45.290
So one of the next problems with iClass, especially Elite, the standard KDF wasn't as bad, but the Elite KDF in 2012, Flavio Garcia, who's done quite a lot of research in the RFID space, released the dismantling iClass and iClass Elite paper.

10:45.510 --> 11:02.430
And the big ticket takeaway from that one was that if you talk to a reader with certain card serial numbers, you could get the responses back from the reader, like you're doing sort of the first half of the authentication, and then just dropping out and swapping to the next one,

11:02.430 --> 11:11.410
and exploiting some cryptographic weaknesses in the KDF function that Elite keys used, you could actually recover the original Elite master key.

11:11.470 --> 11:16.910
So that meant that all legacy Elite systems game over just the same as legacy iClass.

11:18.030 --> 11:21.750
But the good news is, iClass SE, they use AS.

11:21.750 --> 11:23.090
You're not breaking AS.

11:23.090 --> 11:27.330
And you're definitely not breaking KDF that has been endorsed by NIST.

11:28.090 --> 11:29.030
It's pretty good.

11:29.030 --> 11:30.870
They did the right things with SE.

11:30.870 --> 11:36.670
So even though the cards have some issues, which we'll go into later, it was a pretty good secure alternative.

11:37.090 --> 11:48.830
And although they released support for SIOs on their SE platform with DSFIRE cards and also SEOS, the real advantages with the PicoPass cards are they were dirt cheap.

11:48.830 --> 11:50.390
You can get them cheaper than a DSFIRE.

11:50.390 --> 11:52.690
You can get them cheaper than a SEOS by far.

11:53.710 --> 11:59.610
Like, we're talking an order of magnitude difference in cost compared to SEOS.

12:00.130 --> 12:02.690
And, you know, maybe half the price of a DSFIRE.

12:02.690 --> 12:04.070
So, like, pretty attractive.

12:04.210 --> 12:13.110
The other nice thing is it's a very simple card that didn't draw much power from the reader, which meant that you could read it from the reader at a fair distance.

12:13.110 --> 12:15.830
Whereas, like, a SEOS and a DSFIRE, it's going to be pretty close.

12:16.110 --> 12:19.990
PROX and iClass could both be read from a further distance.

12:19.990 --> 12:24.130
So some people, you know, if they've got a card in their wallet and they don't want to take it out every day, they just, boop, against the reader.

12:24.330 --> 12:25.530
You know, we're not talking metres.

12:25.530 --> 12:27.250
We're talking a difference of centimetres.

12:29.730 --> 12:34.410
So there are definitely some PROs with the PicoPass technology.

12:35.270 --> 12:38.210
Roll forward to a bit further in 2021.

12:38.770 --> 12:40.550
Obviously, this is in the bridge history.

12:40.550 --> 12:43.430
There was definitely some more cool shit happening in between.

12:43.890 --> 12:53.710
But 2021, the Rev-E readers, which are these very square-looking ones, they're announced end of life and end of sale.

12:53.830 --> 13:00.490
That thing got extended the next year to the next month, end of life.

13:00.510 --> 13:04.590
I'm guessing the supply chain shortages hurt everyone.

13:05.150 --> 13:08.470
Because, yeah, I'm sure they would have loved to just sell you the new Signo readers.

13:08.470 --> 13:09.590
But , yeah.

13:10.010 --> 13:14.810
And in 2023, there was a really sweet app for everyone's favourite dolphin.

13:14.910 --> 13:16.910
It got released by Eric Betz.

13:17.230 --> 13:18.970
Betsy, with the propeller hat.

13:18.970 --> 13:19.950
Go hit him up.

13:20.030 --> 13:28.070
Called Cedar, which let you basically get one of those hid SAMs and act like a full reader like this, except, hey, it's your dolphin.

13:28.070 --> 13:35.930
And because the flipper was actually doing all of that, you could sniff the data going back and forth, which becomes important too.

13:35.930 --> 13:41.470
Like, you could still do it with a reader, but you'd have to have a reader and then a Proxmark attached to it and then put a card on front.

13:41.910 --> 13:43.190
It's a lot more hassle.

13:43.490 --> 13:49.170
So this streamlined that whole operation of doing downgrade attacks and sniffing that I'll go into a bit later.

13:51.370 --> 13:52.870
So, the new readers.

13:52.870 --> 13:53.870
iClass SE.

13:53.990 --> 13:55.730
I sort of went over this a bit before.

13:56.850 --> 14:03.590
The important bit is the SIOs are encrypted, signed, and cryptographically bound to the card serial number.

14:03.850 --> 14:05.970
So, with legacy, you could easily just grab the data.

14:05.970 --> 14:11.650
Like, even if you didn't have the encryption key to decrypt and mint your own Pax data.

14:11.650 --> 14:14.150
So, like, think the Wigan data that comes out, right?

14:14.150 --> 14:15.830
Your facility code card number.

14:16.310 --> 14:20.110
Even if you couldn't mint your own of those, you could just copy it from one card to another.

14:20.130 --> 14:21.310
Like, who cares?

14:21.770 --> 14:30.930
It wasn't like a session encryption where, like, the data going from the card back and forth was encrypted with the keys that you used to authenticate the card.

14:30.930 --> 14:33.510
These cards aren't that complex.

14:33.830 --> 14:35.470
So, it's just like a USB stick.

14:35.470 --> 14:38.430
You know, you can copy the data from one USB stick to another.

14:38.830 --> 14:41.170
Encrypted, unencrypted, who cares?

14:41.750 --> 14:49.370
Which is very different to, like, a secure channel with, you know, a SIOs or even DES fire if you're doing it right.

14:50.250 --> 14:52.190
So, that was a big step up from legacy.

14:52.190 --> 14:55.730
HID really do prioritize backwards compatibility, though.

14:55.730 --> 15:01.810
So, they also released what's called iClass SR, which is basically an iClass legacy card.

15:01.810 --> 15:05.010
Then they also tack on an SIO at the end.

15:05.070 --> 15:10.330
What that does mean, though, is that the actual card keys are the same as legacy.

15:10.950 --> 15:14.670
But you do get the advantage of the SIO and being pound to that CSN.

15:14.670 --> 15:19.490
So, even though you could copy the data to another card, the SIO isn't going to work anymore.

15:19.490 --> 15:21.650
But there's some problems with that.

15:22.890 --> 15:30.850
And they still offer the standard key set, also the elite, which is the HID managed custom keys per customer.

15:30.950 --> 15:33.730
And there is also a custom keying option.

15:34.330 --> 15:37.870
But that's not super common.

15:38.410 --> 15:41.750
And that's where basically the customer manages their own custom keys.

15:41.750 --> 15:44.710
But we're throwing away the keys, so who cares?

15:46.370 --> 15:48.610
So, this is the Cedar.

15:50.130 --> 15:51.330
That's what it looks like.

15:51.330 --> 15:52.290
It's pretty cool.

15:52.710 --> 15:54.790
And see that little blue board on the top?

15:54.790 --> 15:56.190
That's actually the SAM.

15:56.230 --> 15:58.830
And just a lot more convenient.

15:59.790 --> 16:03.210
So, iClass SE, like, we can do downgrades with Cedar.

16:03.210 --> 16:06.490
So, we can read the PACS data, and we can encode that to a legacy card.

16:06.590 --> 16:19.030
Or, if it's an SR card, you don't even really need Cedar, because you can just read the data directly off the card and just read the legacy PACS data, which is almost always the same as the SIO data, and then just downgrade it to a legacy card.

16:19.030 --> 16:19.990
It's like, meh.

16:21.450 --> 16:27.450
Unfortunately, lots of installations have legacy technology still enabled.

16:27.450 --> 16:36.910
At the beginning of this year, he'd made a push to disable legacy technologies, which was great, but I can guarantee that no one's really hitting their readers.

16:37.130 --> 16:39.350
It's going to be up to the integrators.

16:39.350 --> 16:41.810
No one likes to call out the integrators, just the funsies.

16:41.810 --> 16:42.590
It's working.

16:42.590 --> 16:43.530
It's fine.

16:44.370 --> 16:46.030
But let's ignore all that.

16:46.030 --> 16:51.770
Let's just assume that we've disabled legacy iClass, including SR, and now we've got this.

16:51.770 --> 17:00.210
Now, ideally, you're using elite keys, so they're just yours, but even if you're standard, standard keys aren't public.

17:00.210 --> 17:00.910
They're in the SAM.

17:00.910 --> 17:02.090
It should be secure, right?

17:02.690 --> 17:08.410
You can't just copy one of these cards and, you know, dip it on your reader.

17:08.510 --> 17:09.510
Right?

17:09.690 --> 17:10.450
Right?

17:10.810 --> 17:12.630
Ish, kind of.

17:13.450 --> 17:16.210
So, Pickup has got a few features.

17:16.570 --> 17:19.990
So, it's old.

17:21.490 --> 17:23.870
It's similar to areas like MyFairClassic.

17:23.870 --> 17:27.630
You know, it's definitely not as new as Desfire or Seoss.

17:29.110 --> 17:33.090
It's a lot better than 125 kilohertz procs, so, you know, for the day, that's great.

17:33.630 --> 17:35.590
But there's some limitations of that silicon.

17:35.590 --> 17:40.310
So, most things, when it's doing a mutual authentication, you want to have, like, a random number that you encrypt with a key.

17:40.310 --> 17:47.630
You send that, the other side decrypts it, changes it a little bit, encrypts it again, sends it back, you decrypt that, you check that it's legit.

17:48.050 --> 17:53.970
But that relies on random numbers, because you can't just replay the same authentication every time, right?

17:55.330 --> 17:59.130
And these cards don't have a random number generator on them.

17:59.170 --> 18:04.430
It's not like MyFairClassic, where the original ones had one, but it just wasn't great, and you could predict it.

18:04.430 --> 18:06.110
These just don't have one.

18:06.870 --> 18:17.150
So, instead, they've got what's called an e-purse value, which is designed for, like, a stored value type thing, where you're like, I'm going to load $10 on my card, and then, bip, and now it's $9.

18:17.850 --> 18:19.710
Hit obviously don't use it for that.

18:21.330 --> 18:30.270
What the e-purse gets used for, as well, is also is the nonce, or card challenge part, during that mutual authentication.

18:30.270 --> 18:34.930
And it relies on the fact that you can't change the value to what it was before.

18:35.050 --> 18:40.750
But it does rely on the reader updating that e-purse value every time it's read.

18:40.750 --> 18:46.270
Because if it doesn't get changed, you're back to the problem before.

18:46.270 --> 18:47.690
You can just do a replay.

18:48.970 --> 18:53.950
One of the other limitations is that there's no encryption between the card and the reader.

18:53.990 --> 18:58.870
Now, that, like, USB stick analogy before, like, the data that's on it may be encrypted, right?

18:59.190 --> 19:05.490
But there's no intrinsic encryption between when you're reading or writing data from this card.

19:05.490 --> 19:06.930
It's all plain text.

19:07.270 --> 19:12.550
There is a MAC used during mutual authentication, so you can ensure that both sides have got the same key.

19:12.850 --> 19:15.530
Also, when you're doing a write operation, there's a MAC.

19:15.530 --> 19:18.370
But other than that, there's no cryptography.

19:18.370 --> 19:23.330
So you can just sniff that data in the clear text as I get it to a reader with a Proxmark.

19:23.330 --> 19:24.570
I can just sniff it.

19:25.030 --> 19:27.550
So it's not great.

19:27.570 --> 19:30.770
But, you know, at least SIOs are encrypted, authenticated.

19:30.770 --> 19:32.370
It's hard to tamper with those.

19:35.490 --> 19:37.010
So Proxmark go better.

19:37.010 --> 19:37.950
We can sniff.

19:38.450 --> 19:42.770
One of the bigger problems is that, like, sniffing's...

19:42.770 --> 19:43.850
it's a bit of an art, right?

19:45.530 --> 19:48.170
Sniff and, hey, look, I saw half the conversation.

19:48.170 --> 19:48.950
I saw what the reader said.

19:48.950 --> 19:51.150
I didn't see what the card said, or vice versa.

19:51.190 --> 19:52.990
Like, it can be a bit finicky.

19:54.050 --> 19:56.070
But what you can do is...

19:56.070 --> 20:07.990
and I believe the first attack was when you're sniffing with a Proxmark, when it sends the ePurse write command, you can just jam it by, like, just putting out noise.

20:07.990 --> 20:11.890
And that will stop the card from hearing that, hey, update ePurse.

20:12.070 --> 20:23.390
And now you have a card that the Macs were used for to authenticate to the card, and the ePurse value hasn't changed.

20:23.390 --> 20:24.730
You can just replay that.

20:25.310 --> 20:36.670
The other way that you can do it, and this was sort of weaponized a bit on the Flipper Zero, but you could do it on Proxmark before that, but you had to know what you were doing a bit more, is what's called an NR Mac replay.

20:36.670 --> 20:39.370
So NR is the nonce, and Mac is the Mac of that nonce.

20:39.470 --> 20:56.950
So you can basically talk to the card, get its ePurse and card serial number value, go back to your reader, authenticate to that reader, or start the authentication process, and you presented the card challenge and card serial number from that card, collect the Macs from that reader,

20:56.950 --> 20:59.690
and then you take those Macs, and you go back to your card.

20:59.930 --> 21:02.590
And the ePurse value, nothing's changed on the card.

21:02.670 --> 21:06.650
So you can then just replay those Macs to the card, and now you're authenticated to the card.

21:06.890 --> 21:14.470
Now, you can't do writes to the card, because those still have a cryptographic Mac to authenticate the writes.

21:14.470 --> 21:17.950
But for any read operations, there's no more cryptography after you've authenticated.

21:17.950 --> 21:19.550
So you can just read the contents of the card.

21:19.550 --> 21:25.190
And that often ends up being a bit more reliable, because you're not trying to sniff another reader's field, which is kind of magic.

21:26.090 --> 21:27.710
You're just now talking to a card normally.

21:27.710 --> 21:30.130
And you can do it multiple times, and read different blocks.

21:30.130 --> 21:31.750
If you get an error, hey, you can try again.

21:31.750 --> 21:33.930
You don't have to redo your whole sniff.

21:37.270 --> 21:44.250
What that means is, even if you get that SIO, you can't then read it easily, because it's encrypted.

21:44.470 --> 21:52.190
But if that SIO is standard keyed, and even in a lot of leak keyed systems, it sometimes is.

21:52.190 --> 21:55.630
I don't know why it's not always elite keyed.

21:55.630 --> 21:56.930
It should be.

21:57.390 --> 22:03.190
But sometimes you'll find an elite keyed SE card with standard keyed SIO data on it.

22:03.290 --> 22:10.510
So you can take that, and you can present it to a HID SAM, and get it to decrypt it.

22:10.510 --> 22:11.650
Now you think, hang on a minute.

22:11.650 --> 22:12.270
How do you do that?

22:14.470 --> 22:19.870
But remember that SR mode, where it was legacy keys, but with an SIO.

22:19.870 --> 22:23.050
So you can take, we already know the legacy key.

22:23.050 --> 22:44.030
We can take that, make a fake legacy card that has an SIO and the legacy data on it, punch in that SIO into the SR card, present it to a reader, like this, where you just read it as the PAX data, or you can present it to Cedar, and then decrypt that SIO data.

22:44.470 --> 22:48.430
And you've got the plain text PAX data again.

22:49.050 --> 22:53.050
And again though, you've disabled SR and legacy on your readers, right?

22:53.050 --> 22:56.390
So hopefully that's not a problem.

22:56.390 --> 23:01.010
Yeah, you know the card number, the facility number, the format, but yes, you still haven't copied the card.

23:01.010 --> 23:05.390
It'll let you do a downgrade, which ain't great, but it's not too bad.

23:07.130 --> 23:27.370
And you can't get the, if SR wasn't enabled, or legacy, with Elite, thanks to the research, with the demystifying iClass and iClass Elite, you could recover the Elite key, but you can't recover the SE Elite key, because that's AS-based, good security.

23:28.230 --> 23:29.510
So you're fine, right?

23:29.510 --> 23:32.570
Just really make sure you've got SR and SE disabled.

23:32.570 --> 23:35.130
Yeah, you can read the data, but you can't present it back to the reader.

23:35.130 --> 23:35.670
Right?

23:35.810 --> 23:36.910
We're fine?

23:38.710 --> 23:40.890
So let's change tack a little bit.

23:40.890 --> 23:45.730
So I find that if I want to truly understand something, I need to write an implementation of it.

23:45.730 --> 23:54.650
I can read the data sheet, but there's lots of little edge cases that, until you write code, you might not necessarily think to ask that question.

23:56.090 --> 24:04.610
So I was like, hey, this chameleon tiny, I saw one on AliExpress, I'm like, that's cool, that's so small, that's sweet.

24:04.950 --> 24:06.230
I want one.

24:06.230 --> 24:12.530
Because iClass cards, they're cheap if you buy them in bulk, because I'm just doing this for a hobby.

24:13.190 --> 24:15.230
10, 15 bucks for a card.

24:15.330 --> 24:17.130
I'm in Australia, things are expensive.

24:17.130 --> 24:18.330
There's Australia tax.

24:18.330 --> 24:24.790
So like an emulator, I don't have to worry about trying to get these cards and burning them because I did dumb things.

24:24.790 --> 24:26.050
I'll just emulate it.

24:27.090 --> 24:29.470
Proxmark, you get attached to a computer, it's painful.

24:29.470 --> 24:30.810
This thing, hey, it's cool.

24:32.170 --> 24:34.910
Now, don't confuse this with the newer chameleon ultra.

24:35.090 --> 24:38.230
So the chameleon ultra looks exactly like this, but says ultra.

24:38.230 --> 24:44.890
It unfortunately doesn't support 15693, so you can't do iClass things on it.

24:44.890 --> 24:48.370
This is the older one that is hard to get these days, but yeah.

24:48.970 --> 24:50.190
So the hardware on it.

24:50.590 --> 24:56.770
The chameleon originally was designed ages ago, much older than the tiny.

24:56.770 --> 24:59.290
The tiny was just sort of like the very latest version of it.

24:59.530 --> 25:04.210
And it was based around this ATX mega 12884U chip, which is old.

25:04.270 --> 25:05.950
It's an 8-bit AVR.

25:05.950 --> 25:19.770
They clocked it at 27.12 megahertz, which isn't the fastest that you can clock this chip at, but it is a nice multiple of the 1356 megahertz carrier frequency that RF, that high-frequency RF runs at.

25:19.770 --> 25:21.430
So two times.

25:21.970 --> 25:28.890
Very convenient for doing this sort of stuff, because it was basically just bit banging the modulation.

25:28.910 --> 25:32.030
Like there was no NFC front end.

25:32.030 --> 25:36.290
There wasn't even like any proper DAC or FPGA.

25:36.290 --> 25:38.050
Like the Proxmark's got an FPGA.

25:38.050 --> 25:39.290
It's got an ADC.

25:39.290 --> 25:47.450
It's got a bunch of resistor ladder type stuff and drivers to drive the field on a much faster MCU as well.

25:47.450 --> 25:54.270
This thing's just an 8-bit AVR using interrupts to modulate the field high and low as needed.

25:54.270 --> 25:56.890
Like I'm impressed that they got this working.

25:56.890 --> 25:58.130
Like it was good.

25:59.370 --> 26:08.990
But it did provide some challenges, because doing cryptography in software is slow at the best of times.

26:08.990 --> 26:12.370
And I'm now doing it on this really slow chip.

26:13.690 --> 26:25.470
And it's not like it was a standard-based thing where the Macs were just like, oh, I can just throw it into like the DES accelerator and hey, I've got my Macs back.

26:25.730 --> 26:33.590
It's fully proprietary from Encrypt32, I think is the name of the cipher from inside Contactless, hence the in in front of it.

26:33.590 --> 26:36.010
And it was basically like a 32-bit Mac.

26:36.510 --> 26:38.070
Fully proprietary.

26:38.710 --> 26:40.730
Yeah, it was a bad time.

26:41.430 --> 26:46.270
So what I discovered is readers for iClass have got a really short timeout.

26:46.270 --> 26:48.550
Something like 300 microseconds.

26:48.570 --> 26:57.090
And that's between you sending, like the reader sending the authenticate command and the card starting to transmit its reply with the Macs.

26:57.130 --> 26:59.490
And 300 microseconds really isn't much.

27:00.050 --> 27:02.310
On such a slow microcontroller.

27:02.930 --> 27:04.370
I spent ages optimizing it.

27:04.370 --> 27:07.950
I think I got up to like 350 microseconds or something.

27:07.950 --> 27:11.050
And it was just kind of on the edge, but not really.

27:11.050 --> 27:12.430
And it's still too slow.

27:12.670 --> 27:14.410
And then I realized, I was like, hang on.

27:15.110 --> 27:18.330
What if I just start transmitting before I know the Mac yet?

27:18.450 --> 27:23.190
Because there's like a preamble, and then there's some other data, and then there's the Mac.

27:23.310 --> 27:27.830
So it's like, what if I just start transmitting what I can and hopefully by the time...

27:27.830 --> 27:30.270
Because that transmission is happening in interrupts.

27:30.270 --> 27:43.610
So while my code's calculating the crypto, the interrupts are firing, interrupting my code, doing the modulation of the first half of this packet that I haven't even fully assembled yet while my slow-ass crypto is running to finish the rest of the packet.

27:43.830 --> 27:45.610
And it worked.

27:46.410 --> 27:47.650
It was great.

27:48.150 --> 27:50.050
I honestly didn't think it would work.

27:50.050 --> 27:51.490
I was thinking, surely not.

27:51.490 --> 27:53.630
This is like the dirtiest hack known to mankind.

27:53.630 --> 27:54.610
But it worked.

27:54.610 --> 27:55.230
I was happy.

27:55.230 --> 27:58.810
And then I was like, I'm just not going to look at this terrible sin that I ever did again.

28:00.270 --> 28:01.630
And so I'm like, yeah, this is great.

28:01.630 --> 28:02.810
Tapping on one reader works.

28:02.810 --> 28:04.050
Tapping on another reader, it works.

28:04.070 --> 28:07.070
Oh, why didn't it work?

28:07.510 --> 28:10.390
And so I'm thinking, all right, maybe it wasn't fast enough.

28:10.390 --> 28:13.330
Does this reader have an even quicker timeout?

28:13.330 --> 28:17.870
Because depending on the cards, some cards are slightly faster than others.

28:18.050 --> 28:22.010
And I noticed that there was a trend that any old readers didn't work.

28:22.010 --> 28:23.850
So REV-A, REV-B, REV-C.

28:24.970 --> 28:26.410
REV-E readers worked.

28:26.410 --> 28:28.350
And I'm like, oh, that's weird.

28:29.110 --> 28:31.210
And so I went digging.

28:31.210 --> 28:32.090
I'm trying to do a sniff.

28:32.090 --> 28:35.250
I'm like sniffing sometimes hard.

28:35.630 --> 28:36.350
And I was sniffing.

28:36.350 --> 28:38.070
And there just wasn't any data on the sniff.

28:38.070 --> 28:38.910
I'm like, this is weird.

28:38.910 --> 28:41.570
And the reader wasn't responding at all.

28:41.570 --> 28:44.670
It wasn't like it said bad, you know, did the sad fourth.

28:44.670 --> 28:46.190
It was just like nothing.

28:46.930 --> 28:48.330
I'm like, that's weird.

28:48.430 --> 28:53.930
And so I'm going through a fine-toothed comb and end up getting a real card against a reader that worked and did a full sniff.

28:53.930 --> 28:57.970
And then my authenticated, my emulated card did a sniff.

28:57.970 --> 29:02.270
And like with the same e-purse data, same card serial number.

29:02.270 --> 29:04.910
Now the reader does have a random number generator in it.

29:04.930 --> 29:07.350
So it's not going to be exactly the same each time.

29:07.350 --> 29:08.270
But I thought, hang on.

29:08.270 --> 29:11.650
What if instead of using a real reader, I use a Proxmark?

29:11.650 --> 29:12.710
So you use a Proxmark.

29:12.710 --> 29:15.810
And the Proxmark, it just uses zeros, I think.

29:16.650 --> 29:18.210
It's not designed to be a secure reader.

29:18.210 --> 29:19.670
It's designed to break things.

29:19.670 --> 29:20.390
So I'm like, this is great.

29:22.530 --> 29:23.070
I'm going to use this card.

29:23.210 --> 29:25.410
And I'll go through line by line and check.

29:25.410 --> 29:28.890
Make sure that I'm doing everything fine and compare the timings.

29:29.270 --> 29:32.970
I think I ended up finding a bug in the Proxmark code with the timings.

29:33.250 --> 29:36.490
With 15.693 stuff where it was doing some weird things.

29:36.490 --> 29:39.550
That was one of the things I think I broke before fixing properly.

29:41.070 --> 29:43.430
And in the end, it turned out it wasn't timing.

29:43.530 --> 29:44.750
I had a bug in my code.

29:44.970 --> 29:49.530
I literally just forgot to call a function during the crypto initialization.

29:49.530 --> 29:51.870
So it wasn't initializing the cipher state properly.

29:52.970 --> 29:54.830
And then I fixed that bug.

29:55.630 --> 29:57.410
And, all right, it now matches.

29:57.410 --> 29:59.630
And I de-bipped it on the old reader again.

29:59.630 --> 30:00.710
And it still didn't work.

30:00.850 --> 30:01.710
I'm like, what the...

30:01.710 --> 30:13.630
Anyway, so after digging through a bunch of papers and all that sort of stuff, I discovered that 15.693 as a standard actually supports two different ways of modulating the data from the reader to the tag.

30:13.850 --> 30:19.270
One is on-off key modulation where, like, it'll... here's the carrier and then it stops the carrier entirely.

30:19.270 --> 30:20.210
And then here's the carrier again.

30:20.210 --> 30:21.790
And that's how you get the ones and zeros.

30:22.770 --> 30:33.230
But it also supports what's called ASK or amplitude shift keying which is where instead of, like, turning the field off entirely, it'll just, like, turn it off a bit.

30:33.910 --> 30:43.770
And that's actually handy for some use cases where you want the card to work at a longer distance because you're still providing some power to the card when you're doing that ASK modulation.

30:43.990 --> 30:51.930
And 14443B uses that modulation by default and whereas 14443A uses on-off keying.

30:51.930 --> 30:58.110
And that's why the sort of smart card type things would normally be before they were A because you get that higher power transfer.

30:58.110 --> 31:01.590
And for some reason, 15.693, it's like, yeah, you can support both.

31:02.030 --> 31:06.790
But, like, it's weird because they mandate that cards actually have to support both.

31:06.830 --> 31:07.810
There's no choice.

31:07.930 --> 31:09.930
Whereas readers are free to choose whichever they please.

31:09.930 --> 31:14.710
So it's like, you can't really make use of the extra power, but, like, maybe you get slightly better read range?

31:14.710 --> 31:15.370
I don't know.

31:15.830 --> 31:20.810
Anyway, after a bunch of stuffing around, it turns out those older readers were using ASK modulation.

31:20.990 --> 31:23.270
And the newer readers were using on-off key modulation.

31:23.310 --> 31:30.510
And due to some weirdness with the chameleon tiny's analog front end, it just couldn't hear that ASK modulation.

31:30.510 --> 31:34.770
It was originally designed just for 14443A, which is on-off key modulation.

31:34.990 --> 31:40.050
15.693 got added afterwards, and the hardware just wasn't designed to detect that.

31:40.090 --> 31:41.670
So it just couldn't hear the reader.

31:42.110 --> 31:43.710
And it's like, oh, okay.

31:44.430 --> 31:46.250
Flip a zero can, which is nice.

31:46.470 --> 31:48.270
That's a story for a bit later.

31:48.870 --> 31:49.950
It's like, hang on a minute.

31:50.890 --> 31:56.670
The real reason it wasn't working was because, like, you know, I had a stuffed-up crypto and wrong modulation.

31:56.670 --> 32:04.610
But, like, if I had the crypto wrong, why did it work at all on Rev-E readers?

32:05.210 --> 32:09.090
They were all playing and tried Signo readers.

32:09.090 --> 32:09.810
They worked, too.

32:09.810 --> 32:11.730
And I'm like, hang on.

32:11.870 --> 32:13.690
Surely I'm imagining this.

32:13.710 --> 32:20.190
So just quickly go into the Proxmark code, comment out the bits where it calculates the MACs.

32:20.190 --> 32:22.030
Go to the reader.

32:22.030 --> 32:22.810
Tap.

32:22.810 --> 32:23.710
It worked.

32:23.710 --> 32:26.550
Sending just zeros as the card MAC.

32:27.090 --> 32:31.870
And I'm like, why does sending zeros work?

32:32.090 --> 32:49.170
The whole point is that the reader sends a MAC, the card decrypts that MAC, generates its own MAC based on the decrypted data that was in the reader's MAC and then sends it and then the reader checks the card MAC and then it all works well.

32:49.470 --> 32:51.350
And after the reader verifies it.

32:51.350 --> 32:54.690
And if any of that doesn't match, the MACs don't match and it's not going to work.

32:54.690 --> 32:55.370
And I thought, well, hang on.

32:55.370 --> 33:01.330
But if I tap an elite-keyed card to a reader, it doesn't read, you know, if the reader is standard-keyed or vice versa.

33:01.670 --> 33:04.170
And I'm like, hang on, but the card checks the MAC.

33:04.170 --> 33:05.770
So when the reader sends its MAC,

33:12.310 --> 33:16.410
when the card generates the MAC and sends it to the reader, the reader needs to check that too.

33:16.810 --> 33:25.630
So any real card, like you're not going to notice this problem with, when you're emulating and you're lazy or maybe it's not that you're lazy and maybe it's just that, hey, it works.

33:25.630 --> 33:26.150
It's good enough.

33:26.150 --> 33:38.670
Or maybe it's that you only just managed to be fast enough to make the crypto work in the first place and you just really didn't even have time to calculate what the correct MAC that the reader should be sending was.

33:43.010 --> 33:49.650
Yeah, so it turns out Rev-E readers and Signo were not checking the MAC.

33:49.930 --> 33:53.390
So now you've got an iClass card, iClass SE,

33:58.370 --> 34:04.810
and I did a bunch of testing and even with ASK modulation, legacy readers weren't affected.

34:04.810 --> 34:08.210
So Rev-A, Rev-B, Rev-C, they were checking the MAC properly.

34:08.230 --> 34:14.110
And in fact, even when you're using an OEM reader, those were also fine.

34:14.990 --> 34:17.010
But it's like that's the same secure element.

34:17.010 --> 34:17.610
But it turns out

34:20.790 --> 34:21.390
when...

34:21.390 --> 34:24.010
So you'll see here, most OEM readers are unaffected.

34:24.010 --> 34:27.890
It turns out that R7 and newer SAMs are fine.

34:28.490 --> 34:36.270
R8 and above, and pretty much every Rev-E reader is R8, and above, so that includes Signo, is affected.

34:36.270 --> 34:51.590
And what happened between R7 and R8 is they changed their SAM firmware from being a native code running on the chip, so probably written in C, hopefully not assembly, and they changed it so that what runs on the firmware is actually

34:54.770 --> 34:56.910
a .NET interpreter, just like a Java card, right?

34:56.910 --> 35:02.870
You've got some JVM effectively running on the silicon, then you load Java applets in that you wrote in Java.

35:02.970 --> 35:04.130
Makes it a lot easier.

35:04.130 --> 35:06.270
You're dealing in a memory-safe language.

35:06.290 --> 35:08.770
Great idea to write secure code in, right?

35:08.770 --> 35:13.450
Rather than C where you can quite easily have lots of problems.

35:14.510 --> 35:16.290
Here we're a .NET shop, not a Java shop.

35:16.290 --> 35:22.510
So they bought out a company that were developing .NET card technology to compete with Java cards, and they used it internally.

35:22.530 --> 35:28.070
And R8 is when they switched from native firmware to .NET assemblies to do all the real work.

35:28.070 --> 35:38.750
So at some point, someone rewrote the iClass code to do those MACs in .NET to run on the SAM, and it works.

35:39.110 --> 35:42.730
But they forgot to check the reader MAC.

35:43.350 --> 35:54.550
It just reminds me of that go-to-fail Apple bug that came out five, ten years ago where checking TLS certificates, they just forgot to check.

35:54.950 --> 35:58.830
So you could present an invalid certificate and it would accept it as if it worked.

35:58.830 --> 36:02.630
But for any real server, it works fine.

36:03.530 --> 36:11.690
And this is why when you're testing most code, you test it, you make sure it works, you're happy, cool, unit test passed, send it.

36:11.930 --> 36:16.610
But when you're working, especially with security, that's not good enough.

36:16.610 --> 36:19.770
You need to test the things that shouldn't work.

36:19.910 --> 36:23.450
Like when a door, you test it and the door opens when it's expected, that's great.

36:23.550 --> 36:28.850
But part of the job of that reader and door is to make sure it doesn't open for people it shouldn't open for.

36:28.850 --> 36:32.950
So you need to test it like, hey, if the card sends a bad MAC,

36:36.930 --> 36:39.550
if the key is wrong on the real card, it doesn't work.

36:39.550 --> 36:43.150
But that's the card enforcing the security at that point, not the reader.

36:44.950 --> 36:50.130
There was a little bit controversial, maybe, if people are English.

36:50.670 --> 36:55.670
But there was an attempt at the IRA to bomb the hotel where Margaret Thatcher was.

36:55.770 --> 36:58.970
And they didn't succeed.

36:59.190 --> 37:00.050
She wasn't in there.

37:00.050 --> 37:01.370
They missed her by two minutes.

37:01.430 --> 37:05.310
And there was a comment of, oh , they didn't get lucky this time.

37:06.790 --> 37:11.290
For that kind of adversarial thing, you only need to get lucky once.

37:11.750 --> 37:12.770
Your adversary.

37:12.790 --> 37:16.470
Whereas your defender needs to be lucky every single time.

37:16.470 --> 37:18.030
It only takes one mistake.

37:18.290 --> 37:21.010
And you've compromised the security.

37:21.110 --> 37:25.610
And that's something that, obviously, that's a fairly grim, where that quote's come from.

37:25.610 --> 37:30.130
But it's something to think about in the digital security world as well.

37:30.130 --> 37:31.570
It's the same sort of principle.

37:31.570 --> 37:34.830
I only need to get lucky once to find the vulnerability.

37:36.790 --> 37:38.050
Lots of things.

37:39.210 --> 37:43.690
Now, if this was any other card technology, it wouldn't be as bad.

37:43.690 --> 37:59.070
If you were using a SEOS card, for example, and they forgot to check a MAC, it actually wouldn't matter too much because that same mutual authentication is then used to drive keys that are then used to encrypt and MAC all of the comms back and forward.

37:59.070 --> 38:02.170
And you really want to be checking the MACs of your data.

38:02.230 --> 38:12.050
But even if you were checking no MACs, and you decrypt the data with the wrong key, the data's just gibberish at that point.

38:12.050 --> 38:17.790
There's some attacks that you can do if you're not checking MACs, but it's not as bad as just, hey, I can send everything.

38:18.170 --> 38:28.210
And that's one of the problems with these cards, is that they're really old, and they don't support best practice of actually encrypting that data.

38:28.210 --> 38:33.250
The data on it's encrypted, but there's no session security.

38:33.490 --> 38:43.850
If you go to a HTTPS website or something like this, the data on it is encrypted, but it's not encrypted once and then the same data sent every time.

38:43.850 --> 38:45.990
Because you can just go, oh, that's google.com.

38:45.990 --> 38:49.590
I know because that's the same encrypted data as when I go to google.com.

38:49.590 --> 38:55.890
Every time you go to google.com, it encrypts that with new data, new keys.

38:55.950 --> 39:02.230
So the data's different every time until you decrypt it, and then you go, oh, it's the same plain text, but the ciphertext is different.

39:02.230 --> 39:06.470
And that's the difference between that sort of session security versus data security.

39:06.490 --> 39:08.170
And you do both, right?

39:08.170 --> 39:10.930
That's the best practice.

39:10.930 --> 39:13.650
And that's what, you know, SEOS cards do, for example.

39:14.290 --> 39:20.690
So while in theory, iClass SE was secure, it meant that one mistake meant that you got problems.

39:20.690 --> 39:34.350
Now, you can't easily just clone this iClass SE card to another card because those SIOs are cryptographically bound and we don't have magic PicoPass cards today.

39:34.610 --> 39:36.050
We might in the future.

39:36.410 --> 39:39.590
We might maybe have one in the future that also don't check card backs.

39:39.590 --> 39:40.370
That'd be neat.

39:40.770 --> 39:42.470
But today, we don't.

39:42.490 --> 39:50.610
So it's not a full plastic-to-plastic clone, but you can definitely emulate it with a flipper.

39:50.610 --> 39:51.910
You can emulate it with a Proxmark.

39:51.910 --> 39:54.130
You can emulate it with a Chameleon Tiny.

39:55.590 --> 40:08.950
So in addition to writing the Chameleon Tiny, Mini PicoPass code, by the time I got a flipper a couple of years later, I was also like, hey, let's write it for that too.

40:09.010 --> 40:10.370
Someone gave me the idea.

40:11.030 --> 40:21.130
It was funny because it was like the official flipper zero documentation were like, yeah, we can read iClass, but you can't emulate iClass.

40:21.130 --> 40:24.050
The NFC chip we use doesn't support that.

40:24.050 --> 40:25.750
It's just physically not possible.

40:25.750 --> 40:27.190
And I took that personally.

40:30.430 --> 40:32.510
So I did the impossible because it could.

40:32.690 --> 40:39.490
And because I was playing with the same chip before I got a flipper anyway and was like, yeah, I'm pretty sure there's some sweet transparent modes that you can do some cool shit with.

40:41.710 --> 40:48.950
So when I wrote it, I knew about this vulnerability and I was much faster and more modern chip in the flipper zero.

40:48.950 --> 40:59.150
So I did some optimization, but I checked the max by default on that one from the reader because I knew that the flipper zero is pretty popular.

40:59.150 --> 41:06.050
So I didn't want to just like hand like an armed weapon to every person.

41:06.430 --> 41:11.730
But there's this really suspicious debug flag if you have a look in the flipper zero PicoPASS code.

41:11.730 --> 41:14.170
And that flag's going to disappear soon.

41:14.750 --> 41:18.290
But PicoPASS debug ignore bad RMAC.

41:18.290 --> 41:19.370
I wonder what an RMAC is.

41:19.370 --> 41:24.190
Is that maybe a reader MAC to ignore the reader MAC if it's bad?

41:24.190 --> 41:24.990
Oh, yeah.

41:24.990 --> 41:26.690
That's actually exactly what it's doing.

41:26.930 --> 41:29.510
It'll even do a log if I got a bad MAC from the reader.

41:31.530 --> 41:31.970
And...

41:31.970 --> 41:33.410
bail out.

41:34.290 --> 41:36.990
But if you do...

41:36.990 --> 41:48.790
if you compile the flipper zero code with that flag defined or you just delete those lines out, all of a sudden you can do some naughty things.

41:49.950 --> 41:55.370
And now let's on the topic of naughty things, let's see if I can do a demo.

41:55.370 --> 41:57.590
Now, we don't have a down camera, unfortunately.

41:57.590 --> 42:10.890
So I'm going to just do something super, super dodgy and just open up my webcam and hopefully I can do a live demo for you that won't be too bad.

42:12.090 --> 42:13.190
If I can...

42:15.590 --> 42:17.070
Yeah, that'll probably do.

42:19.130 --> 42:20.670
Just ignore the microphone.

42:22.410 --> 42:24.790
So, we got a flipper zero.

42:26.510 --> 42:28.750
You probably can't read any of that, can you?

42:31.670 --> 42:32.550
Yeah.

42:32.790 --> 42:33.190
All right.

42:33.310 --> 42:35.010
This is going to be kind of moot.

42:35.610 --> 42:40.570
Basically, you can do an NRMAC replay to read the card data from this without keys.

42:41.050 --> 42:47.530
You can then compile a picker pass app with that flag and then tap it to a reader.

42:47.630 --> 42:50.210
If you want, I'll be at that first table there.

42:50.210 --> 42:53.650
I can give you a little showcase, but just trust me.

42:53.650 --> 42:54.450
It works.

42:55.710 --> 43:04.030
And in fact, you'll be able to try it for yourself because we'll probably do a pull request and just now that that's public, just release it.

43:05.630 --> 43:09.050
So, on the next bit, a vulnerability disclosure.

43:10.370 --> 43:17.850
So, this timeline, implementing this simulation, discovering the bug, fixing the bug, pull requesting it.

43:18.390 --> 43:25.170
And I was a little bit torn when I discovered this because I go to an airport to go on a plane as you do.

43:25.170 --> 43:30.190
And I walk around, I see these I-class readers on the walls and I'm just like, shit, I know some problems with those.

43:30.510 --> 43:34.190
And I'm like, I like going on planes.

43:34.490 --> 43:37.010
I like my planes being secure.

43:37.970 --> 43:42.090
And I know that there's some problems with the readers securing these facilities.

43:42.090 --> 43:43.570
I don't like this.

43:44.790 --> 43:47.870
I want to arrive at my destination safely.

43:47.870 --> 43:58.450
But then I also reflect and go, I remember when the MyFairClassic vulnerabilities were first released and I tried to disclose to the vendor that was met with lawsuits.

43:59.270 --> 44:03.190
I know there's Boston Public Transport met with lawyers.

44:03.810 --> 44:11.530
I know Assa Abloy in only the last couple of years, which is the parent company of HID, has gone after people with lawyers.

44:12.270 --> 44:16.090
I'm like, I'm just doing this for fun.

44:17.650 --> 44:19.610
I can't afford lawyers.

44:19.950 --> 44:20.750
So I was torn.

44:20.750 --> 44:25.170
I'm like, do I drop this as a zero-day anonymously so it can't be tied back to me?

44:25.550 --> 44:27.230
That's harmful.

44:27.290 --> 44:30.590
I'm also like, any idiot can stumble across this.

44:31.730 --> 44:34.910
It's not a complicated exploit .

44:35.930 --> 44:46.610
And then it's like , well, I was talking to some members of the RFID community and they put me in contact with some people at HID.

44:46.610 --> 44:52.590
And I managed to have a disclose to them in February 2023 .

44:53.190 --> 45:00.670
And in July , August 2023 , I can't remember the exact date, we got a fix for signal readers.

45:00.910 --> 45:06.030
So 10.0 .5.7 and above is not affected by this vulnerability .

45:06.730 --> 45:11.830
I finally got a CVE number reserved like three days ago.

45:11.830 --> 45:12.870
Maybe two days ago .

45:12.870 --> 45:14.310
So I've got a number .

45:14.310 --> 45:15.050
Great .

45:15.270 --> 45:19.610
Unfortunately , we don't have a REVI patch yet.

45:19.610 --> 45:23.150
And as a result, we don't have an official PSA from HID .

45:23.270 --> 45:27.050
If you look up that CV, you'll find it's reserved.

45:27.050 --> 45:28.550
There's no detail on it yet .

45:29.010 --> 45:34.250
This is the first public announcement for it.

45:34.370 --> 45:36.950
But it's been a year and a half .

45:36.950 --> 45:37.690
Yeah.

45:37.690 --> 45:40.490
And it has been rediscovered since then.

45:41.490 --> 45:42.290
Yeah.

45:42.890 --> 45:44.530
And, like, I can understand why.

45:44.530 --> 45:47.690
Like, REVI, more than a decade old at this point.

45:47.850 --> 45:49.730
It's basically end of life.

45:50.290 --> 45:52.930
It had already been announced end of life and they extended it .

45:52.930 --> 45:55.910
If it wasn't extended, it would have been end of life as well.

45:56.150 --> 45:58.350
It was already hard to upgrade.

45:58.490 --> 45:59.870
At least it could be upgraded.

46:01.950 --> 46:04.270
It was easy to brick.

46:04.510 --> 46:06.190
And it involves going to each reader.

46:08.810 --> 46:12.650
If it supports reader manager, there's some older versions.

46:15.730 --> 46:17.670
That's even more brittle.

46:18.650 --> 46:26.590
And obviously they didn't know

46:30.970 --> 46:37.570
what sure people have moved on in the time period that those readers have been around.

46:38.090 --> 46:41.290
Dealing with old stuff is hard.

46:41.390 --> 46:42.650
I'm a software engineer by day job.

46:42.650 --> 46:45.010
I can fully empathise with that .

46:47.370 --> 46:51.510
If I've got hit readers , what's the mitigation?

46:53.010 --> 46:56.270
If you've got signal, upgrade the latest version.

46:56.270 --> 46:58.650
Always update the latest version.

46:58.850 --> 47:03.310
There are bugs that get fixed with security implications.

47:03.310 --> 47:04.470
Keep up to date.

47:05.090 --> 47:11.070
The other thing you should do is disable I class.

47:12.110 --> 47:15.050
I'm talking legacy SE, SR.

47:15.650 --> 47:18.050
Even if you've got the fix, there are other problems.

47:18.210 --> 47:23.390
You really want to be moving to a more secure technology.

47:26.710 --> 47:33.190
While it can have that session security by default, it doesn't.

47:33.190 --> 47:34.350
It's configurable.

47:34.350 --> 47:36.110
I don't know why they didn't configure it.

47:37.790 --> 47:45.330
What it can mean is you can still put that onto a magic classic card .

47:45.330 --> 47:47.970
Those can have SIOs on them as well.

47:48.330 --> 47:53.910
It doesn't bind to the card technology .

47:54.290 --> 47:57.130
You can change the serial number on a different technology.

47:57.550 --> 48:00.170
It would be great if it was fixed.

48:00.170 --> 48:07.110
It would be great if it could signal the technology type back to the controller.

48:07.510 --> 48:09.290
That's probably a bigger change.

48:11.230 --> 48:15.310
Also, disable technologies you're not using as well.

48:15.550 --> 48:22.150
Even if you're using iClass, unless you're thinking of moving to my fair classic.

48:22.350 --> 48:26.570
You can't disable signal.

48:27.930 --> 48:30.290
Leave signal on.

48:30.650 --> 48:32.930
Disable everything else.

48:33.690 --> 48:35.950
There might be downgrade attacks.

48:35.950 --> 48:38.170
You can't defeat the whole system.

48:39.890 --> 48:43.430
Stop using standard keys.

48:44.150 --> 48:45.390
This wouldn't fix you.

48:45.390 --> 48:54.510
If the keys aren't being checked, it's bypassed.

48:54.510 --> 48:56.910
But it's still an issue.

48:56.910 --> 49:13.190
If I can go to eBay and rip the Sam out of it or buy a Sam on a PCB and start doing dirty things to it , Sam is great at securing things .

49:13.190 --> 49:15.290
The ecosystem is complex.

49:16.090 --> 49:22.850
It only takes one vulnerability to get keys and if everyone has the same keys,

49:25.870 --> 49:29.790
step one, I need to get a Sam that's yours .

49:30.170 --> 49:36.550
I need to go to your facility , rip a reader off the wall and now I have one chance of getting this right .

49:36.570 --> 49:44.410
If I brick a Sam while mucking with it , that's okay.

49:46.170 --> 49:48.410
If I nick a reader once,

49:51.790 --> 49:52.590
I'm done.

49:52.590 --> 49:56.090
You'll notice, right, the reader is just gone.

49:56.670 --> 49:59.910
You want to be using your own keys, not the same.

50:00.050 --> 50:01.730
There's other problems too.

50:07.850 --> 50:13.230
I've been in this game long enough to know nothing is certain.

50:14.750 --> 50:17.630
Back in the day they were $15 a pop .

50:17.630 --> 50:18.470
that's expensive.

50:18.470 --> 50:19.990
These days I believe they're cheaper.

50:20.250 --> 50:30.830
I believe HID is doing that not because they're cost less to them but because they realise so many people pick the cheapest option.

50:32.610 --> 50:44.450
I've seen news articles in the last few years rolling out HID readers and finding out they're using legacy standard key credentials on a new install .

50:44.850 --> 50:49.670
I'm sure it was the cheapest option at the time.

50:50.430 --> 51:02.550
I think HID would have done the right thing by changing the pricing model because people will buy the cheapest and that needs to be the secure option.

51:03.170 --> 51:07.970
It makes everyone have a bad time, including HID.

51:08.390 --> 51:10.970
You've seen the IPVM articles.

51:13.890 --> 51:15.230
Use elite keys

51:21.350 --> 51:23.510
not just snippet.

51:24.870 --> 51:30.470
You want to be using your own keys to read the card, encrypt the data on the card.

51:31.930 --> 51:35.150
Other vendors have problems too.

51:37.170 --> 51:41.790
Principles apply across the whole ecosystem.

51:42.330 --> 51:44.570
HID are not the only ones to use standard keys.

51:45.830 --> 51:48.670
I believe getting elite keys from HID now is free.

51:51.750 --> 51:54.810
If you want a custom key , that's extra.

51:54.810 --> 51:55.870
That's shit.

51:56.330 --> 51:59.770
Per customer keys should be the standard .

52:00.470 --> 52:01.710
I understand why .

52:01.710 --> 52:02.330
It's convenient.

52:02.330 --> 52:03.090
It's easy.

52:03.090 --> 52:05.910
We want security .

52:07.310 --> 52:15.650
I want to acknowledge the research, especially that of Milos and Flavio.

52:16.410 --> 52:17.930
It's amazing.

52:17.930 --> 52:21.510
If you do nothing else, just Google those names.

52:24.990 --> 52:27.650
It's like an old web server.

52:29.790 --> 52:33.130
There's some really great stuff in there.

52:33.550 --> 52:34.870
Good bedtime reading.

52:37.170 --> 52:49.590
I want to thank Jonathan who made the original Proxmark 3 and the Iceman who took over many years now.

52:50.010 --> 52:54.290
While implementing emulators, it was a beautiful tool .

52:55.270 --> 52:58.170
You don't know why it didn't work.

52:58.170 --> 53:05.810
Proxmark, you can sniff it, increase time-outs so your code doesn't have to run fast enough.

53:08.550 --> 53:12.850
It's definitely just a timing issue, not something else .

53:13.170 --> 53:16.430
Best tool for RFID research.

53:16.790 --> 53:20.230
I want to give a shout out to the RFID community.

53:20.810 --> 53:22.210
You're all great.

53:22.270 --> 53:31.490
But some special mention to Nick who is doing the RFID stuff.

53:31.490 --> 53:33.550
He had an awesome talk.

53:35.130 --> 53:38.330
If you missed it, check the recording.

53:38.330 --> 53:39.650
It was great.

53:39.730 --> 53:42.370
Shout out to Eric Betsy.

53:42.730 --> 53:51.870
He wrote the framework for me.

53:52.730 --> 53:55.970
I didn't have to do everything from scratch.

53:56.790 --> 53:59.890
And also generally great guy, Pat.

54:00.130 --> 54:04.490
He couldn't be here today but he's awesome.

54:07.090 --> 54:09.210
Equipped as well.

54:09.570 --> 54:10.530
Awesome bloke.

54:10.530 --> 54:14.250
He made the add-on that CD uses.

54:16.410 --> 54:21.330
Whereas Eric did the software side.

54:21.710 --> 54:24.550
And finally give a massive shout out to Kate .

54:25.150 --> 54:30.030
Also does a lot in the RFID research.

54:31.710 --> 54:34.830
Nick and Aaron's talk .

54:35.470 --> 54:37.430
Like sometimes just being able to...

54:39.270 --> 54:42.970
If you don't know the term rubber ducking, Google it.

54:42.970 --> 54:43.730
It's great.

54:43.790 --> 54:48.910
Sometimes you don't know who to talk to.

54:50.190 --> 54:56.190
Having someone you can get advice from and help you.

54:59.450 --> 55:00.750
Massive shout out.

55:00.750 --> 55:02.210
All awesome people.

55:02.210 --> 55:05.050
The final thing is to hit.

55:05.170 --> 55:09.130
I think they've changed over the last few years.

55:09.130 --> 55:17.830
I think they're starting to do the right thing with improving their product.

55:17.830 --> 55:20.170
I didn't get a single legal threat .

55:20.690 --> 55:22.330
I'm pleased with that .

55:25.170 --> 55:32.110
It's a long hard road, especially when you've got legacy technical debt.

55:33.670 --> 55:35.070
They're trying.

55:35.230 --> 55:36.670
That's all you can ask for.

55:36.890 --> 55:39.410
As long as it's in the right direction.

55:39.650 --> 55:40.030
Definitely

55:44.530 --> 55:45.930
huge props to HID.

55:45.930 --> 55:50.750
If you do find something in HID, it's worth approaching them.

55:51.710 --> 55:56.390
They're not going to lawyer up and try and silence you.

55:57.590 --> 55:59.190
Any questions?

55:59.710 --> 56:01.210
I don't know how much time I've got left.

56:01.210 --> 56:03.070
I think negative maybe.

56:03.350 --> 56:06.830
If you do have any, I'll be on the table over there.

56:06.830 --> 56:08.750
You can hit me up afterwards.

56:08.750 --> 56:09.210
Thanks , everyone.

56:09.350 --> 56:10.290
Thanks for Yeah !

56:10.370 --> 56:10.950
This is all

