WEBVTT

00:00.000 --> 00:02.160
All right, let's kick this thing off.

00:02.160 --> 00:09.680
So I found out today this was not in Hacker Tracker, so everybody in here must read the old ink version of the schedule.

00:09.680 --> 00:13.840
So thank you for reading the old paper version and showing up.

00:13.880 --> 00:16.280
Today we're going to learn how to break into buildings.

00:16.480 --> 00:17.720
Plain and clear.

00:17.940 --> 00:20.080
Why do I like breaking into buildings?

00:20.080 --> 00:28.300
I've actually never broken into a building for context, but when you can do a computer exploit and it touches the real world, that has always been the ultimate for me.

00:28.300 --> 00:38.760
So I played CTF for a long time, done a lot of binary exploitation, but seeing a pound sign pop up on your screen versus seeing a door unlock is a very different adrenaline hit.

00:39.000 --> 00:47.020
So let's go back through the history and see all the different ways you can break into buildings with laptops.

00:47.160 --> 00:49.480
So first we'll go over access control one-on-one.

00:49.480 --> 00:51.440
I'll just explain how these systems work.

00:51.440 --> 00:52.720
That's step one.

00:52.760 --> 00:53.900
What a smart card is.

00:53.900 --> 00:56.160
This is actually a pretty overloaded word.

00:56.680 --> 01:01.340
Everything looks like a smart card is just a piece of plastic with some microcontrollers in it.

01:01.400 --> 01:04.860
And then I'll go over all of the attacks that we've seen come out over the last couple decades.

01:05.160 --> 01:09.000
And then some food for thought on what the future might look like.

01:09.700 --> 01:14.520
So if you look at a typical access control system, there's only a couple of components.

01:14.520 --> 01:17.560
This is the most complicated system you would ever see.

01:17.780 --> 01:20.240
On the left side you'll see that there's a door reader.

01:20.240 --> 01:23.160
This is the little box you tap your card to and it goes boop!

01:23.280 --> 01:26.580
And green or red or blue or whatever color it turns.

01:26.740 --> 01:35.000
That then has a couple of wires that run all the way to the secure side into a controller board that will ultimately make the yes-no decision.

01:35.000 --> 01:39.240
So it's going to compare that number to some database and say, does this person have access?

01:39.240 --> 01:41.100
If it does, it opens the door.

01:41.280 --> 01:49.340
For security reasons, if you're using a mag lock, which is just an electromagnet, you'll plug it in to 12 or 24 volts.

01:49.520 --> 01:51.820
That electromagnet will hold the door shut.

01:51.980 --> 02:04.740
There's a problem here though, that if you're on the inside of that building, you cannot get out unless you can pull harder than that electromagnet, which is typically like 1500 kilograms for a cheap one, and they go way up.

02:05.200 --> 02:10.260
So in the event of a fire, you need a button that you can push to cut the power.

02:10.440 --> 02:13.820
This actually was not deployed well on the initial ones.

02:13.820 --> 02:15.180
A lot of people burned to death.

02:15.180 --> 02:17.500
So this is like fire marshal enforced now.

02:17.500 --> 02:23.700
Every door that has an electromagnetic lock will have a motion sensor and an exit button for egress.

02:23.840 --> 02:26.500
And by law, it has to be one motion.

02:26.640 --> 02:31.300
So if you hit the exit button, that needs to be all you do, or a big bar.

02:31.400 --> 02:36.640
So that comes into play quite a bit when you see some of the attacks and how to bypass these.

02:37.260 --> 02:45.780
So if we take away all the fluffy words and just look at what this is, it's an Arduino project that any high school or middle school student could build.

02:45.860 --> 02:47.840
There's just three relays.

02:48.080 --> 02:50.220
Ultimately, there's one that matters.

02:50.240 --> 02:57.460
So on the secure side, if that relay trips, the power is either turned off or on, and the door will unlock.

02:57.860 --> 03:15.020
On the reader side, there's just a little microcontroller that is going to do something over RF and then send a number out over Wiegand, which is this unencrypted two-wire protocol that has a data zero line to encode the number zero and a data one line to encode the number one.

03:15.500 --> 03:18.460
Once it gets the other side, decision is made.

03:19.000 --> 03:21.680
The other two things are also just relays.

03:21.680 --> 03:25.500
The exit button, when you hit it, it's just going to cut the power.

03:25.620 --> 03:31.260
And the motion sensor, again, when you wave at it, it just touches a relay.

03:31.260 --> 03:33.840
These are either normally closed or normally open.

03:33.840 --> 03:36.840
If you get any of those relays to chip, the door will unlock.

03:37.360 --> 03:43.400
So let's look at some of the worst relay fails in honor of the Olympics.

03:43.420 --> 03:45.520
This is not a running relay we're talking about, though.

03:45.520 --> 03:47.240
This is an electronic relay.

03:47.320 --> 03:54.620
I'm going to gamble that the internet works and show you how you can trip these relays in not-so-sophisticated ways.

03:54.620 --> 04:01.540
We'll get to interesting computer hacks later, but you see here in this video the exit button is on the left.

04:01.560 --> 04:08.960
You get yourself a nice sturdy piece of metal, shove that thing through the door, and you just click that relay.

04:08.960 --> 04:10.300
Bang, you're in.

04:11.840 --> 04:14.240
We'll keep going up in complexity.

04:14.240 --> 04:18.240
This is probably the least advanced way to trip one of those relays.

04:18.780 --> 04:21.560
So I call this the hook key.

04:21.660 --> 04:24.400
There's also the magnet key.

04:24.420 --> 04:29.980
So if you're aware of the internal mechanics in a relay, it's just two pieces of metal like this.

04:29.980 --> 04:32.840
You touch them together, the connection is made.

04:32.840 --> 04:35.620
You separate them, the connection is not made.

04:35.760 --> 04:36.800
So some of these...

04:37.800 --> 04:40.500
this is the locksmith, uh, lock picking lawyer.

04:40.860 --> 04:43.360
You hit the pin pad, the door unlocks.

04:43.420 --> 04:49.520
You can literally take a magnet, touch it to where the relay is, and it just clicks the relay.

04:49.600 --> 05:00.140
So if you buy this system, put it on the outside of your building, anyone can just come up with a magnet, click, click, click, click the relay on.

05:00.440 --> 05:02.060
So don't do that.

05:02.060 --> 05:07.200
When you install these systems, make sure the relay is on the inside of the building, not the outside.

05:07.300 --> 05:09.740
And then there's the motion sensor.

05:10.100 --> 05:14.880
So for obvious reasons, when there's motion, it's going to trigger.

05:14.960 --> 05:25.480
If you vape, it turns out the smoke in your vape for most of these motion sensors is thick enough that it will actually trip the motion sensor.

05:25.660 --> 05:30.040
And you can just blow smoke through the crack and walk right through the door.

05:30.200 --> 05:37.840
So we'll call these the very unsophisticated, uninteresting, why the hell did I come to this talk hacks.

05:37.940 --> 05:41.760
There are much more fun ways to do this.

05:42.060 --> 05:48.400
Just to note, when you're looking at these systems, so there's the electromagnets that are huge, chunky electromagnets over the top.

05:48.420 --> 05:50.080
There's also electric strikes.

05:50.080 --> 05:56.800
So these are solenoids that are going to have a pin that in its unpowered position is stuck down in the hole.

05:56.900 --> 05:59.300
And then when you power it, it pulls the solenoid out.

05:59.300 --> 06:02.580
These are far better for various reasons.

06:02.580 --> 06:04.940
You can't get locked into your building and die.

06:04.940 --> 06:07.160
They're a little harder to trip.

