1 00:00:00,000 --> 00:00:03,300 Alright everyone, thank you so much for coming to the RFID talk. 2 00:00:03,600 --> 00: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, 3 00:00:25,460 --> 00:00:31,160 and then we're going to end with a quick demonstration on how to use the, uh, the Flipper Zero. 4 00:00:31,160 --> 00:00:33,700 I'm sure y'all are very familiar with that. 5 00:00:33,740 --> 00:00:36,300 Um, if not, we're going to introduce you to that as well. 6 00:00:36,360 --> 00:00:40,620 So, oh yeah, before that, introductions. 7 00:00:40,620 --> 00:00:41,480 My name is Ege. 8 00:00:41,480 --> 00:00:42,940 That's spelled like that. 9 00:00:42,940 --> 00:00:44,940 Uh, the top name that you see over there. 10 00:00:45,100 --> 00:00:48,320 Uh, we're from the physical security village. 11 00:00:48,320 --> 00: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. 12 00:00:59,180 --> 00: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. 13 00:01:07,040 --> 00:01:07,960 Thank you. 14 00:01:07,960 --> 00:01:09,220 I'm Andrew Marchment. 15 00:01:09,220 --> 00:01:11,000 I'm the second name on there. 16 00:01:11,000 --> 00:01:15,220 Uh, I work in the store of the physical security village in the vendor area. 17 00:01:15,320 --> 00: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. 18 00:01:24,080 --> 00:01:29,020 And we're also a partner with Covert Instruments to offer some of their inventory at our store. 19 00:01:29,020 --> 00: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. 20 00:01:35,960 --> 00:01:37,200 So come by later. 21 00:01:37,420 --> 00: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. 22 00:01:52,080 --> 00:01:54,600 So, uh, we'll get started. 23 00:01:55,140 --> 00:01:55,940 All right. 24 00:01:55,940 --> 00:01:58,680 So yeah, RFID, sorry about that false start there. 25 00:01:58,760 --> 00:02:00,580 Um , RFID, we see it all around us. 26 00:02:00,580 --> 00:02:05,600 Uh, we see it whenever we, uh, tap our, uh, key fob to get into our building at work. 27 00:02:05,600 --> 00: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. 28 00:02:17,460 --> 00:02:23,540 Um, but something that we don't necessarily always think about is how these darn things work. 29 00:02:23,700 --> 00:02:25,740 So you want to run us through it? 30 00:02:25,740 --> 00:02:26,180 Sure. 31 00:02:26,520 --> 00:02:27,320 All right. 32 00:02:27,320 --> 00:02:33,420 So it's basically a transformer that you're making when you bring your card up to a reader. 33 00:02:33,420 --> 00: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. 34 00:02:40,040 --> 00: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. 35 00:02:53,160 --> 00:03:01,760 And that powers a little chip in there that actually allows it to respond to the, um, reader with its ID. 36 00:03:02,800 --> 00:03:03,480 Yeah. 37 00:03:03,480 --> 00:03:10,800 So, um, this is kind of a simplified view of what the inside of one of those tags looks like. 38 00:03:12,480 --> 00:03:18,420 What it basically does, it, it is, it draws more or less current to send a one or a zero. 39 00:03:18,420 --> 00:03:19,720 There are other ways as well. 40 00:03:19,720 --> 00: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. 41 00:03:24,980 --> 00: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, 42 00:03:43,300 --> 00:03:44,480 drawing energy out of it. 43 00:03:44,740 --> 00:03:48,900 And that is, it's talking to the transmitter. 44 00:03:48,900 --> 00:03:56,280 So something obvious that you might realize is this is very easy to mess with. 45 00:03:56,280 --> 00: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. 46 00:04:06,220 --> 00:04:09,840 It's literally just a breadboard jumper wire that I looped around a bunch of times. 47 00:04:10,060 --> 00:04:15,640 And then I put that near the transmitter and the fob, and I was able to pick up that communication. 48 00:04:15,640 --> 00:04:19,820 There's no encryption because, you know, you can't encrypt physics. 49 00:04:19,820 --> 00:04:22,820 It's either, you know, more or less magnetic field. 50 00:04:23,140 --> 00:04:27,060 Um, and it's incredibly trivial to sniff. 51 00:04:27,060 --> 00:04:31,340 Something else is, again, because you can't encrypt physics. 52 00:04:31,420 --> 00:04:37,360 And the moment the tag sees the reader, it starts blaring out its ID number. 53 00:04:37,360 --> 00:04:40,820 As Andrew said, I can come around with my own reader. 54 00:04:40,820 --> 00:04:43,280 Maybe you might have seen this. 55 00:04:43,280 --> 00:04:47,560 Uh, this is a photo from Physical Security Village last year. 56 00:04:47,560 --> 00:04:49,120 We have a similar setup this year. 57 00:04:49,120 --> 00: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. 58 00:05:01,700 --> 00:05:08,060 Um, so, um, how can we solve this problem? 59 00:05:08,060 --> 00:05:09,760 Does anyone have any ideas? 60 00:05:11,980 --> 00:05:13,280 Shout them out. 61 00:05:16,360 --> 00: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. 62 00:05:23,980 --> 00:05:27,000 We solve it using encryption. 63 00:05:27,320 --> 00:05:31,200 So this is how an encrypted communication looks like. 64 00:05:32,400 --> 00:05:35,740 Before everything happens, there has to be a pre-shared key. 65 00:05:35,740 --> 00: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. 66 00:05:45,660 --> 00:05:50,940 And there's a challenge and response between the reader and the fob. 67 00:05:51,160 --> 00: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. 68 00:06:02,560 --> 00: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. 69 00:06:09,460 --> 00:06:12,260 I'm not loading the field communication that we saw earlier. 70 00:06:13,520 --> 00:06:21,120 And, uh, because of that and other, uh, bandwidth limitations, this is usually seen in high frequency. 71 00:06:21,120 --> 00:06:23,300 So 13.56 megahertz RFID. 72 00:06:24,300 --> 00:06:29,940 So this, at least in principle, seems pretty perfect, right? 73 00:06:29,940 --> 00: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. 74 00:06:41,220 --> 00:06:44,840 You know, like if, if there was a theoretical, you know where I'm going, right? 75 00:06:46,160 --> 00:06:47,740 This is what HID did. 76 00:06:49,040 --> 00: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. 77 00:07:10,560 --> 00:07:15,820 The re, uh, the authors of this paper did them a solid by not releasing the key. 78 00:07:15,820 --> 00: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. 79 00:07:25,960 --> 00: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. 80 00:07:39,040 --> 00: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. 81 00:07:57,120 --> 00:08:02,420 Um, what you, what happens if you don't do that is what Andrew's gonna show next. 82 00:08:02,700 --> 00:08:04,260 So yeah, with a demo. 83 00:08:04,260 --> 00:08:05,320 All right. 84 00:08:07,060 --> 00:08:08,320 Thank you. 85 00:08:08,320 --> 00:08:10,260 Let's get this set up. 86 00:08:10,340 --> 00:08:12,540 Here's everyone's favorite dolphins. 87 00:08:23,460 --> 00:08:28,900 All right, so this is the interface for the flipper zero, which is what I'm holding my hand here. 88 00:08:29,280 --> 00:08:33,280 And it has a lovely little interface here with some animations. 89 00:08:33,280 --> 00:08:39,960 And it's very convenient for copying your hotel room keys, so that you can share them with your friends. 90 00:08:40,160 --> 00:08:45,060 But I'm going to go into low frequency here because that's what the badges I'm holding are. 91 00:08:45,140 --> 00:08:48,420 And I'm going to read the orange badge. 92 00:08:50,320 --> 00:08:53,120 And we'll see if this is going to work for me. 93 00:08:53,660 --> 00:08:54,740 There we go. 94 00:08:54,740 --> 00:08:56,440 We have the orange badge. 95 00:08:56,440 --> 00: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. 96 00:09:12,480 --> 00:09:13,820 And there we go. 97 00:09:13,900 --> 00:09:19,500 So now, our blue badge has the same information as our orange badge, and will open the same doors. 98 00:09:20,060 --> 00:09:21,600 And it can be this simple. 99 00:09:25,480 --> 00:09:27,340 Yeah, just to show that it worked. 100 00:09:28,020 --> 00:09:33,660 Yeah, if we go to read again, and this time we wrote to the blue badge, or the blue fob. 101 00:09:33,660 --> 00:09:37,080 So if we read the blue fob, it's going to have the same information. 102 00:09:37,080 --> 00:09:42,360 So when we said, or when Andrew said, it's just saying its ID number, this is what we mean. 103 00:09:42,360 --> 00:09:48,380 So you see here, there's a facility code, so that's the 25 there, and a card number. 104 00:09:48,380 --> 00:09:51,140 So in this case, it's 15686, right? 105 00:09:51,980 --> 00:09:55,320 So this is just one of our... 106 00:09:57,220 --> 00:10:00,200 You don't have to write that down and try to figure out where I live. 107 00:10:01,720 --> 00:10:05,140 That's one of the test doors that we have at the village. 108 00:10:05,340 --> 00: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. 109 00:10:13,160 --> 00:10:14,120 So yeah, that's what we mean. 110 00:10:14,120 --> 00:10:17,800 It's literally just a 4-byte number. 111 00:10:18,900 --> 00: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... 112 00:10:27,540 --> 00:10:31,160 Does anyone want to say, just yell it out loud? 113 00:10:31,160 --> 00:10:34,320 Is 4-bytes a very large keyset? 114 00:10:34,860 --> 00:10:37,140 No, it's a tiny keyset. 115 00:10:37,340 --> 00:10:38,760 A keyspace, rather. 116 00:10:39,400 --> 00:10:41,780 So yeah, you can also brute force this. 117 00:10:42,720 --> 00:10:44,160 And... oh yeah, there we go. 118 00:10:44,160 --> 00:10:44,800 Yeah, Andrew has... 119 00:10:44,800 --> 00:10:47,080 Yeah, I've got the other firmware. 120 00:10:47,220 --> 00:10:48,040 Yes. 121 00:10:48,060 --> 00:10:49,880 So this is the HID Proc. 122 00:10:49,880 --> 00:10:53,880 So this will run through the entire dictionary for HID Proc's devices. 123 00:10:53,920 --> 00:10:56,740 Another common one is the EM4-100. 124 00:10:57,260 --> 00:11:04,220 And again, it's a very short dictionary, and you can run through this in about 15 to 30 seconds. 125 00:11:04,420 --> 00:11:07,800 Yeah, so the main thing that's limiting us here is... 126 00:11:08,360 --> 00:11:12,300 Again, remember, it's a very passive system, especially for low frequency. 127 00:11:12,300 --> 00:11:16,620 The reader has to ask us what our ID is, and then we can reply. 128 00:11:16,620 --> 00:11:20,040 So we're limited by the number of times the reader is willing to ask us. 129 00:11:20,040 --> 00:11:22,800 But that's usually either 1 or 2 per second. 130 00:11:23,100 --> 00: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, 131 00:11:37,940 --> 00: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. 132 00:11:56,140 --> 00: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. 133 00:12:08,940 --> 00:12:15,540 It sounds, it feels like we're not limited by the same things we are when it comes to keys. 134 00:12:15,540 --> 00: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. 135 00:12:24,680 --> 00: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. 136 00:12:33,740 --> 00: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? 137 00:12:42,640 --> 00:12:49,080 We should be treating our RFID cards the same way we treat keys. 138 00:12:49,080 --> 00:12:49,400 Yeah. 139 00:12:49,740 --> 00: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. 140 00:12:57,340 --> 00:12:58,420 Sorry, were you going to say something? 141 00:12:58,440 --> 00:13:01,440 Yes, I was going to say, treat it like any secret. 142 00:13:01,440 --> 00:13:07,720 So like your passwords or your door keys to your house, it's exactly the same thing. 143 00:13:07,720 --> 00:13:10,720 If you have the secret, you have access. 144 00:13:11,000 --> 00:13:16,120 So there needs to be a, you know, good maintenance of your secret. 145 00:13:16,120 --> 00:13:22,420 So if you have a building and you have employees who are terminated, you need to deactivate that card. 146 00:13:22,800 --> 00: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. 147 00:13:34,740 --> 00: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. 148 00:13:49,100 --> 00: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. 149 00:14:09,660 --> 00:14:14,940 Yeah, so just to sum up what Andrew said there, hook up your darn tamper wires. 150 00:14:14,940 --> 00: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? 151 00:14:24,980 --> 00:14:29,140 Go up to your FOB reader, unscrew the thing off the wall. 152 00:14:29,140 --> 00:14:34,300 And if you don't receive a call from your security center, your tamper wire is not hooked up. 153 00:14:34,640 --> 00: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. 154 00:14:45,640 --> 00:14:58,820 But yeah, so basically there's more to RFID access control than what people seem to see on an initial look. 155 00:14:58,820 --> 00:15:01,700 So that's kind of why we do this talk. 156 00:15:02,140 --> 00:15:03,700 Also, it's fun to play around with. 157 00:15:03,920 --> 00:15:07,120 All right, with that being said, oh, there we go, yeah. 158 00:15:07,440 --> 00:15:14,540 If anyone has any questions, please ask us now or you can find us at the village afterwards. 159 00:15:15,240 --> 00: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. 160 00:15:20,780 --> 00:15:23,200 Not affiliated, not sponsored, anything like that. 161 00:15:24,400 --> 00:15:26,520 Oh, yeah, Hacker Warehouse here has them. 162 00:15:26,520 --> 00:15:29,040 Again, not affiliated, not sponsored. 163 00:15:29,780 --> 00:15:38,880 And you can go to proxmarkbuilds.org to get the good firmware written by Iceman. 164 00:15:38,880 --> 00: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. 165 00:15:50,980 --> 00:15:52,860 Oh, also, yeah, we sell those, sorry. 166 00:15:52,920 --> 00:15:54,480 Yes, I just want to plug our store. 167 00:15:54,480 --> 00:15:56,960 We're selling the tags, both high-frequency and low-frequency. 168 00:15:56,960 --> 00:16:00,640 If you need a spare hotel room key, that's where you go. 169 00:16:01,420 --> 00:16:03,520 Yeah, for the high-frequency ones, yeah. 170 00:16:04,780 --> 00:16:06,020 Yeah, any questions? 171 00:16:09,980 --> 00:16:11,260 Do we have a... 172 00:16:11,260 --> 00:16:13,360 Okay, I don't think we have a speaker... 173 00:16:13,360 --> 00:16:16,780 Sorry, a microphone for the audience, so you got to yell it out. 174 00:16:32,870 --> 00:16:43,150 Yeah, so the question was how easy it is to bypass tamper protections on the readers. 175 00:16:43,150 --> 00:16:48,470 And it usually depends on the manufacturing of the actual reader. 176 00:16:48,470 --> 00: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. 177 00:17:17,350 --> 00:17:19,650 I would just play around with it, honestly. 178 00:17:20,090 --> 00:17:21,190 Another question? 179 00:17:27,480 --> 00: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? 180 00:17:46,220 --> 00:17:48,140 Two general ways. 181 00:17:48,140 --> 00:17:54,280 One is if you have... they make RFID-blocking badge holders. 182 00:17:58,380 --> 00:18:05,180 Also, yeah, there are RFID-blocking, you know, like, wallet stuff that you can use. 183 00:18:05,180 --> 00:18:10,500 So, yeah, this is an example, not sponsored, just a random manufacturer. 184 00:18:10,500 --> 00:18:11,600 Yeah, Amazon. 185 00:18:11,600 --> 00:18:13,320 Yeah, from Amazon, apparently. 186 00:18:14,020 --> 00:18:16,660 Honestly, any conductive block of thing will do. 187 00:18:16,660 --> 00:18:18,300 It'll drain that energy. 188 00:18:22,340 --> 00:18:29,480 Ideally, in conjunction with that, you can use systems that are not vulnerable to just being read by any random. 189 00:18:29,600 --> 00:18:39,320 So, for example, a lot of high-frequency protocols will require that handshake before any data is communicated. 190 00:18:39,320 --> 00:18:43,800 So, if the reader doesn't know the key, then you can't talk to each other. 191 00:18:43,940 --> 00:18:45,080 Any other questions? 192 00:19:05,110 --> 00: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? 193 00:19:14,930 --> 00:19:16,370 Is that... yeah. 194 00:19:16,370 --> 00:19:19,850 So, honestly, it depends on the system. 195 00:19:19,850 --> 00: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, 196 00:19:34,570 --> 00:19:37,290 you're facing a more high-skill attacker. 197 00:19:37,290 --> 00: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. 198 00:19:46,250 --> 00:19:48,010 But it just depends on the system. 199 00:19:48,010 --> 00:19:49,350 Do you want to add to that? 200 00:19:49,490 --> 00:19:51,130 I just want to add to that. 201 00:19:51,990 --> 00:19:57,090 You know, if the alarm system is correctly installed, yes, you will get an alarm. 202 00:19:57,230 --> 00: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. 203 00:20:15,230 --> 00:20:20,210 And you are then free to do your thing and, you know, red team it up. 204 00:20:20,270 --> 00:20:22,250 So, just wanted to add that. 205 00:20:23,350 --> 00: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. 206 00:20:38,850 --> 00:20:39,570 Oh, okay. 207 00:20:39,570 --> 00:20:41,570 Yeah, I think that's our time. 208 00:20:41,570 --> 00:20:43,130 Yeah, okay, all right. 209 00:20:43,130 --> 00:20:44,370 Thank you so much for coming. 210 00:20:44,370 --> 00: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. 211 00:20:54,510 --> 00:20:55,150 Thanks.