WEBVTT

00:00.000 --> 00:03.300
Alright everyone, thank you so much for coming to the RFID talk.

00:03.600 --> 00:25.460
This is going to be a quick introduction to how RFID works and what you can do to, you know, play around with it, have a little fun, and hopefully we will end with some suggestions on how we can make RFID a little bit safer and what the common problems are,

00:25.460 --> 00:31.160
and then we're going to end with a quick demonstration on how to use the, uh, the Flipper Zero.

00:31.160 --> 00:33.700
I'm sure y'all are very familiar with that.

00:33.740 --> 00:36.300
Um, if not, we're going to introduce you to that as well.

00:36.360 --> 00:40.620
So, oh yeah, before that, introductions.

00:40.620 --> 00:41.480
My name is Ege.

00:41.480 --> 00:42.940
That's spelled like that.

00:42.940 --> 00:44.940
Uh, the top name that you see over there.

00:45.100 --> 00:48.320
Uh, we're from the physical security village.

00:48.320 --> 00:58.880
Uh, if you see, like what you see here and would like to see more of the physical side of, uh, like physical security side of Defcon, please be sure to come by the village.

00:59.180 --> 01:06.320
Uh, it's going to be in the map and also we're going to be, you can just walk around and look for people wearing weirdly green shirts.

01:07.040 --> 01:07.960
Thank you.

01:07.960 --> 01:09.220
I'm Andrew Marchment.

01:09.220 --> 01:11.000
I'm the second name on there.

01:11.000 --> 01:15.220
Uh, I work in the store of the physical security village in the vendor area.

01:15.320 --> 01:24.080
Uh, we've very happy to have partnered with, uh, uh, the Keyport, uh, guys this year to offer a discount for people buying Keyport key organizers.

01:24.080 --> 01:29.020
And we're also a partner with Covert Instruments to offer some of their inventory at our store.

01:29.020 --> 01:35.960
So if you've seen them lock picking lawyer or McNally and you want some of those tools, uh, we are retailing them at our store.

01:35.960 --> 01:37.200
So come by later.

01:37.420 --> 01:51.740
Um, my background is in satellite telecom, so I'm more of a high frequency RF guy, but, uh, I'm doing this talk today on, uh, how to use the, uh, flipper zero and other RFID cloning tools and, and how RFID works.

01:52.080 --> 01:54.600
So, uh, we'll get started.

01:55.140 --> 01:55.940
All right.

01:55.940 --> 01:58.680
So yeah, RFID, sorry about that false start there.

01:58.760 --> 02:00.580
Um , RFID, we see it all around us.

02:00.580 --> 02:05.600
Uh, we see it whenever we, uh, tap our, uh, key fob to get into our building at work.

02:05.600 --> 02:17.460
We, when we tap our badge, whenever we go on transit and we use one of those contactless cards, um, or even when we pay, uh, with either, uh, you know, tap with your card or Apple pay or, uh, Google wallet or whatever.

02:17.460 --> 02:23.540
Um, but something that we don't necessarily always think about is how these darn things work.

02:23.700 --> 02:25.740
So you want to run us through it?

02:25.740 --> 02:26.180
Sure.

02:26.520 --> 02:27.320
All right.

02:27.320 --> 02:33.420
So it's basically a transformer that you're making when you bring your card up to a reader.

02:33.420 --> 02:40.040
So the reader has a coil of wire and we're passing an electrical current through that, uh, coil at all times.

02:40.040 --> 02:53.080
As that card approaches, we're completing the circuit and the magnetic field that comes around that original coil induces a current in the coil inside of your card.

02:53.160 --> 03:01.760
And that powers a little chip in there that actually allows it to respond to the, um, reader with its ID.

03:02.800 --> 03:03.480
Yeah.

03:03.480 --> 03:10.800
So, um, this is kind of a simplified view of what the inside of one of those tags looks like.

03:12.480 --> 03:18.420
What it basically does, it, it is, it draws more or less current to send a one or a zero.

03:18.420 --> 03:19.720
There are other ways as well.

03:19.720 --> 03:24.980
It gets a little bit more complicated, but on the very basic end of it, this is what it looks like inside.

03:24.980 --> 03:43.300
And what that looks like, if you, you know, were to measure the, uh, magnetic field around it is the magnetic field is either high, you know, like you see how those like pulses, um, or it's a lower magnetic field, uh, measured because the chip is loading that magnetic field,