06:07.160 --> 06:11.640
You can't vape into these and have them pull a solenoid up.

06:11.900 --> 06:16.760
So if you're given an option, you're installing these, anytime you can put an electric strike.

06:17.080 --> 06:20.180
So now let's look at smart cards.

06:21.160 --> 06:24.620
First, we need to answer the question, what do I mean by smart card?

06:24.620 --> 06:28.080
There's really, I think, three different forms you'll see.

06:28.120 --> 06:32.720
There's the ones that look like our credit cards that have these little pads on them.

06:32.720 --> 06:36.300
There's ones that are just pieces of plastic that do some RF stuff.

06:36.300 --> 06:39.040
And then there's ones with the mag stripe on the back.

06:39.840 --> 06:44.020
So these are all very, very different technologies.

06:44.020 --> 06:53.800
The end goal of all of this is to take stuff from our digital world and encode it somehow in a physical piece of plastic that fits in our wallet and is the same size as our driver's license.

06:54.520 --> 07:00.780
So if we look at a mag stripe, this one normally fascinates people.

07:00.780 --> 07:08.480
The stuff that is stored on the magnetic strip of your credit card is exactly the data that is printed on the front of your card.

07:08.480 --> 07:14.640
It is just a way to encode ASCII text effectively in a magnetic form.

07:14.640 --> 07:16.400
There is no security involved.

07:16.400 --> 07:17.660
There is no encryption.

07:17.660 --> 07:22.060
If you want to clone some mag stripe cards, we have them over in the physical security village.

07:22.060 --> 07:28.200
This was like, you know, attempt number one at, hey, we're gonna use a physical thing to interface with a digital world.

07:28.200 --> 07:34.540
There is nothing interesting or sophisticated there other than some physics with like magnetic poles.

07:34.540 --> 07:36.840
Not smart at all.

07:37.540 --> 07:39.740
Then came the prox cards.

07:40.020 --> 07:43.960
These you literally just emanate radio waves at them.

07:43.960 --> 07:46.660
They can be passively powered, which is really cool.

07:46.660 --> 07:50.240
So the radio waves actually give them the power they need to power on.

07:50.240 --> 07:52.800
And then they respond with a number.

07:52.900 --> 07:56.480
You can actually hack these things with AM radios.

07:56.480 --> 08:02.000
I have like a little kit when my sister was like five, we were playing around and like emulating these kind of smart cards.

08:02.000 --> 08:03.620
They are not encrypted.

08:03.620 --> 08:08.060
There is nothing really interesting from a cryptography standpoint going on there.

08:08.180 --> 08:12.400
The only thing to figure out is how they encode the data that coming back.

08:12.400 --> 08:13.720
Is it amplitude shift keying?

08:13.720 --> 08:15.020
Is it phase shift keying?

08:15.020 --> 08:17.000
How are they encoding the radio frequency?

08:17.000 --> 08:20.180
But at the end of the day, it is just a number.

08:20.180 --> 08:25.700
And that number is typically printed on the card, just to add to the security of the whole situation.

08:25.840 --> 08:28.140
These were never intended as a high security thing.

08:28.140 --> 08:38.720
Yet, if you go to most enterprises on earth, including the one my wife works at, they still use these exact cards today, as does the high rise that my company is in, in downtown Houston.

08:39.000 --> 08:40.080
It's a bummer.

08:40.080 --> 08:42.720
Like I saw her come home first day of work, like why?

08:42.720 --> 08:43.960
Like I know where you work.

08:43.960 --> 08:44.900
Don't do that.

08:44.900 --> 08:46.740
You have sensitive stuff.

08:47.320 --> 08:53.160
So then came along the near field communication cards, NFC or high frequency cards.

08:53.240 --> 08:56.140
These run at 13.56 megahertz.

08:56.140 --> 08:58.520
These do have cryptography on them.

08:58.520 --> 09:02.780
The way to think of the cryptography on all of these is as a memory card.

09:02.780 --> 09:05.740
There is a symmetric key that is on the card.

09:05.740 --> 09:09.000
And if you have it, you can read and write to that card.

09:09.000 --> 09:10.740
And if you don't, you cannot.

09:10.960 --> 09:15.620
So there is one key that will let you read and write data from these cards.

09:15.940 --> 09:19.500
Otherwise, I colloquially call them dumb cards.

09:19.500 --> 09:21.240
They're not doing anything sophisticated.

09:21.280 --> 09:26.560
They're just memory cards, but they are better than the mag stripes and the prox cards.

09:27.480 --> 09:33.580
So there's going to be a shared key, which that screen still looks like it's on.

09:33.580 --> 09:36.260
So there's gonna be a key on the card and a key on the reader.

09:36.320 --> 09:42.600
So for the reader to read the card, it needs another key, which you can kind of see where this is going.

09:42.600 --> 09:49.920
If I'm deploying, you know, a million of these, that means that that key has to be on all of the readers and all 1 million cards.

09:51.600 --> 09:56.400
Now we look at what is actually considered a smart card.

09:56.400 --> 10:03.120
So our credit cards that look like this with the little chip, these are actually little microprocessors.

10:03.160 --> 10:05.160
They're not microcontrollers.

10:05.160 --> 10:07.180
They actually run Java OS.

10:07.180 --> 10:08.660
They have a CPU.

10:08.660 --> 10:09.900
They have memory.

10:09.900 --> 10:11.740
They have non-volatile storage.

10:11.740 --> 10:14.760
They have, you know, dedicated crypto units.

10:14.760 --> 10:16.880
And they can do public key cryptography.

10:16.900 --> 10:24.480
So these are actually smart in the sense that we would hope they are and do proper security things.

10:25.460 --> 10:29.900
With the asymmetric encryption, this is much better than the symmetric key encryption.

10:29.900 --> 10:41.700
It means if you break my card, you only get my private key and you're not going to take down my whole company and be able to clone every employee's card, which is very good for the scalability point.

10:42.300 --> 10:52.380
And I put this diagram there because I think it's interesting that I didn't realize this until I started hacking smart cards in my career, that these really are just little embedded systems.

10:53.240 --> 10:56.180
There's far more sophisticated stuff in there than I thought.

10:56.180 --> 10:57.660
And you can kind of see the overlap.

10:57.660 --> 11:00.060
You have contact cards that speak one protocol.

11:00.160 --> 11:01.980
You have contactless cards.

11:01.980 --> 11:05.640
And then you have the dual interface cards, which almost all credit cards are today.

11:05.640 --> 11:10.360
You can tap to pay or you can shove that thing into the credit card reader.

11:10.840 --> 11:14.120
And if you look at the specs, they have 1k mbit flash.

11:14.120 --> 11:17.820
There's an EEPROM that speaks I-squared seed and SPI.

11:17.820 --> 11:21.640
They have segmented memory with a 64k bit EEPROM.

11:22.320 --> 11:25.160
Pretty decent specs for a credit card.

11:28.080 --> 11:32.040
The way they work is if you look at those pads, only four matter.

11:32.040 --> 11:35.000
You have your power and your ground to power the little computer on.

11:35.000 --> 11:38.960
You drive the clock externally, which is interesting from a glitching perspective.

11:38.960 --> 11:42.000
So you control both the voltage and the clock.

11:42.160 --> 11:45.060
And then you just have a single pin for I-O.

11:45.060 --> 11:50.760
So as you're driving the clock, use that I-O to read and write commands and application data units.

11:51.000 --> 11:53.800
So APDUs, you're going to send commands.

11:53.800 --> 11:59.640
You can actually send admin commands and install Java applets and manipulate the operating system.

