Alright everyone, thank you so much for coming to the RFID talk. 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, and then we're going to end with a quick demonstration on how to use the, uh, the Flipper Zero. I'm sure y'all are very familiar with that. Um, if not, we're going to introduce you to that as well. So, oh yeah, before that, introductions. My name is Ege. That's spelled like that. Uh, the top name that you see over there. Uh, we're from the physical security village. 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. 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. Thank you. I'm Andrew Marchment. I'm the second name on there. Uh, I work in the store of the physical security village in the vendor area. 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. And we're also a partner with Covert Instruments to offer some of their inventory at our store. 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. So come by later. 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. So, uh, we'll get started. All right. So yeah, RFID, sorry about that false start there. 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. 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. Um, but something that we don't necessarily always think about is how these darn things work. So you want to run us through it? Sure. All right. So it's basically a transformer that you're making when you bring your card up to a reader. So the reader has a coil of wire and we're passing an electrical current through that, uh, coil at all times. 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. And that powers a little chip in there that actually allows it to respond to the, um, reader with its ID. Yeah. So, um, this is kind of a simplified view of what the inside of one of those tags looks like. What it basically does, it, it is, it draws more or less current to send a one or a zero. 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. 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. And that is, it's talking to the transmitter. So something obvious that you might realize is this is very easy to mess with. 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. It's literally just a breadboard jumper wire that I looped around a bunch of times. And then I put that near the transmitter and the fob, and I was able to pick up that communication. There's no encryption because, you know, you can't encrypt physics. It's either, you know, more or less magnetic field. Um, and it's incredibly trivial to sniff. Something else is, again, because you can't encrypt physics. And the moment the tag sees the reader, it starts blaring out its ID number. As Andrew said, I can come around with my own reader. Maybe you might have seen this. Uh, this is a photo from Physical Security Village last year. We have a similar setup this year. 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. Um, so, um, how can we solve this problem? Does anyone have any ideas? Shout them out. 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. We solve it using encryption. So this is how an encrypted communication looks like. Before everything happens, there has to be a pre-shared key. 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. And there's a challenge and response between the reader and the fob. 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. But this encryption, uh, this communication is obviously a little bit more complicated than just the raw, okay, I'm loading the field. I'm not loading the field communication that we saw earlier. And, uh, because of that and other, uh, bandwidth limitations, this is usually seen in high frequency. So 13.56 megahertz RFID. So this, at least in principle, seems pretty perfect, right? 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. You know, like if, if there was a theoretical, you know where I'm going, right? This is what HID did. 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. The re, uh, the authors of this paper did them a solid by not releasing the key. 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. 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. 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. Um, what you, what happens if you don't do that is what Andrew's gonna show next. So yeah, with a demo. All right. Thank you. Let's get this set up. Here's everyone's favorite dolphins. 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. And it's very convenient for copying your hotel room keys, so that you can share them with your friends. But I'm going to go into low frequency here because that's what the badges I'm holding are. And I'm going to read the orange badge. And we'll see if this is going to work for me. There we go. We have the orange badge. 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. And there we go. So now, our blue badge has the same information as our orange badge, and will open the same doors. And it can be this simple. Yeah, just to show that it worked. Yeah, if we go to read again, and this time we wrote to the blue badge, or the blue fob. So if we read the blue fob, it's going to have the same information. So when we said, or when Andrew said, it's just saying its ID number, this is what we mean. So you see here, there's a facility code, so that's the 25 there, and a card number. So in this case, it's 15686, right? So this is just one of our... You don't have to write that down and try to figure out where I live. That's one of the test doors that we have at the village. 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. So yeah, that's what we mean. It's literally just a 4-byte number. 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... Does anyone want to say, just yell it out loud? Is 4-bytes a very large keyset? No, it's a tiny keyset. A keyspace, rather. So yeah, you can also brute force this. And... oh yeah, there we go. Yeah, Andrew has... Yeah, I've got the other firmware. Yes. So this is the HID Proc. So this will run through the entire dictionary for HID Proc's devices. Another common one is the EM4-100. And again, it's a very short dictionary, and you can run through this in about 15 to 30 seconds. Yeah, so the main thing that's limiting us here is... Again, remember, it's a very passive system, especially for low frequency. The reader has to ask us what our ID is, and then we can reply. So we're limited by the number of times the reader is willing to ask us. But that's usually either 1 or 2 per second. 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, 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. 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. It sounds, it feels like we're not limited by the same things we are when it comes to keys. 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. 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. And in some cases, for specific use cases it is, but it's good to remember that it's not a silver bullet, right? We should be treating our RFID cards the same way we treat keys. Yeah. So if we lose a fob, we should do the exact same things that we would do if we were to lose a key. Sorry, were you going to say something? Yes, I was going to say, treat it like any secret. So like your passwords or your door keys to your house, it's exactly the same thing. If you have the secret, you have access. So there needs to be a, you know, good maintenance of your secret. So if you have a building and you have employees who are terminated, you need to deactivate that card. 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. 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. 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. Yeah, so just to sum up what Andrew said there, hook up your darn tamper wires. 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? Go up to your FOB reader, unscrew the thing off the wall. And if you don't receive a call from your security center, your tamper wire is not hooked up. 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. But yeah, so basically there's more to RFID access control than what people seem to see on an initial look. So that's kind of why we do this talk. Also, it's fun to play around with. All right, with that being said, oh, there we go, yeah. If anyone has any questions, please ask us now or you can find us at the village afterwards. 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. Not affiliated, not sponsored, anything like that. Oh, yeah, Hacker Warehouse here has them. Again, not affiliated, not sponsored. And you can go to proxmarkbuilds.org to get the good firmware written by Iceman. 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. Oh, also, yeah, we sell those, sorry. Yes, I just want to plug our store. We're selling the tags, both high-frequency and low-frequency. If you need a spare hotel room key, that's where you go. Yeah, for the high-frequency ones, yeah. Yeah, any questions? Do we have a... Okay, I don't think we have a speaker... Sorry, a microphone for the audience, so you got to yell it out. Yeah, so the question was how easy it is to bypass tamper protections on the readers. And it usually depends on the manufacturing of the actual reader. 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. I would just play around with it, honestly. Another question? So, the question was, we said that if I have a long-range RFID reader, how does Blue Team defend against that? Two general ways. One is if you have... they make RFID-blocking badge holders. Also, yeah, there are RFID-blocking, you know, like, wallet stuff that you can use. So, yeah, this is an example, not sponsored, just a random manufacturer. Yeah, Amazon. Yeah, from Amazon, apparently. Honestly, any conductive block of thing will do. It'll drain that energy. Ideally, in conjunction with that, you can use systems that are not vulnerable to just being read by any random. So, for example, a lot of high-frequency protocols will require that handshake before any data is communicated. So, if the reader doesn't know the key, then you can't talk to each other. Any other questions? 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? Is that... yeah. So, honestly, it depends on the system. 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, you're facing a more high-skill attacker. 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. But it just depends on the system. Do you want to add to that? I just want to add to that. You know, if the alarm system is correctly installed, yes, you will get an alarm. 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. And you are then free to do your thing and, you know, red team it up. So, just wanted to add that. 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. Oh, okay. Yeah, I think that's our time. Yeah, okay, all right. Thank you so much for coming. 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. Thanks.