03:43.300 --> 03:44.480
drawing energy out of it.

03:44.740 --> 03:48.900
And that is, it's talking to the transmitter.

03:48.900 --> 03:56.280
So something obvious that you might realize is this is very easy to mess with.

03:56.280 --> 04:06.220
If I bring my own loop of wire around it, and that's actually how I capture that image that you just saw around, uh, that I just saw before, I'm able to just read that communication.

04:06.220 --> 04:09.840
It's literally just a breadboard jumper wire that I looped around a bunch of times.

04:10.060 --> 04:15.640
And then I put that near the transmitter and the fob, and I was able to pick up that communication.

04:15.640 --> 04:19.820
There's no encryption because, you know, you can't encrypt physics.

04:19.820 --> 04:22.820
It's either, you know, more or less magnetic field.

04:23.140 --> 04:27.060
Um, and it's incredibly trivial to sniff.

04:27.060 --> 04:31.340
Something else is, again, because you can't encrypt physics.

04:31.420 --> 04:37.360
And the moment the tag sees the reader, it starts blaring out its ID number.

04:37.360 --> 04:40.820
As Andrew said, I can come around with my own reader.

04:40.820 --> 04:43.280
Maybe you might have seen this.

04:43.280 --> 04:47.560
Uh, this is a photo from Physical Security Village last year.

04:47.560 --> 04:49.120
We have a similar setup this year.

04:49.120 --> 05:01.620
If you go near, um, the entrance or the exit of the, uh, the village, you might see a long-range reader, um, idly sitting by sniffing your badges and putting them on the, the wall of sheep.

05:01.700 --> 05:08.060
Um, so, um, how can we solve this problem?

05:08.060 --> 05:09.760
Does anyone have any ideas?

05:11.980 --> 05:13.280
Shout them out.

05:16.360 --> 05:23.980
Lasers, I heard, uh, it's probably going to be a little more difficult to target that, but yeah, I heard someone say encryption, yeah.

05:23.980 --> 05:27.000
We solve it using encryption.

05:27.320 --> 05:31.200
So this is how an encrypted communication looks like.

05:32.400 --> 05:35.740
Before everything happens, there has to be a pre-shared key.

05:35.740 --> 05:45.120
So basically the reader and the card or the fob or whatever and the badge need to be, have an agreed upon key that the manufacturer puts on there.

05:45.660 --> 05:50.940
And there's a challenge and response between the reader and the fob.

05:51.160 --> 06:02.560
And once they have both proven that they both know what the key is without ever saying the key, uh, then they can just use that key to communicate encrypted.

06:02.560 --> 06:09.460
But this encryption, uh, this communication is obviously a little bit more complicated than just the raw, okay, I'm loading the field.

06:09.460 --> 06:12.260
I'm not loading the field communication that we saw earlier.

06:13.520 --> 06:21.120
And, uh, because of that and other, uh, bandwidth limitations, this is usually seen in high frequency.

06:21.120 --> 06:23.300
So 13.56 megahertz RFID.

06:24.300 --> 06:29.940
So this, at least in principle, seems pretty perfect, right?

06:29.940 --> 06:40.840
This seems like a mathematically secure system and as long as it's properly implemented and as long as no one does this inconceivable thing of just putting the same key everywhere.

06:41.220 --> 06:44.840
You know, like if, if there was a theoretical, you know where I'm going, right?

06:46.160 --> 06:47.740
This is what HID did.

06:49.040 --> 07:09.020
They apparently sold and until pretty recently continued to sell, um, RFID systems that use the same key on every single standard security, uh, reader and fob that they sold.

07:10.560 --> 07:15.820
The re, uh, the authors of this paper did them a solid by not releasing the key.

07:15.820 --> 07:23.320
Uh, so they had some amount of time to reply, respond, but obviously did not take that long for the key to appear on GitHub.

07:25.960 --> 07:39.040
Um, but as long as you don't, you know, do stuff like that, um, and also there are other, uh, vulnerabilities that we've seen just because of time limitations, we can't go too much into it.

07:39.040 --> 07:57.120
Um, there are, um, yeah, as long as you implement your security correctly, as long as you pick your random numbers actually, you know, in a decently random way, you can do high security, uh, high frequency RFID in a vaguely secure way.