11:59.920 --> 12:05.020
Or unauthenticated commands that are just going to query this thing for a challenge response.

12:06.400 --> 12:14.080
So I got my doctorate in embedded system security, where I was glitching and doing all sorts of crazy things that break into embedded systems.

12:14.220 --> 12:21.020
So smart cards have always fascinated me because they actually do a very, very good job at physical attacks.

12:21.020 --> 12:25.760
So it's common that you would drop your credit card and somebody could pick it up, right?

12:25.760 --> 12:30.620
They can still go make payments, but actually extracting that key, cloning cards is a big deal.

12:30.740 --> 12:41.480
So they actually lay, if you look at the IC and delid it, between every single layer of logic, there is a layer of mesh that is a destroy mechanism.

12:41.480 --> 12:49.440
If that is tampered and you break a single one of those traces, it actually will self-destruct the card by deleting all of the sensitive material.

12:49.560 --> 12:51.940
They also have to have brownout detection.

12:51.940 --> 13:01.780
Because you're controlling the voltage externally, there are glitching attacks you can do on embedded systems, where while they are doing computation, you can brown the voltage out.

13:01.780 --> 13:05.600
So that means you're going to take it from your positive five volts to negative five volts.

13:05.640 --> 13:14.320
That can make your D flip-flops go crazy, and you can have an if statement evaluate to true that otherwise should have been false or vice versa.

13:15.300 --> 13:23.220
They also, because you're controlling power, clock, all of these things, you have to program the logic very specially.

13:23.520 --> 13:30.840
So one of these two statements on the right is correct in an embedded system standpoint.

13:30.840 --> 13:35.160
If you're writing this for a computer software, they're both probably fine.

13:35.220 --> 13:41.380
But this is the code to check the pin when I'm entering the pin to say unlock my debit card.

13:41.400 --> 13:46.860
Does anybody have an inkling of which one is better than the other?

13:53.750 --> 13:56.350
We think number two is better.

13:56.690 --> 13:57.390
Correct.

13:57.390 --> 13:59.430
Number two is better.

13:59.510 --> 14:09.810
So the reason that number one would fall vulnerable on a smart card is because you can do side channel analysis to actually see if that if statement evaluated to true or false.

14:10.010 --> 14:21.270
And what you can do in this attack is that if you believe it evaluated to false, you cut the power immediately before it has time to increment the counter and write that to the non-volatile storage.

14:21.750 --> 14:25.070
Which means you could then brute force this with unlimited tries.

14:25.070 --> 14:32.490
Whereas if you increment the counter before you do the check, you can still limit it to 10 or 15 pin attempts, whatever you have.

14:33.110 --> 14:41.910
The awesome part is on these smart cards, this is all actually, they've thought about a lot of this because it's used for financial transactions in the EU especially.

14:41.990 --> 14:49.570
So I read the whole book on smart card security and these were the highlights that I thought were particularly interesting of security done well.

14:50.150 --> 14:54.990
So before we go break all these, why did we even build these in the first place?

14:55.110 --> 14:58.490
The real problem is that physical keys are one to one.

14:58.490 --> 15:00.430
There's one key that opens one door.

15:00.430 --> 15:04.650
If I want 1,000 people to open that one door, they all have the exact same key.

15:04.650 --> 15:15.230
And if one of those 1,000 people is bad and I have to fire them, I now have to give out 9,999 new keys and rekey that door.

15:15.570 --> 15:18.330
So in enterprise, this sucks.

15:18.370 --> 15:19.990
Smart cards can be one to many.

15:19.990 --> 15:23.710
You can have many different credentials that get into the same door.

15:23.970 --> 15:27.410
It used to be really complicated to carry a full computer in your pocket.

15:27.410 --> 15:30.730
As you can see, modern smart cards are actually little mini computers.

15:30.730 --> 15:33.970
Our smartphones are really big, fast computers.

15:34.290 --> 15:36.030
And you can put a picture on them.

15:36.030 --> 15:38.530
This should not be ignored.

15:38.530 --> 15:47.310
It is nice that when you come to conferences and things, there is something around everyone's neck that indicates they are meant to be here and should not be escorted out.

15:47.310 --> 15:55.270
So even all the security and stuff aside, the fact that people have things hanging around the neck that says that they belong is actually valuable.

15:56.150 --> 15:57.830
Enough with all that fluffy stuff.

15:57.830 --> 15:58.870
Let's go through some exploits.

15:58.870 --> 16:00.070
That's why we're at DEF CON.

16:00.770 --> 16:06.010
So when you're doing a vulnerability assessment, you first want to ask yourself, what's the goal, right?

16:06.010 --> 16:07.750
What's the worst that can happen?

16:07.890 --> 16:10.730
So we could use a card without someone's permission.

16:10.910 --> 16:13.970
I could, you know, swipe it out of your back pocket.

16:14.270 --> 16:19.130
I can clone the smart card or I can subvert the need for it altogether.

16:19.210 --> 16:24.830
So we already saw at the beginning some of the ways that you can just completely ignore the card.

16:24.830 --> 16:32.610
If you go to the physical security village, they have many, many, many more ways to get into buildings that have nothing to do with computer science.

16:33.030 --> 16:38.610
And using the card without a person's permission is not particularly interesting because you're just stealing the card.

16:38.610 --> 16:45.290
There are ways that there are some smart cards that will have like biometrics built into them, you know, other things like that.

16:45.290 --> 16:48.750
We're going to specifically focus on cloning the smart cards.

16:49.770 --> 17:05.030
So the way it works when you have a good, you know, one of the dumb cards, the 13.5 megahertz, 5, 6 megahertz cards, there's going to be two keys that really have to work together to store this credential.

17:05.030 --> 17:09.750
So there's going to be one, an authentication key, an in-transit key that lets you read and write data.

17:09.750 --> 17:13.630
And then you can also encrypt the data at rest on the card.

17:13.770 --> 17:20.390
So if my employee credential is 1, 2, 3, 3, 4, 5, 6, 8, 9, 0, I will encrypt that while it's on the card.

17:20.390 --> 17:27.290
And then I will also have effectively a key that encrypts the in-transit that lets me even talk to the card.

17:27.590 --> 17:34.090
It doesn't matter what the key for the encryption on the card is, if I'm just going to clone it outright.

17:34.290 --> 17:47.170
So that is worth noting because one of the fixes I'll explain later, they fixed the in-transit key, or sorry, yeah, they changed the in-transit key, but it didn't actually fix the problem.

17:48.250 --> 17:54.330
So the whole goal of this, when we're trying to break into buildings with laptops, is just find that dang key.

17:54.330 --> 18:00.530
Whatever the key is that lets me read and write data from the cards is game over for that security system.

18:00.530 --> 18:05.850
Because now I can walk up next to anybody and just outright clone employee IDs.

18:05.990 --> 18:11.430
And in the case that I also know the at-rest key, I can just fabricate whatever keys I want.

18:11.430 --> 18:20.430
And if it's printed on the badge, I can just read someone's ID badge walking by and then go become them and just go in whatever door I know they can go into.

18:22.050 --> 18:24.990
So how are these attacks done?

18:24.990 --> 18:31.870
These are almost all exclusively physical attacks on the cards and their readers first.

18:32.150 --> 18:39.070
This one on the MyFairClassic, so this was the most prolific card early in the smart card era.

18:39.070 --> 18:45.950
This was used for everything, public transit, cash cards, so you'd actually store money in the value on the card.

18:46.150 --> 18:49.750
So breaking these was a really big deal in the research world.

18:49.790 --> 18:53.610
There were a couple professors at UVA that actually delidded the chip.

