1 00:00:00,000 --> 00:00:02,160 All right, let's kick this thing off. 2 00:00:02,160 --> 00: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. 3 00:00:09,680 --> 00:00:13,840 So thank you for reading the old paper version and showing up. 4 00:00:13,880 --> 00:00:16,280 Today we're going to learn how to break into buildings. 5 00:00:16,480 --> 00:00:17,720 Plain and clear. 6 00:00:17,940 --> 00:00:20,080 Why do I like breaking into buildings? 7 00:00:20,080 --> 00: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. 8 00:00:28,300 --> 00: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. 9 00:00:39,000 --> 00:00:47,020 So let's go back through the history and see all the different ways you can break into buildings with laptops. 10 00:00:47,160 --> 00:00:49,480 So first we'll go over access control one-on-one. 11 00:00:49,480 --> 00:00:51,440 I'll just explain how these systems work. 12 00:00:51,440 --> 00:00:52,720 That's step one. 13 00:00:52,760 --> 00:00:53,900 What a smart card is. 14 00:00:53,900 --> 00:00:56,160 This is actually a pretty overloaded word. 15 00:00:56,680 --> 00:01:01,340 Everything looks like a smart card is just a piece of plastic with some microcontrollers in it. 16 00:01:01,400 --> 00:01:04,860 And then I'll go over all of the attacks that we've seen come out over the last couple decades. 17 00:01:05,160 --> 00:01:09,000 And then some food for thought on what the future might look like. 18 00:01:09,700 --> 00:01:14,520 So if you look at a typical access control system, there's only a couple of components. 19 00:01:14,520 --> 00:01:17,560 This is the most complicated system you would ever see. 20 00:01:17,780 --> 00:01:20,240 On the left side you'll see that there's a door reader. 21 00:01:20,240 --> 00:01:23,160 This is the little box you tap your card to and it goes boop! 22 00:01:23,280 --> 00:01:26,580 And green or red or blue or whatever color it turns. 23 00:01:26,740 --> 00: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. 24 00:01:35,000 --> 00:01:39,240 So it's going to compare that number to some database and say, does this person have access? 25 00:01:39,240 --> 00:01:41,100 If it does, it opens the door. 26 00:01:41,280 --> 00: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. 27 00:01:49,520 --> 00:01:51,820 That electromagnet will hold the door shut. 28 00:01:51,980 --> 00: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. 29 00:02:05,200 --> 00:02:10,260 So in the event of a fire, you need a button that you can push to cut the power. 30 00:02:10,440 --> 00:02:13,820 This actually was not deployed well on the initial ones. 31 00:02:13,820 --> 00:02:15,180 A lot of people burned to death. 32 00:02:15,180 --> 00:02:17,500 So this is like fire marshal enforced now. 33 00:02:17,500 --> 00:02:23,700 Every door that has an electromagnetic lock will have a motion sensor and an exit button for egress. 34 00:02:23,840 --> 00:02:26,500 And by law, it has to be one motion. 35 00:02:26,640 --> 00:02:31,300 So if you hit the exit button, that needs to be all you do, or a big bar. 36 00:02:31,400 --> 00:02:36,640 So that comes into play quite a bit when you see some of the attacks and how to bypass these. 37 00:02:37,260 --> 00: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. 38 00:02:45,860 --> 00:02:47,840 There's just three relays. 39 00:02:48,080 --> 00:02:50,220 Ultimately, there's one that matters. 40 00:02:50,240 --> 00: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. 41 00:02:57,860 --> 00: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. 42 00:03:15,500 --> 00:03:18,460 Once it gets the other side, decision is made. 43 00:03:19,000 --> 00:03:21,680 The other two things are also just relays. 44 00:03:21,680 --> 00:03:25,500 The exit button, when you hit it, it's just going to cut the power. 45 00:03:25,620 --> 00:03:31,260 And the motion sensor, again, when you wave at it, it just touches a relay. 46 00:03:31,260 --> 00:03:33,840 These are either normally closed or normally open. 47 00:03:33,840 --> 00:03:36,840 If you get any of those relays to chip, the door will unlock. 48 00:03:37,360 --> 00:03:43,400 So let's look at some of the worst relay fails in honor of the Olympics. 49 00:03:43,420 --> 00:03:45,520 This is not a running relay we're talking about, though. 50 00:03:45,520 --> 00:03:47,240 This is an electronic relay. 51 00:03:47,320 --> 00: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. 52 00:03:54,620 --> 00: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. 53 00:04:01,560 --> 00:04:08,960 You get yourself a nice sturdy piece of metal, shove that thing through the door, and you just click that relay. 54 00:04:08,960 --> 00:04:10,300 Bang, you're in. 55 00:04:11,840 --> 00:04:14,240 We'll keep going up in complexity. 56 00:04:14,240 --> 00:04:18,240 This is probably the least advanced way to trip one of those relays. 57 00:04:18,780 --> 00:04:21,560 So I call this the hook key. 58 00:04:21,660 --> 00:04:24,400 There's also the magnet key. 59 00:04:24,420 --> 00:04:29,980 So if you're aware of the internal mechanics in a relay, it's just two pieces of metal like this. 60 00:04:29,980 --> 00:04:32,840 You touch them together, the connection is made. 61 00:04:32,840 --> 00:04:35,620 You separate them, the connection is not made. 62 00:04:35,760 --> 00:04:36,800 So some of these... 63 00:04:37,800 --> 00:04:40,500 this is the locksmith, uh, lock picking lawyer. 64 00:04:40,860 --> 00:04:43,360 You hit the pin pad, the door unlocks. 65 00:04:43,420 --> 00:04:49,520 You can literally take a magnet, touch it to where the relay is, and it just clicks the relay. 66 00:04:49,600 --> 00: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. 67 00:05:00,440 --> 00:05:02,060 So don't do that. 68 00:05:02,060 --> 00:05:07,200 When you install these systems, make sure the relay is on the inside of the building, not the outside. 69 00:05:07,300 --> 00:05:09,740 And then there's the motion sensor. 70 00:05:10,100 --> 00:05:14,880 So for obvious reasons, when there's motion, it's going to trigger. 71 00:05:14,960 --> 00: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. 72 00:05:25,660 --> 00:05:30,040 And you can just blow smoke through the crack and walk right through the door. 73 00:05:30,200 --> 00:05:37,840 So we'll call these the very unsophisticated, uninteresting, why the hell did I come to this talk hacks. 74 00:05:37,940 --> 00:05:41,760 There are much more fun ways to do this. 75 00:05:42,060 --> 00: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. 76 00:05:48,420 --> 00:05:50,080 There's also electric strikes. 77 00:05:50,080 --> 00: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. 78 00:05:56,900 --> 00:05:59,300 And then when you power it, it pulls the solenoid out. 79 00:05:59,300 --> 00:06:02,580 These are far better for various reasons. 80 00:06:02,580 --> 00:06:04,940 You can't get locked into your building and die. 81 00:06:04,940 --> 00:06:07,160 They're a little harder to trip. 82 00:06:07,160 --> 00:06:11,640 You can't vape into these and have them pull a solenoid up. 83 00:06:11,900 --> 00:06:16,760 So if you're given an option, you're installing these, anytime you can put an electric strike. 84 00:06:17,080 --> 00:06:20,180 So now let's look at smart cards. 85 00:06:21,160 --> 00:06:24,620 First, we need to answer the question, what do I mean by smart card? 86 00:06:24,620 --> 00:06:28,080 There's really, I think, three different forms you'll see. 87 00:06:28,120 --> 00:06:32,720 There's the ones that look like our credit cards that have these little pads on them. 88 00:06:32,720 --> 00:06:36,300 There's ones that are just pieces of plastic that do some RF stuff. 89 00:06:36,300 --> 00:06:39,040 And then there's ones with the mag stripe on the back. 90 00:06:39,840 --> 00:06:44,020 So these are all very, very different technologies. 91 00:06:44,020 --> 00: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. 92 00:06:54,520 --> 00:07:00,780 So if we look at a mag stripe, this one normally fascinates people. 93 00:07:00,780 --> 00: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. 94 00:07:08,480 --> 00:07:14,640 It is just a way to encode ASCII text effectively in a magnetic form. 95 00:07:14,640 --> 00:07:16,400 There is no security involved. 96 00:07:16,400 --> 00:07:17,660 There is no encryption. 97 00:07:17,660 --> 00:07:22,060 If you want to clone some mag stripe cards, we have them over in the physical security village. 98 00:07:22,060 --> 00: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. 99 00:07:28,200 --> 00:07:34,540 There is nothing interesting or sophisticated there other than some physics with like magnetic poles. 100 00:07:34,540 --> 00:07:36,840 Not smart at all. 101 00:07:37,540 --> 00:07:39,740 Then came the prox cards. 102 00:07:40,020 --> 00:07:43,960 These you literally just emanate radio waves at them. 103 00:07:43,960 --> 00:07:46,660 They can be passively powered, which is really cool. 104 00:07:46,660 --> 00:07:50,240 So the radio waves actually give them the power they need to power on. 105 00:07:50,240 --> 00:07:52,800 And then they respond with a number. 106 00:07:52,900 --> 00:07:56,480 You can actually hack these things with AM radios. 107 00:07:56,480 --> 00: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. 108 00:08:02,000 --> 00:08:03,620 They are not encrypted. 109 00:08:03,620 --> 00:08:08,060 There is nothing really interesting from a cryptography standpoint going on there. 110 00:08:08,180 --> 00:08:12,400 The only thing to figure out is how they encode the data that coming back. 111 00:08:12,400 --> 00:08:13,720 Is it amplitude shift keying? 112 00:08:13,720 --> 00:08:15,020 Is it phase shift keying? 113 00:08:15,020 --> 00:08:17,000 How are they encoding the radio frequency? 114 00:08:17,000 --> 00:08:20,180 But at the end of the day, it is just a number. 115 00:08:20,180 --> 00:08:25,700 And that number is typically printed on the card, just to add to the security of the whole situation. 116 00:08:25,840 --> 00:08:28,140 These were never intended as a high security thing. 117 00:08:28,140 --> 00: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. 118 00:08:39,000 --> 00:08:40,080 It's a bummer. 119 00:08:40,080 --> 00:08:42,720 Like I saw her come home first day of work, like why? 120 00:08:42,720 --> 00:08:43,960 Like I know where you work. 121 00:08:43,960 --> 00:08:44,900 Don't do that. 122 00:08:44,900 --> 00:08:46,740 You have sensitive stuff. 123 00:08:47,320 --> 00:08:53,160 So then came along the near field communication cards, NFC or high frequency cards. 124 00:08:53,240 --> 00:08:56,140 These run at 13.56 megahertz. 125 00:08:56,140 --> 00:08:58,520 These do have cryptography on them. 126 00:08:58,520 --> 00:09:02,780 The way to think of the cryptography on all of these is as a memory card. 127 00:09:02,780 --> 00:09:05,740 There is a symmetric key that is on the card. 128 00:09:05,740 --> 00:09:09,000 And if you have it, you can read and write to that card. 129 00:09:09,000 --> 00:09:10,740 And if you don't, you cannot. 130 00:09:10,960 --> 00:09:15,620 So there is one key that will let you read and write data from these cards. 131 00:09:15,940 --> 00:09:19,500 Otherwise, I colloquially call them dumb cards. 132 00:09:19,500 --> 00:09:21,240 They're not doing anything sophisticated. 133 00:09:21,280 --> 00:09:26,560 They're just memory cards, but they are better than the mag stripes and the prox cards. 134 00:09:27,480 --> 00:09:33,580 So there's going to be a shared key, which that screen still looks like it's on. 135 00:09:33,580 --> 00:09:36,260 So there's gonna be a key on the card and a key on the reader. 136 00:09:36,320 --> 00: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. 137 00:09:42,600 --> 00: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. 138 00:09:51,600 --> 00:09:56,400 Now we look at what is actually considered a smart card. 139 00:09:56,400 --> 00:10:03,120 So our credit cards that look like this with the little chip, these are actually little microprocessors. 140 00:10:03,160 --> 00:10:05,160 They're not microcontrollers. 141 00:10:05,160 --> 00:10:07,180 They actually run Java OS. 142 00:10:07,180 --> 00:10:08,660 They have a CPU. 143 00:10:08,660 --> 00:10:09,900 They have memory. 144 00:10:09,900 --> 00:10:11,740 They have non-volatile storage. 145 00:10:11,740 --> 00:10:14,760 They have, you know, dedicated crypto units. 146 00:10:14,760 --> 00:10:16,880 And they can do public key cryptography. 147 00:10:16,900 --> 00:10:24,480 So these are actually smart in the sense that we would hope they are and do proper security things. 148 00:10:25,460 --> 00:10:29,900 With the asymmetric encryption, this is much better than the symmetric key encryption. 149 00:10:29,900 --> 00: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. 150 00:10:42,300 --> 00: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. 151 00:10:53,240 --> 00:10:56,180 There's far more sophisticated stuff in there than I thought. 152 00:10:56,180 --> 00:10:57,660 And you can kind of see the overlap. 153 00:10:57,660 --> 00:11:00,060 You have contact cards that speak one protocol. 154 00:11:00,160 --> 00:11:01,980 You have contactless cards. 155 00:11:01,980 --> 00:11:05,640 And then you have the dual interface cards, which almost all credit cards are today. 156 00:11:05,640 --> 00:11:10,360 You can tap to pay or you can shove that thing into the credit card reader. 157 00:11:10,840 --> 00:11:14,120 And if you look at the specs, they have 1k mbit flash. 158 00:11:14,120 --> 00:11:17,820 There's an EEPROM that speaks I-squared seed and SPI. 159 00:11:17,820 --> 00:11:21,640 They have segmented memory with a 64k bit EEPROM. 160 00:11:22,320 --> 00:11:25,160 Pretty decent specs for a credit card. 161 00:11:28,080 --> 00:11:32,040 The way they work is if you look at those pads, only four matter. 162 00:11:32,040 --> 00:11:35,000 You have your power and your ground to power the little computer on. 163 00:11:35,000 --> 00:11:38,960 You drive the clock externally, which is interesting from a glitching perspective. 164 00:11:38,960 --> 00:11:42,000 So you control both the voltage and the clock. 165 00:11:42,160 --> 00:11:45,060 And then you just have a single pin for I-O. 166 00:11:45,060 --> 00:11:50,760 So as you're driving the clock, use that I-O to read and write commands and application data units. 167 00:11:51,000 --> 00:11:53,800 So APDUs, you're going to send commands. 168 00:11:53,800 --> 00:11:59,640 You can actually send admin commands and install Java applets and manipulate the operating system. 169 00:11:59,920 --> 00:12:05,020 Or unauthenticated commands that are just going to query this thing for a challenge response. 170 00:12:06,400 --> 00: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. 171 00:12:14,220 --> 00:12:21,020 So smart cards have always fascinated me because they actually do a very, very good job at physical attacks. 172 00:12:21,020 --> 00:12:25,760 So it's common that you would drop your credit card and somebody could pick it up, right? 173 00:12:25,760 --> 00:12:30,620 They can still go make payments, but actually extracting that key, cloning cards is a big deal. 174 00:12:30,740 --> 00: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. 175 00:12:41,480 --> 00: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. 176 00:12:49,560 --> 00:12:51,940 They also have to have brownout detection. 177 00:12:51,940 --> 00: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. 178 00:13:01,780 --> 00:13:05,600 So that means you're going to take it from your positive five volts to negative five volts. 179 00:13:05,640 --> 00: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. 180 00:13:15,300 --> 00:13:23,220 They also, because you're controlling power, clock, all of these things, you have to program the logic very specially. 181 00:13:23,520 --> 00:13:30,840 So one of these two statements on the right is correct in an embedded system standpoint. 182 00:13:30,840 --> 00:13:35,160 If you're writing this for a computer software, they're both probably fine. 183 00:13:35,220 --> 00:13:41,380 But this is the code to check the pin when I'm entering the pin to say unlock my debit card. 184 00:13:41,400 --> 00:13:46,860 Does anybody have an inkling of which one is better than the other? 185 00:13:53,750 --> 00:13:56,350 We think number two is better. 186 00:13:56,690 --> 00:13:57,390 Correct. 187 00:13:57,390 --> 00:13:59,430 Number two is better. 188 00:13:59,510 --> 00: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. 189 00:14:10,010 --> 00: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. 190 00:14:21,750 --> 00:14:25,070 Which means you could then brute force this with unlimited tries. 191 00:14:25,070 --> 00: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. 192 00:14:33,110 --> 00: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. 193 00:14:41,990 --> 00: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. 194 00:14:50,150 --> 00:14:54,990 So before we go break all these, why did we even build these in the first place? 195 00:14:55,110 --> 00:14:58,490 The real problem is that physical keys are one to one. 196 00:14:58,490 --> 00:15:00,430 There's one key that opens one door. 197 00:15:00,430 --> 00:15:04,650 If I want 1,000 people to open that one door, they all have the exact same key. 198 00:15:04,650 --> 00: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. 199 00:15:15,570 --> 00:15:18,330 So in enterprise, this sucks. 200 00:15:18,370 --> 00:15:19,990 Smart cards can be one to many. 201 00:15:19,990 --> 00:15:23,710 You can have many different credentials that get into the same door. 202 00:15:23,970 --> 00:15:27,410 It used to be really complicated to carry a full computer in your pocket. 203 00:15:27,410 --> 00:15:30,730 As you can see, modern smart cards are actually little mini computers. 204 00:15:30,730 --> 00:15:33,970 Our smartphones are really big, fast computers. 205 00:15:34,290 --> 00:15:36,030 And you can put a picture on them. 206 00:15:36,030 --> 00:15:38,530 This should not be ignored. 207 00:15:38,530 --> 00: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. 208 00:15:47,310 --> 00: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. 209 00:15:56,150 --> 00:15:57,830 Enough with all that fluffy stuff. 210 00:15:57,830 --> 00:15:58,870 Let's go through some exploits. 211 00:15:58,870 --> 00:16:00,070 That's why we're at DEF CON. 212 00:16:00,770 --> 00:16:06,010 So when you're doing a vulnerability assessment, you first want to ask yourself, what's the goal, right? 213 00:16:06,010 --> 00:16:07,750 What's the worst that can happen? 214 00:16:07,890 --> 00:16:10,730 So we could use a card without someone's permission. 215 00:16:10,910 --> 00:16:13,970 I could, you know, swipe it out of your back pocket. 216 00:16:14,270 --> 00:16:19,130 I can clone the smart card or I can subvert the need for it altogether. 217 00:16:19,210 --> 00:16:24,830 So we already saw at the beginning some of the ways that you can just completely ignore the card. 218 00:16:24,830 --> 00: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. 219 00:16:33,030 --> 00:16:38,610 And using the card without a person's permission is not particularly interesting because you're just stealing the card. 220 00:16:38,610 --> 00: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. 221 00:16:45,290 --> 00:16:48,750 We're going to specifically focus on cloning the smart cards. 222 00:16:49,770 --> 00: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. 223 00:17:05,030 --> 00:17:09,750 So there's going to be one, an authentication key, an in-transit key that lets you read and write data. 224 00:17:09,750 --> 00:17:13,630 And then you can also encrypt the data at rest on the card. 225 00:17:13,770 --> 00: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. 226 00:17:20,390 --> 00: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. 227 00:17:27,590 --> 00: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. 228 00:17:34,290 --> 00: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. 229 00:17:48,250 --> 00: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. 230 00:17:54,330 --> 00:18:00,530 Whatever the key is that lets me read and write data from the cards is game over for that security system. 231 00:18:00,530 --> 00:18:05,850 Because now I can walk up next to anybody and just outright clone employee IDs. 232 00:18:05,990 --> 00:18:11,430 And in the case that I also know the at-rest key, I can just fabricate whatever keys I want. 233 00:18:11,430 --> 00: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. 234 00:18:22,050 --> 00:18:24,990 So how are these attacks done? 235 00:18:24,990 --> 00:18:31,870 These are almost all exclusively physical attacks on the cards and their readers first. 236 00:18:32,150 --> 00:18:39,070 This one on the MyFairClassic, so this was the most prolific card early in the smart card era. 237 00:18:39,070 --> 00:18:45,950 This was used for everything, public transit, cash cards, so you'd actually store money in the value on the card. 238 00:18:46,150 --> 00:18:49,750 So breaking these was a really big deal in the research world. 239 00:18:49,790 --> 00:18:53,610 There were a couple professors at UVA that actually delidded the chip. 240 00:18:53,610 --> 00: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. 241 00:19:06,690 --> 00: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. 242 00:19:15,430 --> 00: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. 243 00:19:25,810 --> 00:19:27,930 Spoiler alert, yes, there was. 244 00:19:28,070 --> 00:19:31,770 MyFairClassic at this point is quite broken. 245 00:19:31,770 --> 00: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. 246 00:19:41,870 --> 00:19:45,690 I wasn't involved in the porting of it, but mostly a user of all these great tools. 247 00:19:45,690 --> 00:19:49,050 But this is what it looked like way back in the day in your terminal window. 248 00:19:49,050 --> 00:19:53,590 Now it's a very awesome, you know, handheld little device. 249 00:19:53,590 --> 00:19:57,350 But you can effectively brute force all of those keys, break the keys. 250 00:19:57,350 --> 00:19:59,850 Back to the beginning of the talk, once you have the key, it's game over. 251 00:19:59,850 --> 00:20:01,850 You tap any card you're reading and writing. 252 00:20:02,730 --> 00:20:04,490 You can again come over to our booth. 253 00:20:04,490 --> 00:20:10,530 There's still hotel key cards and public transit cards and things today that are still using MyFairClassic. 254 00:20:12,170 --> 00:20:17,290 So in the enterprise environment, there's HID dominated. 255 00:20:17,290 --> 00:20:22,970 They were by far the monopolist in, you know, enterprise access control. 256 00:20:23,030 --> 00:20:26,210 This thing on the left probably looks very familiar to most of you. 257 00:20:26,490 --> 00:20:28,470 They're all around this conference. 258 00:20:28,470 --> 00:20:32,690 You've seen them probably in tons of buildings, airports, financial institutions, whatever. 259 00:20:32,690 --> 00:20:34,790 Every elevator here has one of these. 260 00:20:35,670 --> 00:20:37,730 These use symmetric keys, right? 261 00:20:37,730 --> 00:20:41,010 So we go back to how would you deploy a system like this? 262 00:20:41,190 --> 00:20:46,610 Every single one of these on Earth that is sold has the exact same symmetric key. 263 00:20:46,610 --> 00:20:50,370 Every single card, every single reader has the exact same key. 264 00:20:50,370 --> 00: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. 265 00:20:57,170 --> 00:21:02,870 So that would be absolutely terrible if that one key got leaked. 266 00:21:03,530 --> 00:21:06,690 It took a while actually to get this key. 267 00:21:06,690 --> 00:21:08,530 They did pretty good security. 268 00:21:08,530 --> 00:21:12,030 Nobody dissolved the cards in acid, didn't anything like that. 269 00:21:12,030 --> 00: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. 270 00:21:24,610 --> 00: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. 271 00:21:36,970 --> 00:21:41,950 So he just swapped pins one and pin three, plugged it in. 272 00:21:42,570 --> 00:21:43,110 Great. 273 00:21:43,110 --> 00:21:44,310 We're debugging it. 274 00:21:44,310 --> 00:21:47,830 There is a security feature on PIC, though, where you can't just read memory. 275 00:21:47,830 --> 00:21:50,190 That would be catastrophic and extremely dumb. 276 00:21:50,190 --> 00:21:51,390 They did not do that. 277 00:21:51,550 --> 00:22:00,350 This particular one, though, had a vulnerability where you could wipe individual sectors and write data to individual sectors. 278 00:22:00,350 --> 00: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. 279 00:22:06,210 --> 00: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. 280 00:22:23,310 --> 00: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. 281 00:22:33,690 --> 00:22:38,230 They stored everything in PIC memory, including those keys. 282 00:22:38,230 --> 00:22:43,070 They weren't stored off chip in some sort of secure RAM or anything like that. 283 00:22:43,070 --> 00:22:49,190 So once you reverse engineer this go through, lo and behold, the keys just pop right out at you. 284 00:22:49,330 --> 00:22:50,650 That's game over. 285 00:22:50,650 --> 00: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. 286 00:22:59,470 --> 00: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. 287 00:23:13,990 --> 00: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. 288 00:23:20,410 --> 00: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. 289 00:23:28,510 --> 00: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. 290 00:23:33,290 --> 00:23:39,890 They also had a version that they would upsell you on called HID Elite Class. 291 00:23:40,050 --> 00:23:45,470 So what Elite Class would do is it would just change that standard key that's on every door on earth. 292 00:23:45,690 --> 00: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. 293 00:23:54,970 --> 00:23:56,130 Sounds good. 294 00:23:56,870 --> 00: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. 295 00:24:03,830 --> 00: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. 296 00:24:24,410 --> 00: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. 297 00:24:31,010 --> 00: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. 298 00:24:42,430 --> 00: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. 299 00:24:50,790 --> 00: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. 300 00:24:58,310 --> 00:24:59,490 Is this a typo? 301 00:24:59,490 --> 00:25:00,810 Like, is this algorithm real? 302 00:25:00,810 --> 00:25:02,450 And then, yes, it's all real. 303 00:25:02,450 --> 00: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. 304 00:25:09,550 --> 00:25:14,230 I think the guy who ported it was hanging out in the RFID village, actually, one of the co-authors. 305 00:25:14,230 --> 00:25:16,710 So, like, it's awesome. 306 00:25:16,710 --> 00:25:18,370 Like, crazy stuff. 307 00:25:18,990 --> 00:25:20,050 Totally works. 308 00:25:20,050 --> 00:25:22,270 And people are literally flipping out these days. 309 00:25:22,270 --> 00: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. 310 00:25:32,330 --> 00: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. 311 00:25:44,550 --> 00:25:50,870 So, it is a pretty strange time to be in this world. 312 00:25:50,970 --> 00: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. 313 00:25:58,550 --> 00:26:00,650 Like, this is a pretty bad exploit. 314 00:26:00,650 --> 00:26:04,150 But now that it's commoditized, hey, come play with it. 315 00:26:04,530 --> 00:26:07,130 So, the implications of this are actually huge. 316 00:26:07,130 --> 00:26:10,750 Most of the employee badges are, like, the world's largest companies. 317 00:26:10,750 --> 00: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. 318 00:26:15,990 --> 00:26:21,770 And I have, like, way, way too many, oh, my God, moments, given that this key was leaked back in 2010. 319 00:26:21,850 --> 00: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. 320 00:26:29,530 --> 00:26:32,210 Like, in Houston, there was a brand new building that was built. 321 00:26:32,450 --> 00:26:34,530 I was a tenant there for, like, six months. 322 00:26:34,530 --> 00:26:39,970 And on day one, I just, like, cloned the card they gave me and started walking through doors. 323 00:26:39,970 --> 00:26:45,790 I'm like, this is... why in 2024 did we just build this and buy this technology? 324 00:26:46,770 --> 00:26:48,990 So, there's still security theater, though. 325 00:26:48,990 --> 00:26:50,550 So, this actually is interesting. 326 00:26:50,550 --> 00:26:53,530 There is something to be said about, like, keeping the honest people honest. 327 00:26:53,530 --> 00: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. 328 00:27:02,890 --> 00:27:06,050 And it is not highly publicized that this is out there. 329 00:27:06,050 --> 00:27:07,870 It's highly publicized at DEF CON. 330 00:27:07,870 --> 00:27:12,890 But outside of this, you know, there's not big signs, like, your HID reader key was leaked in 2010. 331 00:27:12,930 --> 00:27:14,430 What version are you running? 332 00:27:14,890 --> 00:27:18,130 And it's just an absolute headache for admins. 333 00:27:18,130 --> 00:27:20,650 Like, now you don't know if your keys have been cloned. 334 00:27:20,670 --> 00:27:24,290 Upgrading these is a huge hassle, because this is your whole infrastructure. 335 00:27:24,510 --> 00:27:25,790 These readers aren't cheap. 336 00:27:25,790 --> 00:27:28,650 They can go up, like, $1,500 a piece. 337 00:27:28,670 --> 00:27:31,790 Not to mention the labor of ripping one out and rewiring it. 338 00:27:33,690 --> 00:27:40,830 So, just to take a step back, though, the only common feature here is bad implementation. 339 00:27:40,870 --> 00: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. 340 00:27:49,930 --> 00:27:51,370 I wasn't there making the decision. 341 00:27:51,370 --> 00:27:54,290 And normally, you don't realize it at the time. 342 00:27:54,290 --> 00:27:57,070 Like, you know, encoding strings that ended in null bytes. 343 00:27:57,070 --> 00:27:59,690 At the time, you're writing C, what could go wrong? 344 00:27:59,690 --> 00:28:01,270 And now we have buffer overflows forever. 345 00:28:01,270 --> 00: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. 346 00:28:09,730 --> 00:28:14,470 But otherwise, the smart card community as a whole has really crushed it. 347 00:28:14,470 --> 00:28:22,130 I mean, to attack, like, the DoD CAC or a modern credit card is actually pretty complicated. 348 00:28:22,130 --> 00:28:25,250 You'll see attacks here, kind of few and far between. 349 00:28:25,250 --> 00: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. 350 00:28:34,850 --> 00:28:39,130 And I remember going through this with my colleague and I'm like, man, everything actually does look fine. 351 00:28:39,130 --> 00:28:40,730 It looks totally shady. 352 00:28:40,730 --> 00:28:47,450 But if anyone used single key DES instead of, like, the triple keys on triple DES, this would be catastrophic. 353 00:28:47,470 --> 00: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. 354 00:28:55,270 --> 00:29:00,410 Because SIM cards are these cards if you just cut more plastic off and shove it in a phone. 355 00:29:00,510 --> 00:29:06,710 But the security of these at its core is actually quite good if implemented well. 356 00:29:07,230 --> 00:29:11,330 So, okay, Chad, we have these ultra secure cards. 357 00:29:11,330 --> 00:29:12,650 Why don't we have more of them then? 358 00:29:12,650 --> 00:29:14,930 Why don't I have one for my credit card? 359 00:29:15,050 --> 00:29:17,070 They don't scale well at all. 360 00:29:17,070 --> 00:29:19,670 Like, they were intended to have a bunch of applets. 361 00:29:19,670 --> 00:29:20,650 We'd all have one card. 362 00:29:20,650 --> 00:29:26,210 I'd have my Chad card and it has my bank ID and my gym pass and my employee ID. 363 00:29:26,210 --> 00:29:31,750 But the security architecture in this Java OS has almost no isolation and it's pretty terrible. 364 00:29:31,750 --> 00: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. 365 00:29:39,430 --> 00:29:41,710 So now I need one card for everything. 366 00:29:41,710 --> 00:29:46,510 And if I'm using them to log into websites, now we're talking a huge freaking nightmare, right? 367 00:29:46,510 --> 00:29:50,590 I'm gonna have a Rolodex of 800 cards coming in here trying to log into a site. 368 00:29:50,710 --> 00:29:54,190 They also require extra hardware, which people don't love. 369 00:29:54,190 --> 00: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. 370 00:29:59,990 --> 00:30:05,530 And then for all, you know, your wallets are just gonna be crazy fat and they have no user interface. 371 00:30:05,530 --> 00:30:07,290 This one is actually pretty relevant. 372 00:30:07,530 --> 00: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. 373 00:30:15,450 --> 00:30:17,250 There's no way to verify that. 374 00:30:17,470 --> 00: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. 375 00:30:24,430 --> 00: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. 376 00:30:31,530 --> 00:30:35,050 But these are passively powered, so you can't have interfaces. 377 00:30:36,330 --> 00:30:40,310 So this is the research question I've asked myself my whole career. 378 00:30:40,310 --> 00:30:41,990 Like, can we do better? 379 00:30:41,990 --> 00:30:44,750 I hate passwords, smart cards, things in my pocket. 380 00:30:45,230 --> 00:30:50,890 And this was back in, God, I don't know, 2009. 381 00:30:50,890 --> 00:30:53,750 I'm like, why don't we use iPhones when they were new? 382 00:30:53,750 --> 00:30:56,610 And everyone's like, no one will ever take their iPhone to work. 383 00:30:56,610 --> 00:30:57,430 It's a terrible idea. 384 00:30:57,430 --> 00:30:59,630 The security on them was bad at the time. 385 00:30:59,710 --> 00: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. 386 00:31:09,770 --> 00:31:13,750 So they actually already put smart cards in every single smartphone today. 387 00:31:13,750 --> 00: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. 388 00:31:20,390 --> 00: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. 389 00:31:25,090 --> 00:31:28,310 And when you do tap to pay, that's where you're interacting with. 390 00:31:28,350 --> 00:31:30,170 Everything is stored in that secure element. 391 00:31:30,170 --> 00: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. 392 00:31:37,650 --> 00: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. 393 00:31:43,230 --> 00: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. 394 00:31:53,990 --> 00:31:56,150 In ARM's version, they call it trust zone. 395 00:31:56,490 --> 00:32:02,470 So when the phone boots, it boots into a secure world that is your first stage bootloader. 396 00:32:02,470 --> 00:32:07,550 In there is where you're supposed to keep only your most sacred secrets and code. 397 00:32:07,550 --> 00:32:12,670 So your cryptographic keys, anything you use for authentication, payments, secure world. 398 00:32:12,670 --> 00: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. 399 00:32:20,330 --> 00:32:28,750 So now if iOS gets totally rooted, 100% rooted, exploited, they still cannot touch the code in the secure world. 400 00:32:28,750 --> 00:32:32,830 So if you've ever played around with your Android phone, it tells you to push the physical button. 401 00:32:32,830 --> 00: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. 402 00:32:41,730 --> 00: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. 403 00:32:55,390 --> 00:32:59,810 Not just being used by malware or some proximity trying to read your phone. 404 00:33:01,530 --> 00: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. 405 00:33:18,790 --> 00: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. 406 00:33:26,770 --> 00: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, 407 00:33:40,630 --> 00:33:41,650 or whatever. 408 00:33:43,190 --> 00: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. 409 00:33:52,950 --> 00:33:57,050 We have an app that can talk to door readers. 410 00:33:57,050 --> 00: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. 411 00:34:06,010 --> 00:34:08,770 You can use that credential for all sorts of different protocols. 412 00:34:09,110 --> 00: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. 413 00:34:26,270 --> 00:34:28,290 So thank you for attending. 414 00:34:36,080 --> 00:34:37,120 Question. 415 00:34:37,820 --> 00:34:45,740 And I think on time, I am very early, so there's plenty of time for questions. 416 00:34:54,940 --> 00:34:58,000 Has anybody broken into the CAC card? 417 00:34:58,440 --> 00:35:03,000 That's one of those questions where even if I knew the answer, I couldn't tell you. 418 00:35:05,460 --> 00:35:11,420 There is a library that we published when I used to work in Lincoln Laboratory called LLSmartCard. 419 00:35:11,420 --> 00: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. 420 00:35:22,580 --> 00: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. 421 00:35:58,480 --> 00:36:04,080 How well do trust execution environments stand up against physical attacks? 422 00:36:04,580 --> 00:36:09,360 Is that a downgrade from smart cards that have all of these physical anti-tamper in there? 423 00:36:09,360 --> 00:36:12,000 The answer is yes. 424 00:36:12,000 --> 00:36:15,360 There are some side channel attacks and things that have been published on tees. 425 00:36:15,480 --> 00:36:20,720 The way you would implement this is really to couple the tee with the secure element though. 426 00:36:20,720 --> 00:36:25,000 So you would keep all of your keying infrastructure in the secure element. 427 00:36:25,000 --> 00: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. 428 00:36:34,940 --> 00:36:39,820 And you really need the tee specifically for a trusted user interaction. 429 00:36:39,820 --> 00: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. 430 00:36:50,540 --> 00:36:59,360 But the computation itself should not be in the tee because you don't want RSA side channels. 431 00:36:59,360 --> 00:37:05,100 The one thing that I focused a lot of my PhD on, on the tee security in particular, was glitching attacks. 432 00:37:05,100 --> 00: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. 433 00:37:11,200 --> 00:37:13,380 This is actually how the Xbox One was hacked. 434 00:37:13,860 --> 00:37:14,680 I love it. 435 00:37:14,680 --> 00:37:19,220 If that person is here, introduce me to them so I can like hug them and give them a high five. 436 00:37:19,280 --> 00: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. 437 00:37:25,640 --> 00:37:30,920 So then you could have unfettered access to the secure element and start doing crazier attacks. 438 00:37:31,020 --> 00:37:37,760 So I actually looked extensively into how to write glitching resistant code in software only with a clang pass. 439 00:37:37,760 --> 00:37:39,300 We published a paper on it. 440 00:37:39,300 --> 00: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. 441 00:37:46,960 --> 00:37:51,940 So I had to change it to glitching demystified or something far more lame. 442 00:37:51,940 --> 00: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. 443 00:38:30,760 --> 00:38:36,620 So how effective are the RFID blocking badge holders and little sleeves that they get you? 444 00:38:37,320 --> 00:38:38,900 They're very effective. 445 00:38:39,020 --> 00: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. 446 00:38:46,700 --> 00:38:50,800 Because I'm like, hey, these things are annoying, but they absolutely work. 447 00:38:50,800 --> 00:38:52,340 And I work here. 448 00:38:52,340 --> 00:38:55,300 I'm trying to protect, you know, the stuff we're doing. 449 00:38:55,520 --> 00: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. 450 00:39:03,720 --> 00:39:07,280 But then you can flip the plastic up, tap your badge and flip it back. 451 00:39:07,280 --> 00:39:12,380 Because otherwise you're like in this fight every morning trying to like slide it out of this stupid metal thing. 452 00:39:12,440 --> 00:39:13,700 They're not cheap. 453 00:39:13,700 --> 00:39:15,300 So they're hard to do at scale. 454 00:39:15,300 --> 00:39:20,680 But I don't know, they bought me one because I exposed all this stuff. 455 00:39:20,680 --> 00:39:26,120 And they were not happy with me, but happy enough to get me the fancy one. 456 00:39:26,120 --> 00:39:29,600 But they totally work, like RFID wallets and stuff. 457 00:39:29,700 --> 00: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. 458 00:39:37,440 --> 00:39:42,900 So this is where I would come near you with a software defined radio, I would touch somewhere near your card. 459 00:39:42,900 --> 00:39:48,640 And I have my friend anywhere on earth with another software defined radio that just re-emits back and forth. 460 00:39:48,700 --> 00: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. 461 00:39:55,500 --> 00:39:58,180 And that's really like those RFID wallets. 462 00:39:58,280 --> 00:39:59,540 That's what those are all about. 463 00:39:59,540 --> 00:40:02,700 Because somebody could come up to you, you're nowhere near the cash register. 464 00:40:02,700 --> 00:40:07,720 Someone else has a Proxmark up their sleeve and then they just bought, you know, a really fancy dinner on you. 465 00:40:07,720 --> 00:40:08,940 Thank you very much. 466 00:40:09,060 --> 00:40:10,980 So yeah, they totally work though. 467 00:40:10,980 --> 00:40:13,540 We've tested them in the lab and they do their job. 468 00:40:42,500 --> 00:40:49,400 The question there was about the legal action since the, you know, this key has been leaked since 2010. 469 00:40:49,400 --> 00:40:51,240 Has there any been class action suits? 470 00:40:51,260 --> 00:40:53,100 I don't know. 471 00:40:53,100 --> 00:40:56,260 And I don't know what the law is around that. 472 00:40:56,260 --> 00: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. 473 00:41:03,540 --> 00:41:07,020 And I came out of that talk with far more questions than I got answers. 474 00:41:07,020 --> 00:41:10,240 It is extremely complicated and confusing. 475 00:41:10,420 --> 00: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. 476 00:41:18,800 --> 00:41:25,900 And it should be like strongly advertised, like, hey, you haven't updated yet. 477 00:41:25,900 --> 00:41:29,160 Maybe you should consider this free firmware update. 478 00:41:29,500 --> 00:41:31,700 So I don't know. 479 00:41:31,700 --> 00: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. 480 00:41:41,860 --> 00:41:43,460 It is really freaking hard though. 481 00:41:43,460 --> 00:41:45,980 I will stress building a security product. 482 00:41:45,980 --> 00:41:50,420 It is way harder than it sounds when you're on the offensive side your whole career. 483 00:41:50,420 --> 00:41:52,020 Like, why didn't they just do this? 484 00:41:52,020 --> 00:41:52,960 And then you're on the other side. 485 00:41:52,960 --> 00:41:56,180 You're like, oh, damn, that is, that's a lift there. 486 00:41:56,180 --> 00:42:00,180 That is not as easy as I made it sound in my publication. 487 00:42:23,120 --> 00:42:23,460 Okay. 488 00:42:23,460 --> 00:42:24,800 I should have had this in my talk. 489 00:42:24,800 --> 00:42:29,080 Is there any way to secure your enterprise today with smart cards that I didn't go over? 490 00:42:29,080 --> 00:42:29,760 Yes. 491 00:42:29,760 --> 00:42:30,440 A hundred percent. 492 00:42:30,440 --> 00:42:32,320 These are just the known vulnerabilities. 493 00:42:32,400 --> 00:42:37,580 There are cards like the Dezfire, even like the Mifer Dezfire, Mifer Ultralights. 494 00:42:37,580 --> 00: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. 495 00:42:43,920 --> 00:42:49,620 So you can get these cards with the good cryptographic standards on them and key them to your organization. 496 00:42:49,920 --> 00:42:54,860 And, you know, at least for now, there's no known vulnerabilities you're cruising. 497 00:42:55,120 --> 00:42:57,880 So yeah, there are card stocks out there. 498 00:42:58,420 --> 00:43:00,480 HID even sells Dezfire cards. 499 00:43:00,720 --> 00:43:05,860 So it's not that like all of their cards have to be this I-class or, you know, any brand. 500 00:43:05,900 --> 00:43:08,740 And most of these readers will read the good cards. 501 00:43:08,740 --> 00: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. 502 00:43:17,680 --> 00: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, 503 00:43:32,060 --> 00:43:33,820 what hasn't on our website. 504 00:43:39,700 --> 00:43:42,120 Any other questions about how to break into buildings? 505 00:43:45,200 --> 00: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. 506 00:43:51,900 --> 00:43:53,920 So we can hang out for a little bit more. 507 00:44:16,570 --> 00:44:18,630 This question, I never know the answer to it. 508 00:44:18,630 --> 00:44:20,110 Someone's been coming to DevCon forever. 509 00:44:20,110 --> 00:44:24,950 How dangerous is it to walk around DevCon without your cards in a Faraday cage? 510 00:44:24,950 --> 00:44:27,850 Your credit cards are fine, unless it's a relay attack. 511 00:44:27,850 --> 00:44:32,130 There's no known, like, wireless attack that I'm aware of that can just clone cards. 512 00:44:32,190 --> 00: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. 513 00:44:40,910 --> 00: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. 514 00:44:50,830 --> 00: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. 515 00:44:59,570 --> 00:45:00,930 But I don't know. 516 00:45:00,930 --> 00: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. 517 00:45:13,310 --> 00:45:14,770 Like, no, there's bad people here. 518 00:45:14,770 --> 00:45:16,150 We're not all good. 519 00:45:16,150 --> 00:45:17,850 We're not all honest hackers. 520 00:45:18,050 --> 00: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. 521 00:45:26,450 --> 00:45:27,630 You should be fine. 522 00:45:33,720 --> 00:45:37,620 Yeah, well, let's keep rifting. 523 00:45:59,290 --> 00: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? 524 00:46:06,250 --> 00: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? 525 00:46:15,210 --> 00:46:16,370 Our phones are on the internet. 526 00:46:16,370 --> 00:46:17,810 Our smart cards are not. 527 00:46:17,830 --> 00: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? 528 00:46:25,070 --> 00:46:29,770 Like, that's now an attack factor that wouldn't have existed on a smart card. 529 00:46:29,890 --> 00: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. 530 00:46:37,690 --> 00:46:46,710 Back to the bad implementation, if done well, if done correctly, you can actually mitigate that software-based attack. 531 00:46:46,830 --> 00:46:48,930 It'll never be fully gone, right? 532 00:46:48,930 --> 00:46:51,110 There's always gonna be a chance that you didn't have before. 533 00:46:51,110 --> 00:46:52,950 It was zero percent chance before. 534 00:46:52,950 --> 00: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? 535 00:47:03,610 --> 00:47:07,690 You could have your government ID on your phone and, like, election day comes out. 536 00:47:07,690 --> 00:47:09,430 You don't worry about waiting in some line. 537 00:47:09,430 --> 00:47:11,530 You could just cast your vote in some secure way. 538 00:47:12,070 --> 00: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. 539 00:47:21,370 --> 00:47:25,350 So you're not really opening yourself up to another physical interface. 540 00:47:25,350 --> 00: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. 541 00:47:34,550 --> 00:47:38,450 That's the one that I've spent most of my research freaking out about. 542 00:47:38,450 --> 00: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? 543 00:47:48,510 --> 00: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? 544 00:47:54,370 --> 00:47:59,290 So that's the sticky part of putting things on phones. 545 00:47:59,290 --> 00: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. 546 00:48:07,430 --> 00:48:08,030 Yeah. 547 00:48:38,350 --> 00: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. 548 00:48:47,370 --> 00:48:50,270 And the question was, was that because of a security vulnerability? 549 00:48:50,290 --> 00:48:52,230 I'm not sure. 550 00:48:53,330 --> 00:48:54,130 Probably. 551 00:48:55,030 --> 00:48:57,030 That seems like a good reason. 552 00:48:57,230 --> 00:49:00,630 I know, like, that is the biggest issue with hardware tokens in general. 553 00:49:00,630 --> 00: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. 554 00:49:06,530 --> 00: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. 555 00:49:13,890 --> 00:49:17,110 So that is actually another interesting thing. 556 00:49:17,110 --> 00: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. 557 00:49:24,530 --> 00:49:26,110 That's going to take 10 years. 558 00:49:26,530 --> 00:49:30,110 So it's a tough game, like trying to build secure systems. 559 00:49:30,110 --> 00:49:32,790 It's really, really complicated. 560 00:49:32,790 --> 00:49:35,150 I do think we're getting much better at it, though. 561 00:49:35,150 --> 00:49:39,270 Just if you look at the frequency of exploits, it actually is going down over time. 562 00:49:39,290 --> 00: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. 563 00:49:57,660 --> 00:50:00,480 Am I familiar with laser fault injection? 564 00:50:00,640 --> 00:50:03,940 Yes, like optical glitching attacks on hardware. 565 00:50:03,940 --> 00:50:04,840 I am familiar with. 566 00:50:04,840 --> 00: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. 567 00:50:12,180 --> 00: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. 568 00:50:21,180 --> 00:50:23,080 He's, like, red fuming nitric acid. 569 00:50:23,080 --> 00:50:26,040 So how do I think that'll play into this going future? 570 00:50:26,040 --> 00:50:30,260 I think that's where you stand on the shoulders of giants in the smart card world, right? 571 00:50:30,260 --> 00:50:37,280 So, like, these secure elements really are done well to try to prevent against that stuff. 572 00:50:37,280 --> 00:50:41,200 Like, these physical attacks have really been thought about in depth. 573 00:50:41,560 --> 00: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. 574 00:50:50,000 --> 00: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? 575 00:50:58,320 --> 00:50:59,880 You're trying to drive cross down. 576 00:51:00,460 --> 00:51:04,500 And I know PIX in particular, that's what we had a PIX, is vulnerable to that attack. 577 00:51:04,540 --> 00:51:06,160 So we wanted to see that happen. 578 00:51:06,160 --> 00:51:11,260 We're like, okay, we want to spread, hit UV light here, flip the right protect bit, and dump the firmware. 579 00:51:11,260 --> 00:51:15,220 In particular, we were messing around with my Subaru WRX. 580 00:51:15,220 --> 00:51:20,380 So, like, we were able to roll the odometer and make the odometer say leet. 581 00:51:20,380 --> 00:51:23,180 That was, like, one of the fun wins of that. 582 00:51:23,180 --> 00:51:27,540 And then we just found some other things with known, some other processors with known attacks. 583 00:51:27,720 --> 00:51:29,420 So, I mean, 100%. 584 00:51:29,420 --> 00:51:35,640 The more security we start putting in our phones, the more we need to beef up the defense. 585 00:51:35,640 --> 00: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. 586 00:51:43,900 --> 00:51:47,860 And the more we throw in there, the better job we have to do. 587 00:51:47,900 --> 00:51:51,940 And I'll leave you with, like, my adage on why I think that's a good thing. 588 00:51:52,160 --> 00:51:55,140 As a defender, and I worked for the DoD for a bit. 589 00:51:55,140 --> 00:52:00,380 So, if you watch the movie 300, as a defender, you want to create a choke point, right? 590 00:52:00,380 --> 00:52:01,660 Like, that's how you beat the Persians. 591 00:52:01,660 --> 00: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. 592 00:52:06,900 --> 00: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. 593 00:52:14,040 --> 00:52:21,080 Like, you now, your parsers are very rudimentary, can actually be audited quite well. 594 00:52:21,080 --> 00: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. 595 00:52:29,900 --> 00: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. 596 00:52:40,700 --> 00: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. 597 00:52:53,040 --> 00:52:54,820 I don't know if I've convinced others yet. 598 00:52:56,780 --> 00:53:01,800 I have two minutes for either a final question or an awkward silence. 599 00:53:08,160 --> 00:53:09,100 All right. 600 00:53:11,280 --> 00:53:12,380 Thank you all so much. 601 00:53:12,380 --> 00:53:14,340 Hopefully, this was educational and useful. 602 00:53:14,340 --> 00: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.