07:57.120 --> 08:02.420
Um, what you, what happens if you don't do that is what Andrew's gonna show next.

08:02.700 --> 08:04.260
So yeah, with a demo.

08:04.260 --> 08:05.320
All right.

08:07.060 --> 08:08.320
Thank you.

08:08.320 --> 08:10.260
Let's get this set up.

08:10.340 --> 08:12.540
Here's everyone's favorite dolphins.

08:23.460 --> 08:28.900
All right, so this is the interface for the flipper zero, which is what I'm holding my hand here.

08:29.280 --> 08:33.280
And it has a lovely little interface here with some animations.

08:33.280 --> 08:39.960
And it's very convenient for copying your hotel room keys, so that you can share them with your friends.

08:40.160 --> 08:45.060
But I'm going to go into low frequency here because that's what the badges I'm holding are.

08:45.140 --> 08:48.420
And I'm going to read the orange badge.

08:50.320 --> 08:53.120
And we'll see if this is going to work for me.

08:53.660 --> 08:54.740
There we go.

08:54.740 --> 08:56.440
We have the orange badge.

08:56.440 --> 09:07.580
And we are now going to attempt to write this to the blue badge, which already has information stored on it so I'm not 100% sure if this is going to work.

09:12.480 --> 09:13.820
And there we go.

09:13.900 --> 09:19.500
So now, our blue badge has the same information as our orange badge, and will open the same doors.

09:20.060 --> 09:21.600
And it can be this simple.

09:25.480 --> 09:27.340
Yeah, just to show that it worked.

09:28.020 --> 09:33.660
Yeah, if we go to read again, and this time we wrote to the blue badge, or the blue fob.

09:33.660 --> 09:37.080
So if we read the blue fob, it's going to have the same information.

09:37.080 --> 09:42.360
So when we said, or when Andrew said, it's just saying its ID number, this is what we mean.

09:42.360 --> 09:48.380
So you see here, there's a facility code, so that's the 25 there, and a card number.

09:48.380 --> 09:51.140
So in this case, it's 15686, right?

09:51.980 --> 09:55.320
So this is just one of our...

09:57.220 --> 10:00.200
You don't have to write that down and try to figure out where I live.

10:01.720 --> 10:05.140
That's one of the test doors that we have at the village.

10:05.340 --> 10:12.880
If you want to come by, and you want to plug that into your flipper, you're probably going to be able to open one of the two test doors that we have.

10:13.160 --> 10:14.120
So yeah, that's what we mean.

10:14.120 --> 10:17.800
It's literally just a 4-byte number.

10:18.900 --> 10:25.800
So something else you can do, the flippers don't support this on the stock firmware, but something else that you can do with it is...

10:27.540 --> 10:31.160
Does anyone want to say, just yell it out loud?

10:31.160 --> 10:34.320
Is 4-bytes a very large keyset?

10:34.860 --> 10:37.140
No, it's a tiny keyset.

10:37.340 --> 10:38.760
A keyspace, rather.

10:39.400 --> 10:41.780
So yeah, you can also brute force this.

10:42.720 --> 10:44.160
And... oh yeah, there we go.

10:44.160 --> 10:44.800
Yeah, Andrew has...

10:44.800 --> 10:47.080
Yeah, I've got the other firmware.

10:47.220 --> 10:48.040
Yes.

10:48.060 --> 10:49.880
So this is the HID Proc.

10:49.880 --> 10:53.880
So this will run through the entire dictionary for HID Proc's devices.

10:53.920 --> 10:56.740
Another common one is the EM4-100.

10:57.260 --> 11:04.220
And again, it's a very short dictionary, and you can run through this in about 15 to 30 seconds.

11:04.420 --> 11:07.800
Yeah, so the main thing that's limiting us here is...

11:08.360 --> 11:12.300
Again, remember, it's a very passive system, especially for low frequency.

11:12.300 --> 11:16.620
The reader has to ask us what our ID is, and then we can reply.

11:16.620 --> 11:20.040
So we're limited by the number of times the reader is willing to ask us.

11:20.040 --> 11:22.800
But that's usually either 1 or 2 per second.

11:23.100 --> 11:37.940
So even though that sounds like, you know, 0.5 Hz or 1 Hz, sounds like a very low speed attack, or like a very limited, because if you were trying to break a hash, that would be basically impossible, but because it's just 4-bytes, if you can just, like,