18:53.610 --> 19:06.690
They dissolved it in acid and went layer by layer delidding this chip and taking really high resolution pictures that you see here of the actual ASIC, like the the circuitry of the IC.

19:06.690 --> 19:15.430
And then they applied image recognition to all of these images to reverse engineer the algorithm that was encoded in that chip.

19:15.430 --> 19:25.430
And then from there, we're able to start analyzing, you know, cryptanalysis to figure out if there are any vulnerabilities in the cryptography on these MyFairClassics.

19:25.810 --> 19:27.930
Spoiler alert, yes, there was.

19:28.070 --> 19:31.770
MyFairClassic at this point is quite broken.

19:31.770 --> 19:41.870
Anybody with a Flipper Zero can just go to RFID, read, put it up to the back of the Flipper Zero or to the back of the card, and it will run some version of this program.

19:41.870 --> 19:45.690
I wasn't involved in the porting of it, but mostly a user of all these great tools.

19:45.690 --> 19:49.050
But this is what it looked like way back in the day in your terminal window.

19:49.050 --> 19:53.590
Now it's a very awesome, you know, handheld little device.

19:53.590 --> 19:57.350
But you can effectively brute force all of those keys, break the keys.

19:57.350 --> 19:59.850
Back to the beginning of the talk, once you have the key, it's game over.

19:59.850 --> 20:01.850
You tap any card you're reading and writing.

20:02.730 --> 20:04.490
You can again come over to our booth.

20:04.490 --> 20:10.530
There's still hotel key cards and public transit cards and things today that are still using MyFairClassic.

20:12.170 --> 20:17.290
So in the enterprise environment, there's HID dominated.

20:17.290 --> 20:22.970
They were by far the monopolist in, you know, enterprise access control.

20:23.030 --> 20:26.210
This thing on the left probably looks very familiar to most of you.

20:26.490 --> 20:28.470
They're all around this conference.

20:28.470 --> 20:32.690
You've seen them probably in tons of buildings, airports, financial institutions, whatever.

20:32.690 --> 20:34.790
Every elevator here has one of these.

20:35.670 --> 20:37.730
These use symmetric keys, right?

20:37.730 --> 20:41.010
So we go back to how would you deploy a system like this?

20:41.190 --> 20:46.610
Every single one of these on Earth that is sold has the exact same symmetric key.

20:46.610 --> 20:50.370
Every single card, every single reader has the exact same key.

20:50.370 --> 20:57.170
So they've sold millions of these to many different buildings, one of which we are standing in today with the same key.

20:57.170 --> 21:02.870
So that would be absolutely terrible if that one key got leaked.

21:03.530 --> 21:06.690
It took a while actually to get this key.

21:06.690 --> 21:08.530
They did pretty good security.

21:08.530 --> 21:12.030
Nobody dissolved the cards in acid, didn't anything like that.

21:12.030 --> 21:24.270
Back in 2010, Baloch and Maryak was looking at the back of one of these readers, I think it's the RW40, said, hey, that looks a lot like the pin header on my PIC, my PIC kit, my PIC microcontroller.

21:24.610 --> 21:36.890
Turns out the way they secured this system was by flipping pin one and pin three, because, you know, nobody on Earth would ever dream of flipping pin one and pin three on their PIC kit.

21:36.970 --> 21:41.950
So he just swapped pins one and pin three, plugged it in.

21:42.570 --> 21:43.110
Great.

21:43.110 --> 21:44.310
We're debugging it.

21:44.310 --> 21:47.830
There is a security feature on PIC, though, where you can't just read memory.

21:47.830 --> 21:50.190
That would be catastrophic and extremely dumb.

21:50.190 --> 21:51.390
They did not do that.

21:51.550 --> 22:00.350
This particular one, though, had a vulnerability where you could wipe individual sectors and write data to individual sectors.

22:00.350 --> 22:06.130
So the way this should work is I'm going to write new firmware, I have to wipe the whole firmware and write my own custom firmware.

22:06.210 --> 22:23.310
With this little subtlety, you could erase sector zero, write code in there that would dump sectors one through n, and then take another sacrificial reader, delete sectors one through n, and write code in all of those that would dump sector zero.

22:23.310 --> 22:32.910
So by sacrificing two of these, you now put all of that together and you have the complete firmware dumped on your computer that you can now analyze with IDA Pro.

22:33.690 --> 22:38.230
They stored everything in PIC memory, including those keys.

22:38.230 --> 22:43.070
They weren't stored off chip in some sort of secure RAM or anything like that.

22:43.070 --> 22:49.190
So once you reverse engineer this go through, lo and behold, the keys just pop right out at you.

22:49.330 --> 22:50.650
That's game over.

22:50.650 --> 22:59.370
Since these are symmetric keys, now when you go to clone an HID card, there is no brute brute forcing going on, you just read the freaking card.

22:59.470 --> 23:13.990
They did add an iClass SE, so if you're in the industry and you see this on the back of your card, the SE I think stands for secure encryption or something like that, but they did encrypt the data at rest on the card.

23:13.990 --> 23:20.410
So it used to be you'd use this key, you just read the the credential off, and you could write arbitrary credentials.

23:20.410 --> 23:28.330
With the SE, they did use AES, that's good, they used a known algorithm to encrypt the blob on the card, but you can still clone it outright.

23:28.510 --> 23:32.730
So if I want to become you, I just tap your card, I take your blob, I put on my card, boom, I'm you.

23:33.290 --> 23:39.890
They also had a version that they would upsell you on called HID Elite Class.

23:40.050 --> 23:45.470
So what Elite Class would do is it would just change that standard key that's on every door on earth.

23:45.690 --> 23:54.790
For your organization, they would give you an organization specific key, and then your cards, your employees would use a different key so people couldn't come up and clone it.

23:54.970 --> 23:56.130
Sounds good.

23:56.870 --> 24:03.670
Unfortunately, the firmware at this point is, you know, it's not open sourced, but it's out there if you know the right people and know where to look.

24:03.830 --> 24:24.410
There were some researchers, Flavio Garcia, a couple other folks, looked at this algorithm and found that there was actually a vulnerability in the way that the elite keys were derived, and they were able to go up to an elite key reader, send I think it was seven failed attempts of cards that wouldn't register at all.

24:24.410 --> 24:30.790
The backend, it would never spit them out, they were total failed transactions, and then offline, you could brute force the elite key.

24:31.010 --> 24:42.170
So even if you paid to upgrade to the elite key, somebody has had to walk by one of your readers, tap their proxmark, boom, now they have the key, and we're back to where we started, just clone and employee IDs.

24:42.430 --> 24:50.790
This was like, I don't know, at least in my career, this is like the coolest, like, heyday couple of years in breaking into RFID things.

24:50.790 --> 24:58.310
And all these papers are published, I'm like implementing the stuff as they're publishing it, like emailing these guys, like, oh my god, like, I can't believe this works.

24:58.310 --> 24:59.490
Is this a typo?

24:59.490 --> 25:00.810
Like, is this algorithm real?

25:00.810 --> 25:02.450
And then, yes, it's all real.

25:02.450 --> 25:09.550
I've like, wrote these on proxmarks, I wrote a version of Python, wrote a version in C, and now it's all been ported to the Flipper Zero.

25:09.550 --> 25:14.230
I think the guy who ported it was hanging out in the RFID village, actually, one of the co-authors.

25:14.230 --> 25:16.710
So, like, it's awesome.

25:16.710 --> 25:18.370
Like, crazy stuff.

25:18.990 --> 25:20.050
Totally works.

25:20.050 --> 25:22.270
And people are literally flipping out these days.

