start	end	text
0	3300	Alright everyone, thank you so much for coming to the RFID talk.
3600	6560	This is going to be a quick introduction to how RFID works
7600	12640	and what you can do to, you know, play around with it, have a little fun,
12640	22580	and hopefully we will end with some suggestions on how we can make RFID a little bit safer
22580	27620	and what the common problems are, and then we're going to end with a quick demonstration
27620	33700	on how to use the, uh, the Flipper Zero. I'm sure y'all are very familiar with that.
33740	36300	Um, if not, we're going to introduce you to that as well.
36360	41480	So, oh yeah, before that, introductions. My name is Ege.
41480	44940	That's spelled like that. Uh, the top name that you see over there.
45100	49960	Uh, we're from the physical security village. Uh, if you see, like what you see here
49960	56620	and would like to see more of the physical side of, uh, like physical security side of Defcon,
56620	61620	please be sure to come by the village. Uh, it's going to be in the map and also we're going to be,
61620	66320	you can just walk around and look for people wearing weirdly green shirts.
67040	71000	Thank you. I'm Andrew Marchment. I'm the second name on there.
71000	75220	Uh, I work in the store of the physical security village in the vendor area.
75320	80660	Uh, we've very happy to have partnered with, uh, uh, the Keyport, uh, guys this year
80660	84080	to offer a discount for people buying Keyport key organizers.
84080	89020	And we're also a partner with Covert Instruments to offer some of their inventory at our store.
89020	94160	So if you've seen them lock picking lawyer or McNally and you want some of those tools,
94160	97200	uh, we are retailing them at our store. So come by later.
97420	102020	Um, my background is in satellite telecom, so I'm more of a high frequency RF guy,
102020	109720	but, uh, I'm doing this talk today on, uh, how to use the, uh, flipper zero and other RFID cloning tools
109720	114600	and, and how RFID works. So, uh, we'll get started.
115140	118680	All right. So yeah, RFID, sorry about that false start there.
118760	125600	Um, RFID, we see it all around us. Uh, we see it whenever we, uh, tap our, uh, key fob to get into our building at work.
125600	130320	We, when we tap our badge, whenever we go on transit and we use one of those contactless cards,
130320	137460	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.
137460	143540	Um, but something that we don't necessarily always think about is how these darn things work.
143700	145740	So you want to run us through it?
145740	153420	Sure. All right. So it's basically a transformer that you're making when you bring your card up to a reader.
153420	160040	So the reader has a coil of wire and we're passing an electrical current through that, uh, coil at all times.
160040	173080	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.
173160	181760	And that powers a little chip in there that actually allows it to respond to the, um, reader with its ID.
182800	190800	Yeah. So, um, this is kind of a simplified view of what the inside of one of those tags looks like.
192480	198420	What it basically does, it, it is, it draws more or less current to send a one or a zero.
198420	204980	There are other ways as well. It gets a little bit more complicated, but on the very basic end of it, this is what it looks like inside.
204980	224480	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, drawing energy out of it.
224740	228900	And that is, it's talking to the transmitter.
228900	236280	So something obvious that you might realize is this is very easy to mess with.
236280	246220	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.
246220	249840	It's literally just a breadboard jumper wire that I looped around a bunch of times.
250060	255640	And then I put that near the transmitter and the fob, and I was able to pick up that communication.
255640	259820	There's no encryption because, you know, you can't encrypt physics.
259820	262820	It's either, you know, more or less magnetic field.
263140	267060	Um, and it's incredibly trivial to sniff.
267060	271340	Something else is, again, because you can't encrypt physics.
271420	277360	And the moment the tag sees the reader, it starts blaring out its ID number.
277360	280820	As Andrew said, I can come around with my own reader.
280820	283280	Maybe you might have seen this.
283280	287560	Uh, this is a photo from Physical Security Village last year.
287560	289120	We have a similar setup this year.
289120	301620	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.
301700	308060	Um, so, um, how can we solve this problem?
308060	309760	Does anyone have any ideas?
311980	313280	Shout them out.
316360	323980	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.
323980	327000	We solve it using encryption.
327320	331200	So this is how an encrypted communication looks like.
332400	335740	Before everything happens, there has to be a pre-shared key.
335740	345120	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.
345660	350940	And there's a challenge and response between the reader and the fob.
351160	362560	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.
362560	369460	But this encryption, uh, this communication is obviously a little bit more complicated than just the raw, okay, I'm loading the field.
369460	372260	I'm not loading the field communication that we saw earlier.
373520	381120	And, uh, because of that and other, uh, bandwidth limitations, this is usually seen in high frequency.
381120	383300	So 13.56 megahertz RFID.
384300	389940	So this, at least in principle, seems pretty perfect, right?
389940	400840	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.
401220	404840	You know, like if, if there was a theoretical, you know where I'm going, right?
406160	407740	This is what HID did.
409040	429020	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.
430560	435820	The re, uh, the authors of this paper did them a solid by not releasing the key.
435820	443320	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.
445960	459040	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.
459040	477120	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.
477120	482420	Um, what you, what happens if you don't do that is what Andrew's gonna show next.
482700	484260	So yeah, with a demo.
484260	485320	All right.
487060	488320	Thank you.
488320	490260	Let's get this set up.
490340	492540	Here's everyone's favorite dolphins.
503460	513280	All right, so this is the interface for the flipper zero, which is what I'm holding my hand here. And it has a lovely little interface here with some animations.
513280	519960	And it's very convenient for copying your hotel room keys, so that you can share them with your friends.
520160	525060	But I'm going to go into low frequency here because that's what the badges I'm holding are.
525140	528420	And I'm going to read the orange badge.
530320	533120	And we'll see if this is going to work for me.
533660	536440	There we go. We have the orange badge.
536440	547580	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.
552480	559500	And there we go. So now, our blue badge has the same information as our orange badge, and will open the same doors.
560060	561600	And it can be this simple.
565480	567340	Yeah, just to show that it worked.
568020	573660	Yeah, if we go to read again, and this time we wrote to the blue badge, or the blue fob.
573660	577080	So if we read the blue fob, it's going to have the same information.
577080	582360	So when we said, or when Andrew said, it's just saying its ID number, this is what we mean.
582360	588380	So you see here, there's a facility code, so that's the 25 there, and a card number.
588380	591140	So in this case, it's 15686, right?
591980	595320	So this is just one of our...
597220	600200	You don't have to write that down and try to figure out where I live.
601720	605140	That's one of the test doors that we have at the village.
605340	612880	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.
613160	617800	So yeah, that's what we mean. It's literally just a 4-byte number.
618900	625800	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...
627540	631160	Does anyone want to say, just yell it out loud?
631160	634320	Is 4-bytes a very large keyset?
634860	637140	No, it's a tiny keyset.
637340	638760	A keyspace, rather.
639400	641780	So yeah, you can also brute force this.
642720	644800	And... oh yeah, there we go. Yeah, Andrew has...
644800	647080	Yeah, I've got the other firmware.
647220	648040	Yes.
648060	653880	So this is the HID Proc. So this will run through the entire dictionary for HID Proc's devices.
653920	656740	Another common one is the EM4-100.
657260	664220	And again, it's a very short dictionary, and you can run through this in about 15 to 30 seconds.
664420	667800	Yeah, so the main thing that's limiting us here is...
668360	672300	Again, remember, it's a very passive system, especially for low frequency.
672300	676620	The reader has to ask us what our ID is, and then we can reply.
676620	680040	So we're limited by the number of times the reader is willing to ask us.
680040	682800	But that's usually either 1 or 2 per second.
683100	686680	So even though that sounds like, you know, 0.5 Hz or 1 Hz,
686680	691440	sounds like a very low speed attack, or like a very limited,
691440	694480	because if you were trying to break a hash, that would be basically impossible,
694480	696300	but because it's just 4-bytes,
696860	700100	if you can just, like, you know, leave something on there, maybe overnight,
701060	707340	you know, like after work hours, you just go, put your device on the reader,
707340	709560	you'll leave for a couple hours, you come back, you pick it up,
709560	715640	and it'll give you what the correct code is.
716140	721260	So with kind of a conclusion to this is,
722320	725360	when we tap our cards, when we tap our badges,
725360	728940	or when we, you know, tap to pay, it all seems very magical.
728940	735540	It sounds, it feels like we're not limited by the same things we are when it comes to keys.
735540	739320	You know, like we, a lot of people talk about how if you take a photo of a key,
739320	744560	you can duplicate it, if you take, if you leave your key, it can be measured, decoded.
744680	749860	And it feels like whenever we're using RFID cards or, you know, key fobs, badges,
749860	753440	they feel like they are somehow magically more secure.
753740	758640	And in some cases, for specific use cases it is,
758640	762640	but it's good to remember that it's not a silver bullet, right?
762640	769080	We should be treating our RFID cards the same way we treat keys.
769080	769400	Yeah.
769740	777340	So if we lose a fob, we should do the exact same things that we would do if we were to lose a key.
777340	778420	Sorry, were you going to say something?
778440	781440	Yes, I was going to say, treat it like any secret.
781440	787720	So like your passwords or your door keys to your house, it's exactly the same thing.
787720	790720	If you have the secret, you have access.
791000	796120	So there needs to be a, you know, good maintenance of your secret.
796120	802420	So if you have a building and you have employees who are terminated, you need to deactivate that card.
802800	806880	If you have a building that is using an HID card system,
806880	814740	you need to upgrade that to one that does a proper job encrypting the secret when it transmits it.
814740	821200	Wygand has, you know, and other formats after the reader,
821200	829000	transmit the secret unencrypted over the wires to the central server, which controls the building access system.
829100	837760	So again, even if it's a proper four-way shake between the reader and the badge,
837760	843520	someone can tamper with one of the readers and actually tap the wires and intercept the secret there
843520	848600	and replay it at will to gain access later.
849660	854940	Yeah, so just to sum up what Andrew said there, hook up your darn tamper wires.
854940	862440	If you own a building or if you have a security job or something like that at a building,
862440	864820	you can just test this, right?
864980	869140	Go up to your FOB reader, unscrew the thing off the wall.
869140	874300	And if you don't receive a call from your security center, your tamper wire is not hooked up.
874640	879040	You can work with security companies, you can just, you know, come to talks like this,
879040	883300	you can come to the physical security village and we will be more than happy to show you what those tamper wires do
883300	884760	and how they're hooked up.
885640	898820	But yeah, so basically there's more to RFID access control than what people seem to see on an initial look.
898820	901700	So that's kind of why we do this talk.
902140	903700	Also, it's fun to play around with.
903920	907120	All right, with that being said, oh, there we go, yeah.
907440	914540	If anyone has any questions, please ask us now or you can find us at the village afterwards.
915240	919500	Oh, also, we didn't talk much about the Proxmark, but if you are interested in getting a Proxmark,
919500	920780	you can buy it from Dangerous Things.
920780	923200	Not affiliated, not sponsored, anything like that.
924400	926520	Oh, yeah, Hacker Warehouse here has them.
926520	929040	Again, not affiliated, not sponsored.
929780	938880	And you can go to proxmarkbuilds.org to get the good firmware written by Iceman.
938880	944200	And he also has a channel on YouTube if you want to learn more about how to play around with RFID,
944200	949240	not just using the flipper, but using more research-oriented tools.
950980	952860	Oh, also, yeah, we sell those, sorry.
952920	954480	Yes, I just want to plug our store.
954480	956960	We're selling the tags, both high-frequency and low-frequency.
956960	960640	If you need a spare hotel room key, that's where you go.
961420	963520	Yeah, for the high-frequency ones, yeah.
964780	966020	Yeah, any questions?
969980	971260	Do we have a...
971260	973360	Okay, I don't think we have a speaker...
973360	976780	Sorry, a microphone for the audience, so you got to yell it out.
992870	1003150	Yeah, so the question was how easy it is to bypass tamper protections on the readers.
1003150	1008470	And it usually depends on the manufacturing of the actual reader.
1008470	1026550	So, we did trash their standard security RFID protocol earlier, but HID actually does a pretty decent job at building the readers,
1026550	1037350	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.
1037350	1039650	I would just play around with it, honestly.
1040090	1041190	Another question?
1047480	1064820	So, the question was, we said that if I have a long-range RFID reader, how does Blue Team defend against that?
1066220	1074280	Two general ways. One is if you have... they make RFID-blocking badge holders.
1078380	1085180	Also, yeah, there are RFID-blocking, you know, like, wallet stuff that you can use.
1085180	1090500	So, yeah, this is an example, not sponsored, just a random manufacturer.
1090500	1091600	Yeah, Amazon.
1091600	1093320	Yeah, from Amazon, apparently.
1094020	1098300	Honestly, any conductive block of thing will do. It'll drain that energy.
1102340	1109480	Ideally, in conjunction with that, you can use systems that are not vulnerable to just being read by any random.
1109600	1119320	So, for example, a lot of high-frequency protocols will require that handshake before any data is communicated.
1119320	1123800	So, if the reader doesn't know the key, then you can't talk to each other.
1123940	1125080	Any other questions?
1145110	1152850	So, the question was, if the tamper wire is hooked up, you know, if the tamper system is set up correctly,
1152850	1154930	what happens if someone tampers with the reader?
1154930	1156370	Is that... yeah.
1156370	1159850	So, honestly, it depends on the system.
1159850	1167170	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
1167170	1174570	or forces the door open or something like that, you're facing, you're obviously, if someone is actually tampering with the device,
1174570	1177290	you're facing a more high-skill attacker.
1177290	1184370	So, you might want to, you know, like work with your alarm company and make sure that you get a special notification
1184370	1186250	or a special alarm condition for that.
1186250	1188010	But it just depends on the system.
1188010	1189350	Do you want to add to that?
1189490	1191130	I just want to add to that.
1191990	1197090	You know, if the alarm system is correctly installed, yes, you will get an alarm.
1197230	1203270	However, alarm fatigue is a thing, and if you tamper with it and then set it off and leave,
1203270	1207250	and they come around and look at it, and then you come and mess with it some more and leave,
1207250	1211650	and they come and look at it, and then you leave and come back,
1211650	1215010	they are going to stop checking and going to turn off that alarm.
1215230	1220210	And you are then free to do your thing and, you know, red team it up.
1220270	1222250	So, just wanted to add that.
1223350	1226630	Yeah, I've, for obvious reasons, not going to go too much into details,
1226630	1232090	but I have used an actual engagements where I would just show up, prop a door open, leave,
1232090	1237070	show back up, prop a door open, leave again, and then eventually security stopped responding.
1238850	1241570	Oh, okay. Yeah, I think that's our time.
1241570	1244370	Yeah, okay, all right. Thank you so much for coming.
1244370	1249290	If you have any other questions, please do shout to us by email or swing by the village
1250230	1255150	to try out some of these and also some more physical hands-on stuff. Thanks.