11:37.940 --> 11:55.640
you know, leave something on there, maybe overnight, you know, like after work hours, you just go, put your device on the reader, you'll leave for a couple hours, you come back, you pick it up, and it'll give you what the correct code is.

11:56.140 --> 12:08.940
So with kind of a conclusion to this is, when we tap our cards, when we tap our badges, or when we, you know, tap to pay, it all seems very magical.

12:08.940 --> 12:15.540
It sounds, it feels like we're not limited by the same things we are when it comes to keys.

12:15.540 --> 12:24.560
You know, like we, a lot of people talk about how if you take a photo of a key, you can duplicate it, if you take, if you leave your key, it can be measured, decoded.

12:24.680 --> 12:33.440
And it feels like whenever we're using RFID cards or, you know, key fobs, badges, they feel like they are somehow magically more secure.

12:33.740 --> 12:42.640
And in some cases, for specific use cases it is, but it's good to remember that it's not a silver bullet, right?

12:42.640 --> 12:49.080
We should be treating our RFID cards the same way we treat keys.

12:49.080 --> 12:49.400
Yeah.

12:49.740 --> 12:57.340
So if we lose a fob, we should do the exact same things that we would do if we were to lose a key.

12:57.340 --> 12:58.420
Sorry, were you going to say something?

12:58.440 --> 13:01.440
Yes, I was going to say, treat it like any secret.

13:01.440 --> 13:07.720
So like your passwords or your door keys to your house, it's exactly the same thing.

13:07.720 --> 13:10.720
If you have the secret, you have access.

13:11.000 --> 13:16.120
So there needs to be a, you know, good maintenance of your secret.

13:16.120 --> 13:22.420
So if you have a building and you have employees who are terminated, you need to deactivate that card.

13:22.800 --> 13:34.740
If you have a building that is using an HID card system, you need to upgrade that to one that does a proper job encrypting the secret when it transmits it.

13:34.740 --> 13:49.000
Wygand has, you know, and other formats after the reader, transmit the secret unencrypted over the wires to the central server, which controls the building access system.

13:49.100 --> 14:08.600
So again, even if it's a proper four-way shake between the reader and the badge, someone can tamper with one of the readers and actually tap the wires and intercept the secret there and replay it at will to gain access later.

14:09.660 --> 14:14.940
Yeah, so just to sum up what Andrew said there, hook up your darn tamper wires.

14:14.940 --> 14:24.820
If you own a building or if you have a security job or something like that at a building, you can just test this, right?

14:24.980 --> 14:29.140
Go up to your FOB reader, unscrew the thing off the wall.

14:29.140 --> 14:34.300
And if you don't receive a call from your security center, your tamper wire is not hooked up.

14:34.640 --> 14:44.760
You can work with security companies, you can just, you know, come to talks like this, you can come to the physical security village and we will be more than happy to show you what those tamper wires do and how they're hooked up.

14:45.640 --> 14:58.820
But yeah, so basically there's more to RFID access control than what people seem to see on an initial look.

14:58.820 --> 15:01.700
So that's kind of why we do this talk.

15:02.140 --> 15:03.700
Also, it's fun to play around with.

15:03.920 --> 15:07.120
All right, with that being said, oh, there we go, yeah.

15:07.440 --> 15:14.540
If anyone has any questions, please ask us now or you can find us at the village afterwards.

15:15.240 --> 15:20.780
Oh, also, we didn't talk much about the Proxmark, but if you are interested in getting a Proxmark, you can buy it from Dangerous Things.

15:20.780 --> 15:23.200
Not affiliated, not sponsored, anything like that.

15:24.400 --> 15:26.520
Oh, yeah, Hacker Warehouse here has them.

15:26.520 --> 15:29.040
Again, not affiliated, not sponsored.

15:29.780 --> 15:38.880
And you can go to proxmarkbuilds.org to get the good firmware written by Iceman.

15:38.880 --> 15:49.240
And he also has a channel on YouTube if you want to learn more about how to play around with RFID, not just using the flipper, but using more research-oriented tools.

15:50.980 --> 15:52.860
Oh, also, yeah, we sell those, sorry.

15:52.920 --> 15:54.480
Yes, I just want to plug our store.

15:54.480 --> 15:56.960
We're selling the tags, both high-frequency and low-frequency.