25:22.270 --> 25:32.050
This used to be something that, like, you know, there was a small group of us that knew about these things, and we'd come to DEF CON, like, hey, you know, talk about these exploits, we had email threads going back and forth.

25:32.330 --> 25:44.550
Now it is everybody here is walking around with one of these things on their neck with the ability to just walk into pretty much any door they run, if they find the correct employee, and kind of just nudge into them correctly.

25:44.550 --> 25:50.870
So, it is a pretty strange time to be in this world.

25:50.970 --> 25:58.550
And that's why we're hosting at the Physical Security Village now, the decades leading up to the Flipper Zero, I'm like, you know, this probably isn't the right time to talk about this.

25:58.550 --> 26:00.650
Like, this is a pretty bad exploit.

26:00.650 --> 26:04.150
But now that it's commoditized, hey, come play with it.

26:04.530 --> 26:07.130
So, the implications of this are actually huge.

26:07.130 --> 26:10.750
Most of the employee badges are, like, the world's largest companies.

26:10.750 --> 26:15.990
I still today walk around and have friends, and I'm always looking at people's IDs and trying to clone everything.

26:15.990 --> 26:21.770
And I have, like, way, way too many, oh, my God, moments, given that this key was leaked back in 2010.

26:21.850 --> 26:29.530
Like, there's so many organizations that either have the prox cards with no encryption at all, or still have these standard I-class cards.

26:29.530 --> 26:32.210
Like, in Houston, there was a brand new building that was built.

26:32.450 --> 26:34.530
I was a tenant there for, like, six months.

26:34.530 --> 26:39.970
And on day one, I just, like, cloned the card they gave me and started walking through doors.

26:39.970 --> 26:45.790
I'm like, this is... why in 2024 did we just build this and buy this technology?

26:46.770 --> 26:48.990
So, there's still security theater, though.

26:48.990 --> 26:50.550
So, this actually is interesting.

26:50.550 --> 26:53.530
There is something to be said about, like, keeping the honest people honest.

26:53.530 --> 27:02.890
And, like, as long as it looks good on paper, you know, you have all these security audits and SOC 2s and things like that, that, like, you do have to do these things.

27:02.890 --> 27:06.050
And it is not highly publicized that this is out there.

27:06.050 --> 27:07.870
It's highly publicized at DEF CON.

27:07.870 --> 27:12.890
But outside of this, you know, there's not big signs, like, your HID reader key was leaked in 2010.

27:12.930 --> 27:14.430
What version are you running?

27:14.890 --> 27:18.130
And it's just an absolute headache for admins.

27:18.130 --> 27:20.650
Like, now you don't know if your keys have been cloned.

27:20.670 --> 27:24.290
Upgrading these is a huge hassle, because this is your whole infrastructure.

27:24.510 --> 27:25.790
These readers aren't cheap.

27:25.790 --> 27:28.650
They can go up, like, $1,500 a piece.

27:28.670 --> 27:31.790
Not to mention the labor of ripping one out and rewiring it.

27:33.690 --> 27:40.830
So, just to take a step back, though, the only common feature here is bad implementation.

27:40.870 --> 27:49.930
Like, trying to roll your own crypto, you know, doing things that in the grand scheme, you'd look back and say, that was a terrible decision.

27:49.930 --> 27:51.370
I wasn't there making the decision.

27:51.370 --> 27:54.290
And normally, you don't realize it at the time.

27:54.290 --> 27:57.070
Like, you know, encoding strings that ended in null bytes.

27:57.070 --> 27:59.690
At the time, you're writing C, what could go wrong?

27:59.690 --> 28:01.270
And now we have buffer overflows forever.

28:01.270 --> 28:09.270
So, the design process, I'm sure, never dreamed that it would get to the point where, my God, there's too many of these on Earth and every building can be walked into.

28:09.730 --> 28:14.470
But otherwise, the smart card community as a whole has really crushed it.

28:14.470 --> 28:22.130
I mean, to attack, like, the DoD CAC or a modern credit card is actually pretty complicated.

28:22.130 --> 28:25.250
You'll see attacks here, kind of few and far between.

28:25.250 --> 28:34.210
The last one I remember that was quite notable, when I was in the smart card hacking world, there's somebody who found that on SIM cards, they use triple DES to authenticate.

28:34.850 --> 28:39.130
And I remember going through this with my colleague and I'm like, man, everything actually does look fine.

28:39.130 --> 28:40.730
It looks totally shady.

28:40.730 --> 28:47.450
But if anyone used single key DES instead of, like, the triple keys on triple DES, this would be catastrophic.

28:47.470 --> 28:55.050
There was a talk at DEF CON that was like, hey, every SIM card for this entire manufacturer only uses a single key and they were just root SIM cards like crazy.

28:55.270 --> 29:00.410
Because SIM cards are these cards if you just cut more plastic off and shove it in a phone.

29:00.510 --> 29:06.710
But the security of these at its core is actually quite good if implemented well.

29:07.230 --> 29:11.330
So, okay, Chad, we have these ultra secure cards.

29:11.330 --> 29:12.650
Why don't we have more of them then?

29:12.650 --> 29:14.930
Why don't I have one for my credit card?

29:15.050 --> 29:17.070
They don't scale well at all.

29:17.070 --> 29:19.670
Like, they were intended to have a bunch of applets.

29:19.670 --> 29:20.650
We'd all have one card.

29:20.650 --> 29:26.210
I'd have my Chad card and it has my bank ID and my gym pass and my employee ID.

29:26.210 --> 29:31.750
But the security architecture in this Java OS has almost no isolation and it's pretty terrible.

29:31.750 --> 29:39.430
So you can't trust that Gold's gym had the same security standards as Bank of America to throw those in the same memory space.

29:39.430 --> 29:41.710
So now I need one card for everything.

29:41.710 --> 29:46.510
And if I'm using them to log into websites, now we're talking a huge freaking nightmare, right?

29:46.510 --> 29:50.590
I'm gonna have a Rolodex of 800 cards coming in here trying to log into a site.

29:50.710 --> 29:54.190
They also require extra hardware, which people don't love.

29:54.190 --> 29:59.770
So like, for me to log into this computer with a smart card, I need some little dongle thing that I'm gonna plug into.

29:59.990 --> 30:05.530
And then for all, you know, your wallets are just gonna be crazy fat and they have no user interface.

30:05.530 --> 30:07.290
This one is actually pretty relevant.

30:07.530 --> 30:15.350
So going back to the first attack of being able to use someone else's card, if you drop your smart card, someone else picks it up, they become you instantly.

30:15.450 --> 30:17.250
There's no way to verify that.

30:17.470 --> 30:24.430
If you had a user interface on there, even with just this, you know, four digit pin, you could pretty much mitigate that attack.

30:24.430 --> 30:31.530
A four digit pin with some throttling or some, you know, threshold of five attempts, anyone who picked up that card would be doomed.

30:31.530 --> 30:35.050
But these are passively powered, so you can't have interfaces.

30:36.330 --> 30:40.310
So this is the research question I've asked myself my whole career.

30:40.310 --> 30:41.990
Like, can we do better?

30:41.990 --> 30:44.750
I hate passwords, smart cards, things in my pocket.

30:45.230 --> 30:50.890
And this was back in, God, I don't know, 2009.

30:50.890 --> 30:53.750
I'm like, why don't we use iPhones when they were new?

30:53.750 --> 30:56.610
And everyone's like, no one will ever take their iPhone to work.

30:56.610 --> 30:57.430
It's a terrible idea.

30:57.430 --> 30:59.630
The security on them was bad at the time.

30:59.710 --> 31:09.770
But I really do think we're at a point where smartphones can kind of completely eliminate smart cards over the next 10, 20, 30 years.

31:09.770 --> 31:13.750
So they actually already put smart cards in every single smartphone today.

31:13.750 --> 31:20.250
So if you take that exact chip that I'm telling you that's in the SIM card, that's in your credit card, take all the plastic off of it.

31:20.390 --> 31:25.090
It's called a secure element and it is soldered on the motherboard of every single person's phone in here today.

31:25.090 --> 31:28.310
And when you do tap to pay, that's where you're interacting with.

31:28.350 --> 31:30.170
Everything is stored in that secure element.

31:30.170 --> 31:37.650
In fact, all of the initial NFC stuff implemented on phones, they kind of had a hybrid chip that would do NFC plus the secure element.

31:37.650 --> 31:43.070
They're just taking everything they knew from a smart card, trying to put in a phone so that you can do your digital payments.

31:43.230 --> 31:53.990
The other interesting thing that has unfolded on phones, every modern ARM processor on earth, even the embedded processors, have something in there called a trusted execution environment.

31:53.990 --> 31:56.150
In ARM's version, they call it trust zone.

31:56.490 --> 32:02.470
So when the phone boots, it boots into a secure world that is your first stage bootloader.

32:02.470 --> 32:07.550
In there is where you're supposed to keep only your most sacred secrets and code.

32:07.550 --> 32:12.670
So your cryptographic keys, anything you use for authentication, payments, secure world.

32:12.670 --> 32:20.210
Then you create a sandbox called the non-secure world, and that's where you let iOS and Android and the operating systems play.

32:20.330 --> 32:28.750
So now if iOS gets totally rooted, 100% rooted, exploited, they still cannot touch the code in the secure world.

32:28.750 --> 32:32.830
So if you've ever played around with your Android phone, it tells you to push the physical button.

32:32.830 --> 32:41.730
That's because that code is, I don't work for Google, but it's very likely running in the secure world, and they're getting the interface from the physical button.

32:41.730 --> 32:55.390
Nobody to date has written a driver for all of the touchscreen, all the graphics in the secure world, but you can securely detect, yes, somebody's physically hitting this button and wants to do this thing that is being requested of me.

32:55.390 --> 32:59.810
Not just being used by malware or some proximity trying to read your phone.

33:01.530 --> 33:18.790
So the future that I am hoping for and literally bet my career on is that we can put all of this cool security that we've learned through the smart card world into these phones that we already carry, and you get really amazing interactions because these can interact with everything.

33:18.790 --> 33:26.630
They can interact with the smart card readers we already have, our computers, each other, and then we can replace everything in our wallet with these phones.

33:26.770 --> 33:40.630
And once you have a private key store, we can do something more akin to what they wanted to do with the applets, where we actually can store multiple different credentials in here, and I could have my gym pass next to my Bank of America card, next to my Defcon badge,

33:40.630 --> 33:41.650
or whatever.

33:43.190 --> 33:52.950
So I quit my job in academia, or I declined all my professorship offers, and what I've built since is a company called Authenticate, where we actually do that.

33:52.950 --> 33:57.050
We have an app that can talk to door readers.

33:57.050 --> 34:06.010
It all uses asymmetric encryption, uses all the good stuff, but can also talk to computers, SSH servers, websites, you name it.

34:06.010 --> 34:08.770
You can use that credential for all sorts of different protocols.

34:09.110 --> 34:26.270
So I would now welcome any questions about breaking into buildings, or maybe securing buildings if you're into that, as I've since switched my career to go from, I don't know, the fun side to the not fun side of trying to patch all of these holes that I just showed you.

34:26.270 --> 34:28.290
So thank you for attending.

34:36.080 --> 34:37.120
Question.

34:37.820 --> 34:45.740
And I think on time, I am very early, so there's plenty of time for questions.

34:54.940 --> 34:58.000
Has anybody broken into the CAC card?

34:58.440 --> 35:03.000
That's one of those questions where even if I knew the answer, I couldn't tell you.

35:05.460 --> 35:11.420
There is a library that we published when I used to work in Lincoln Laboratory called LLSmartCard.

35:11.420 --> 35:22.320
If you want to pull that on GitHub and play with it, it gives you a decent interface in Python to fuzz smart card interfaces over both the contact and contactless interface.

35:22.580 --> 35:32.300
So if you want to look for yourself and plug some cards in, it's... and I think we have some templates on there for a Visa card and a CAC card of basic interactions with it.

35:58.480 --> 36:04.080
How well do trust execution environments stand up against physical attacks?

36:04.580 --> 36:09.360
Is that a downgrade from smart cards that have all of these physical anti-tamper in there?

36:09.360 --> 36:12.000
The answer is yes.

36:12.000 --> 36:15.360
There are some side channel attacks and things that have been published on tees.

36:15.480 --> 36:20.720
The way you would implement this is really to couple the tee with the secure element though.

36:20.720 --> 36:25.000
So you would keep all of your keying infrastructure in the secure element.

36:25.000 --> 36:34.940
So all of your digital signatures, all of the cryptography, everything is done in the secure element that has all this physical anti-tamper and side channel defenses built in.

36:34.940 --> 36:39.820
And you really need the tee specifically for a trusted user interaction.

36:39.820 --> 36:50.540
So you really want the tee to disable all of the accelerometers and side channels and then anything that's mildly sensitive interacting with the secure element.

36:50.540 --> 36:59.360
But the computation itself should not be in the tee because you don't want RSA side channels.

36:59.360 --> 37:05.100
The one thing that I focused a lot of my PhD on, on the tee security in particular, was glitching attacks.

37:05.100 --> 37:11.200
So the one thing you can do when you're booting into secure world is if you can glitch at just the right time.

37:11.200 --> 37:13.380
This is actually how the Xbox One was hacked.

37:13.860 --> 37:14.680
I love it.

37:14.680 --> 37:19.220
If that person is here, introduce me to them so I can like hug them and give them a high five.

37:19.280 --> 37:25.640
But they actually, you're able to glitch it and skip the part where you would then put everything in non-secure world.

37:25.640 --> 37:30.920
So then you could have unfettered access to the secure element and start doing crazier attacks.

37:31.020 --> 37:37.760
So I actually looked extensively into how to write glitching resistant code in software only with a clang pass.

37:37.760 --> 37:39.300
We published a paper on it.

37:39.300 --> 37:46.960
I wanted to call it glitch please in honor of bitch please, but academics don't have the same sense of humor that I do.

37:46.960 --> 37:51.940
So I had to change it to glitching demystified or something far more lame.

37:51.940 --> 38:05.820
But we did show that in software only you can actually do an LLVM pass and make your code glitching resistant for all practical purposes on your bootloader to keep the the T code at least in a secure world where it belongs.

38:30.760 --> 38:36.620
So how effective are the RFID blocking badge holders and little sleeves that they get you?

38:37.320 --> 38:38.900
They're very effective.

38:39.020 --> 38:46.700
When I was doing this research, that was actually my number one thing I recommended to everybody and probably got the most enemies from.

38:46.700 --> 38:50.800
Because I'm like, hey, these things are annoying, but they absolutely work.

38:50.800 --> 38:52.340
And I work here.

38:52.340 --> 38:55.300
I'm trying to protect, you know, the stuff we're doing.

38:55.520 --> 39:03.720
So my favorite ones, they have these badge holders that are plastic, and they're spring loaded, you can put your ID in them that has a Faraday cage in the back.

39:03.720 --> 39:07.280
But then you can flip the plastic up, tap your badge and flip it back.