15:56.960 --> 16:00.640
If you need a spare hotel room key, that's where you go.

16:01.420 --> 16:03.520
Yeah, for the high-frequency ones, yeah.

16:04.780 --> 16:06.020
Yeah, any questions?

16:09.980 --> 16:11.260
Do we have a...

16:11.260 --> 16:13.360
Okay, I don't think we have a speaker...

16:13.360 --> 16:16.780
Sorry, a microphone for the audience, so you got to yell it out.

16:32.870 --> 16:43.150
Yeah, so the question was how easy it is to bypass tamper protections on the readers.

16:43.150 --> 16:48.470
And it usually depends on the manufacturing of the actual reader.

16:48.470 --> 17:17.350
So, we did trash their standard security RFID protocol earlier, but HID actually does a pretty decent job at building the readers, and it's kind of really difficult to get a tool in there to keep that tamper sensor from triggering, but it really depends on the reader.

17:17.350 --> 17:19.650
I would just play around with it, honestly.

17:20.090 --> 17:21.190
Another question?

17:27.480 --> 17:44.820
So, the question was, we said that if I have a long-range RFID reader, how does Blue Team defend against that?

17:46.220 --> 17:48.140
Two general ways.

17:48.140 --> 17:54.280
One is if you have... they make RFID-blocking badge holders.

17:58.380 --> 18:05.180
Also, yeah, there are RFID-blocking, you know, like, wallet stuff that you can use.

18:05.180 --> 18:10.500
So, yeah, this is an example, not sponsored, just a random manufacturer.

18:10.500 --> 18:11.600
Yeah, Amazon.

18:11.600 --> 18:13.320
Yeah, from Amazon, apparently.

18:14.020 --> 18:16.660
Honestly, any conductive block of thing will do.

18:16.660 --> 18:18.300
It'll drain that energy.

18:22.340 --> 18:29.480
Ideally, in conjunction with that, you can use systems that are not vulnerable to just being read by any random.

18:29.600 --> 18:39.320
So, for example, a lot of high-frequency protocols will require that handshake before any data is communicated.

18:39.320 --> 18:43.800
So, if the reader doesn't know the key, then you can't talk to each other.

18:43.940 --> 18:45.080
Any other questions?

19:05.110 --> 19:14.930
So, the question was, if the tamper wire is hooked up, you know, if the tamper system is set up correctly, what happens if someone tampers with the reader?

19:14.930 --> 19:16.370
Is that... yeah.

19:16.370 --> 19:19.850
So, honestly, it depends on the system.

19:19.850 --> 19:34.570
If you set it up so that you get a special notification, saying, because it's, you know, if someone just holds the door open or forces the door open or something like that, you're facing, you're obviously, if someone is actually tampering with the device,

19:34.570 --> 19:37.290
you're facing a more high-skill attacker.

19:37.290 --> 19:46.250
So, you might want to, you know, like work with your alarm company and make sure that you get a special notification or a special alarm condition for that.

19:46.250 --> 19:48.010
But it just depends on the system.

19:48.010 --> 19:49.350
Do you want to add to that?

19:49.490 --> 19:51.130
I just want to add to that.

19:51.990 --> 19:57.090
You know, if the alarm system is correctly installed, yes, you will get an alarm.

19:57.230 --> 20:15.010
However, alarm fatigue is a thing, and if you tamper with it and then set it off and leave, and they come around and look at it, and then you come and mess with it some more and leave, and they come and look at it, and then you leave and come back, they are going to stop checking and going to turn off that alarm.

20:15.230 --> 20:20.210
And you are then free to do your thing and, you know, red team it up.

20:20.270 --> 20:22.250
So, just wanted to add that.

20:23.350 --> 20:37.070
Yeah, I've, for obvious reasons, not going to go too much into details, but I have used an actual engagements where I would just show up, prop a door open, leave, show back up, prop a door open, leave again, and then eventually security stopped responding.

20:38.850 --> 20:39.570
Oh, okay.

20:39.570 --> 20:41.570
Yeah, I think that's our time.

20:41.570 --> 20:43.130
Yeah, okay, all right.

20:43.130 --> 20:44.370
Thank you so much for coming.

20:44.370 --> 20:54.390
If you have any other questions, please do shout to us by email or swing by the village to try out some of these and also some more physical hands-on stuff.

20:54.510 --> 20:55.150
Thanks.