39:07.280 --> 39:12.380
Because otherwise you're like in this fight every morning trying to like slide it out of this stupid metal thing.

39:12.440 --> 39:13.700
They're not cheap.

39:13.700 --> 39:15.300
So they're hard to do at scale.

39:15.300 --> 39:20.680
But I don't know, they bought me one because I exposed all this stuff.

39:20.680 --> 39:26.120
And they were not happy with me, but happy enough to get me the fancy one.

39:26.120 --> 39:29.600
But they totally work, like RFID wallets and stuff.

39:29.700 --> 39:37.440
I guess the one thing I didn't mention here, the one attack that can pretty much never be protected against in smart cards, it's called the relay attack.

39:37.440 --> 39:42.900
So this is where I would come near you with a software defined radio, I would touch somewhere near your card.

39:42.900 --> 39:48.640
And I have my friend anywhere on earth with another software defined radio that just re-emits back and forth.

39:48.700 --> 39:55.440
So there's almost no way to defend against that, unless you have some like capacitive touch on the smart card that would stop it.

39:55.500 --> 39:58.180
And that's really like those RFID wallets.

39:58.280 --> 39:59.540
That's what those are all about.

39:59.540 --> 40:02.700
Because somebody could come up to you, you're nowhere near the cash register.

40:02.700 --> 40:07.720
Someone else has a Proxmark up their sleeve and then they just bought, you know, a really fancy dinner on you.

40:07.720 --> 40:08.940
Thank you very much.

40:09.060 --> 40:10.980
So yeah, they totally work though.

40:10.980 --> 40:13.540
We've tested them in the lab and they do their job.

40:42.500 --> 40:49.400
The question there was about the legal action since the, you know, this key has been leaked since 2010.

40:49.400 --> 40:51.240
Has there any been class action suits?

40:51.260 --> 40:53.100
I don't know.

40:53.100 --> 40:56.260
And I don't know what the law is around that.

40:56.260 --> 41:03.540
I actually have a friend who's a law professor in Texas and asked her to speak recently about cybersecurity law in particular.

41:03.540 --> 41:07.020
And I came out of that talk with far more questions than I got answers.

41:07.020 --> 41:10.240
It is extremely complicated and confusing.

41:10.420 --> 41:18.720
It does seem to me though, just like a gut feeling that if there's a security vulnerability, the fix for it should be free for customers.

41:18.800 --> 41:25.900
And it should be like strongly advertised, like, hey, you haven't updated yet.

41:25.900 --> 41:29.160
Maybe you should consider this free firmware update.

41:29.500 --> 41:31.700
So I don't know.

41:31.700 --> 41:41.860
I mean, that was part of the reason I also decided to throw my hat in the ring and try to build products instead of staying in my ivory tower, just pointing fingers at people saying you did it wrong.

41:41.860 --> 41:43.460
It is really freaking hard though.

41:43.460 --> 41:45.980
I will stress building a security product.

41:45.980 --> 41:50.420
It is way harder than it sounds when you're on the offensive side your whole career.

41:50.420 --> 41:52.020
Like, why didn't they just do this?

41:52.020 --> 41:52.960
And then you're on the other side.

41:52.960 --> 41:56.180
You're like, oh, damn, that is, that's a lift there.

41:56.180 --> 42:00.180
That is not as easy as I made it sound in my publication.

42:23.120 --> 42:23.460
Okay.

42:23.460 --> 42:24.800
I should have had this in my talk.

42:24.800 --> 42:29.080
Is there any way to secure your enterprise today with smart cards that I didn't go over?

42:29.080 --> 42:29.760
Yes.

42:29.760 --> 42:30.440
A hundred percent.

42:30.440 --> 42:32.320
These are just the known vulnerabilities.

42:32.400 --> 42:37.580
There are cards like the Dezfire, even like the Mifer Dezfire, Mifer Ultralights.

42:37.580 --> 42:43.920
There are cards that are properly, like they're using Dez, they're using AES, they're using good cryptography that is not broken.

42:43.920 --> 42:49.620
So you can get these cards with the good cryptographic standards on them and key them to your organization.

42:49.920 --> 42:54.860
And, you know, at least for now, there's no known vulnerabilities you're cruising.

42:55.120 --> 42:57.880
So yeah, there are card stocks out there.

42:58.420 --> 43:00.480
HID even sells Dezfire cards.

43:00.720 --> 43:05.860
So it's not that like all of their cards have to be this I-class or, you know, any brand.

43:05.900 --> 43:08.740
And most of these readers will read the good cards.

43:08.740 --> 43:17.180
So even if you buy off-brand readers, they'll read Dezfire cards, they'll read whatever cards you want, and you can set them up in a way that, you know, someone can't just come up with their flipper.

43:17.680 --> 43:32.060
And we plan on our website, if we get time after DevCon, because I get this question a lot, we want to publish all of the known vulnerabilities, kind of like the thumbs down, and then, you know, some of the other card stocks, at least we'll try and keep a record of what's been broken,

43:32.060 --> 43:33.820
what hasn't on our website.

43:39.700 --> 43:42.120
Any other questions about how to break into buildings?

43:45.200 --> 43:51.880
You got me for... I'm legally allowed to stay up here for 10 more minutes before I get ripped off the stage, is what I was told.

43:51.900 --> 43:53.920
So we can hang out for a little bit more.

44:16.570 --> 44:18.630
This question, I never know the answer to it.

44:18.630 --> 44:20.110
Someone's been coming to DevCon forever.

44:20.110 --> 44:24.950
How dangerous is it to walk around DevCon without your cards in a Faraday cage?

44:24.950 --> 44:27.850
Your credit cards are fine, unless it's a relay attack.

44:27.850 --> 44:32.130
There's no known, like, wireless attack that I'm aware of that can just clone cards.

44:32.190 --> 44:40.910
If it is your employee badge, I would say if you have a 125 kilohertz card, it's pretty likely somebody here has read that card.

44:40.910 --> 44:48.810
Last year in the physical security village, we had the wall of sheep for everybody that would walk in with their prox cards in their pocket, and it caught quite a few people.

44:50.830 --> 44:59.470
Yeah, and if you have an iClass card that, you know, if you're a target and someone bumped into you awkwardly, you know, maybe go get a new badge when you get back to work.

44:59.570 --> 45:00.930
But I don't know.

45:00.930 --> 45:13.310
I generally think that, like, the shenanigans at DevCon is... I hope it's overhyped as someone who's been coming my whole life, but someone did steal something from our village this year, so now I'm like, more on your team.

45:13.310 --> 45:14.770
Like, no, there's bad people here.

45:14.770 --> 45:16.150
We're not all good.

45:16.150 --> 45:17.850
We're not all honest hackers.

45:18.050 --> 45:26.450
But, you know, credit cards and stuff, you know, I would put them potentially in, like, a Faraday wallet or something, but you don't need to cancel them.

45:26.450 --> 45:27.630
You should be fine.

45:33.720 --> 45:37.620
Yeah, well, let's keep rifting.

45:59.290 --> 46:06.250
Yeah, so if we... let's say we go from smart cards to phones, what risk would we open ourselves up to?

46:06.250 --> 46:15.210
So the biggest one there, and the one that I've spent a lot of my research thinking about, was the software attack, right?

46:15.210 --> 46:16.370
Our phones are on the internet.

46:16.370 --> 46:17.810
Our smart cards are not.

46:17.830 --> 46:25.070
So the question that's kind of been, like, my brain itch for the past 15 years is, like, what if my phone gets hacked, right?

46:25.070 --> 46:29.770
Like, that's now an attack factor that wouldn't have existed on a smart card.

46:29.890 --> 46:37.170
So that's where the secure element, the trust execution environment, a lot of the hardware architecture that's been built out on these phones.

46:37.690 --> 46:46.710
Back to the bad implementation, if done well, if done correctly, you can actually mitigate that software-based attack.

46:46.830 --> 46:48.930
It'll never be fully gone, right?

46:48.930 --> 46:51.110
There's always gonna be a chance that you didn't have before.

46:51.110 --> 46:52.950
It was zero percent chance before.

46:52.950 --> 47:03.610
Now it's non-zero, but you really can push it down quite low to the point where, you know, I think my hope is eventually we can use that to, like, vote for the president, right?

47:03.610 --> 47:07.690
You could have your government ID on your phone and, like, election day comes out.

47:07.690 --> 47:09.430
You don't worry about waiting in some line.

47:09.430 --> 47:11.530
You could just cast your vote in some secure way.

47:12.070 --> 47:21.150
The physical attacks on the phone are going to be no better than the physical attacks on the card because it's the same chip at the end of the day that you're going to be attacking.

47:21.370 --> 47:25.350
So you're not really opening yourself up to another physical interface.

47:25.350 --> 47:33.630
But now that you do have all these radios, you have an application processor, you have a lot more other ways to poke on that card remotely.

47:34.550 --> 47:38.450
That's the one that I've spent most of my research freaking out about.

47:38.450 --> 47:48.510
And if you look at all my publications, we're, like, fuzzing the trusted execution environment on smartphones to figure out are other apps in there secure?

47:48.510 --> 47:54.070
You know, if we put our stuff in there, is a neighbor going to be the one that actually crumbles the whole security?

47:54.370 --> 47:59.290
So that's the sticky part of putting things on phones.

47:59.290 --> 48:07.290
It can be done well, but it's hard and it is going to take people to collaborate, which, you know, and agree on security standards.

48:07.430 --> 48:08.030
Yeah.

48:38.350 --> 48:47.370
The question was, in 2010, Chase sent out a bunch of, you know, tap-to-pay cards and then actually had a recall on them and had to send out new ones.

48:47.370 --> 48:50.270
And the question was, was that because of a security vulnerability?

48:50.290 --> 48:52.230
I'm not sure.

48:53.330 --> 48:54.130
Probably.

48:55.030 --> 48:57.030
That seems like a good reason.

48:57.230 --> 49:00.630
I know, like, that is the biggest issue with hardware tokens in general.

49:00.630 --> 49:06.530
And back to the counterpoint on phones, you can actually push over their updates to phones where you can't the physical security keys.

49:06.530 --> 49:13.890
Like, I know UBKey had an issue where they had some of their FIPS keys that had a vulnerability in them, and you have to reissue hardware.

49:13.890 --> 49:17.110
So that is actually another interesting thing.

49:17.110 --> 49:24.530
But then you run into these, like, Spectre meltdown attacks where, you know, not only are you reissuing hardware, but you now have to, like, refab processors.

49:24.530 --> 49:26.110
That's going to take 10 years.

49:26.530 --> 49:30.110
So it's a tough game, like trying to build secure systems.

49:30.110 --> 49:32.790
It's really, really complicated.

49:32.790 --> 49:35.150
I do think we're getting much better at it, though.

49:35.150 --> 49:39.270
Just if you look at the frequency of exploits, it actually is going down over time.

49:39.290 --> 49:44.510
I don't think we're going to be out of jobs anytime soon, but, you know, we are doing a good job going forward.

49:57.660 --> 50:00.480
Am I familiar with laser fault injection?

50:00.640 --> 50:03.940
Yes, like optical glitching attacks on hardware.

50:03.940 --> 50:04.840
I am familiar with.

50:04.840 --> 50:12.100
I've actually done one of them, not with the intent to succeed, but with the intent to learn, and it is freaking rad.

50:12.180 --> 50:21.180
Like, to look at an electron microscope, you're looking at, like, a couple nanometer resolution on this chip, and, like, it's sweet.

50:21.180 --> 50:23.080
He's, like, red fuming nitric acid.

50:23.080 --> 50:26.040
So how do I think that'll play into this going future?

50:26.040 --> 50:30.260
I think that's where you stand on the shoulders of giants in the smart card world, right?

50:30.260 --> 50:37.280
So, like, these secure elements really are done well to try to prevent against that stuff.

50:37.280 --> 50:41.200
Like, these physical attacks have really been thought about in depth.

50:41.560 --> 50:50.000
So if we can take all of that learned, really leverage those secure elements on the phone and all that same technology, you know, we start to move forward.

50:50.000 --> 50:58.320
The problem with kind of the industry as a whole, as being a hardware industry, as it has been, you're using all these low-end microcontrollers, right?

50:58.320 --> 50:59.880
You're trying to drive cross down.

51:00.460 --> 51:04.500
And I know PIX in particular, that's what we had a PIX, is vulnerable to that attack.

51:04.540 --> 51:06.160
So we wanted to see that happen.

51:06.160 --> 51:11.260
We're like, okay, we want to spread, hit UV light here, flip the right protect bit, and dump the firmware.

51:11.260 --> 51:15.220
In particular, we were messing around with my Subaru WRX.

51:15.220 --> 51:20.380
So, like, we were able to roll the odometer and make the odometer say leet.

51:20.380 --> 51:23.180
That was, like, one of the fun wins of that.

51:23.180 --> 51:27.540
And then we just found some other things with known, some other processors with known attacks.

51:27.720 --> 51:29.420
So, I mean, 100%.

51:29.420 --> 51:35.640
The more security we start putting in our phones, the more we need to beef up the defense.

51:35.640 --> 51:43.900
And if you look at how phones have advanced, we're already at the point where, like, they are really wildly impressive from a hardware architectural point of view.

51:43.900 --> 51:47.860
And the more we throw in there, the better job we have to do.

51:47.900 --> 51:51.940
And I'll leave you with, like, my adage on why I think that's a good thing.

51:52.160 --> 51:55.140
As a defender, and I worked for the DoD for a bit.

51:55.140 --> 52:00.380
So, if you watch the movie 300, as a defender, you want to create a choke point, right?

52:00.380 --> 52:01.660
Like, that's how you beat the Persians.

52:01.660 --> 52:06.580
You know exactly where they're coming, and you can focus all of your attack power there and all your defensive power.

52:06.900 --> 52:13.540
So we really do put it all in the phone, all in the secure element, and this one chip that has a single line for IO.

52:14.040 --> 52:21.080
Like, you now, your parsers are very rudimentary, can actually be audited quite well.

52:21.080 --> 52:29.900
And if you get to the point where all you're looking at is this one input, like, one input channel in and out, you actually have a chance to defend that.

52:29.900 --> 52:40.500
Whereas now, you know, with passwords and credentials and smart cards, you know, you have all these cards out in the wild, you have no clue what's happening where, all these different technologies.

52:40.700 --> 52:53.040
So, if you really do put all your eggs in one basket and guard that basket, it's not as crazy as it initially sounds, or I've at least convinced myself of that after a 15-year academic career that, you know, I've convinced myself I'm not crazy.

52:53.040 --> 52:54.820
I don't know if I've convinced others yet.

52:56.780 --> 53:01.800
I have two minutes for either a final question or an awkward silence.

53:08.160 --> 53:09.100
All right.

53:11.280 --> 53:12.380
Thank you all so much.

53:12.380 --> 53:14.340
Hopefully, this was educational and useful.

53:14.340 --> 53:20.320
Swing by the Physical Security Village if you want to play with any of this stuff hands-on and see what it's actually like to clone a card.

