All right, let's kick this thing off. So I found out today this was not in Hacker Tracker, so everybody in here must read the old ink version of the schedule. So thank you for reading the old paper version and showing up. Today we're going to learn how to break into buildings. Plain and clear. Why do I like breaking into buildings? 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. 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. So let's go back through the history and see all the different ways you can break into buildings with laptops. So first we'll go over access control one-on-one. I'll just explain how these systems work. That's step one. What a smart card is. This is actually a pretty overloaded word. Everything looks like a smart card is just a piece of plastic with some microcontrollers in it. And then I'll go over all of the attacks that we've seen come out over the last couple decades. And then some food for thought on what the future might look like. So if you look at a typical access control system, there's only a couple of components. This is the most complicated system you would ever see. On the left side you'll see that there's a door reader. This is the little box you tap your card to and it goes boop! And green or red or blue or whatever color it turns. 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. So it's going to compare that number to some database and say, does this person have access? If it does, it opens the door. 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. That electromagnet will hold the door shut. 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. So in the event of a fire, you need a button that you can push to cut the power. This actually was not deployed well on the initial ones. A lot of people burned to death. So this is like fire marshal enforced now. Every door that has an electromagnetic lock will have a motion sensor and an exit button for egress. And by law, it has to be one motion. So if you hit the exit button, that needs to be all you do, or a big bar. So that comes into play quite a bit when you see some of the attacks and how to bypass these. 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. There's just three relays. Ultimately, there's one that matters. So on the secure side, if that relay trips, the power is either turned off or on, and the door will unlock. 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. Once it gets the other side, decision is made. The other two things are also just relays. The exit button, when you hit it, it's just going to cut the power. And the motion sensor, again, when you wave at it, it just touches a relay. These are either normally closed or normally open. If you get any of those relays to chip, the door will unlock. So let's look at some of the worst relay fails in honor of the Olympics. This is not a running relay we're talking about, though. This is an electronic relay. I'm going to gamble that the internet works and show you how you can trip these relays in not-so-sophisticated ways. We'll get to interesting computer hacks later, but you see here in this video the exit button is on the left. You get yourself a nice sturdy piece of metal, shove that thing through the door, and you just click that relay. Bang, you're in. We'll keep going up in complexity. This is probably the least advanced way to trip one of those relays. So I call this the hook key. There's also the magnet key. So if you're aware of the internal mechanics in a relay, it's just two pieces of metal like this. You touch them together, the connection is made. You separate them, the connection is not made. So some of these... this is the locksmith, uh, lock picking lawyer. You hit the pin pad, the door unlocks. You can literally take a magnet, touch it to where the relay is, and it just clicks the relay. 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. So don't do that. When you install these systems, make sure the relay is on the inside of the building, not the outside. And then there's the motion sensor. So for obvious reasons, when there's motion, it's going to trigger. 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. And you can just blow smoke through the crack and walk right through the door. So we'll call these the very unsophisticated, uninteresting, why the hell did I come to this talk hacks. There are much more fun ways to do this. Just to note, when you're looking at these systems, so there's the electromagnets that are huge, chunky electromagnets over the top. There's also electric strikes. So these are solenoids that are going to have a pin that in its unpowered position is stuck down in the hole. And then when you power it, it pulls the solenoid out. These are far better for various reasons. You can't get locked into your building and die. They're a little harder to trip. You can't vape into these and have them pull a solenoid up. So if you're given an option, you're installing these, anytime you can put an electric strike. So now let's look at smart cards. First, we need to answer the question, what do I mean by smart card? There's really, I think, three different forms you'll see. There's the ones that look like our credit cards that have these little pads on them. There's ones that are just pieces of plastic that do some RF stuff. And then there's ones with the mag stripe on the back. So these are all very, very different technologies. 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. So if we look at a mag stripe, this one normally fascinates people. 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. It is just a way to encode ASCII text effectively in a magnetic form. There is no security involved. There is no encryption. If you want to clone some mag stripe cards, we have them over in the physical security village. This was like, you know, attempt number one at, hey, we're gonna use a physical thing to interface with a digital world. There is nothing interesting or sophisticated there other than some physics with like magnetic poles. Not smart at all. Then came the prox cards. These you literally just emanate radio waves at them. They can be passively powered, which is really cool. So the radio waves actually give them the power they need to power on. And then they respond with a number. You can actually hack these things with AM radios. I have like a little kit when my sister was like five, we were playing around and like emulating these kind of smart cards. They are not encrypted. There is nothing really interesting from a cryptography standpoint going on there. The only thing to figure out is how they encode the data that coming back. Is it amplitude shift keying? Is it phase shift keying? How are they encoding the radio frequency? But at the end of the day, it is just a number. And that number is typically printed on the card, just to add to the security of the whole situation. These were never intended as a high security thing. 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. It's a bummer. Like I saw her come home first day of work, like why? Like I know where you work. Don't do that. You have sensitive stuff. So then came along the near field communication cards, NFC or high frequency cards. These run at 13.56 megahertz. These do have cryptography on them. The way to think of the cryptography on all of these is as a memory card. There is a symmetric key that is on the card. And if you have it, you can read and write to that card. And if you don't, you cannot. So there is one key that will let you read and write data from these cards. Otherwise, I colloquially call them dumb cards. They're not doing anything sophisticated. They're just memory cards, but they are better than the mag stripes and the prox cards. So there's going to be a shared key, which that screen still looks like it's on. So there's gonna be a key on the card and a key on the reader. So for the reader to read the card, it needs another key, which you can kind of see where this is going. 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. Now we look at what is actually considered a smart card. So our credit cards that look like this with the little chip, these are actually little microprocessors. They're not microcontrollers. They actually run Java OS. They have a CPU. They have memory. They have non-volatile storage. They have, you know, dedicated crypto units. And they can do public key cryptography. So these are actually smart in the sense that we would hope they are and do proper security things. With the asymmetric encryption, this is much better than the symmetric key encryption. 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. 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. There's far more sophisticated stuff in there than I thought. And you can kind of see the overlap. You have contact cards that speak one protocol. You have contactless cards. And then you have the dual interface cards, which almost all credit cards are today. You can tap to pay or you can shove that thing into the credit card reader. And if you look at the specs, they have 1k mbit flash. There's an EEPROM that speaks I-squared seed and SPI. They have segmented memory with a 64k bit EEPROM. Pretty decent specs for a credit card. The way they work is if you look at those pads, only four matter. You have your power and your ground to power the little computer on. You drive the clock externally, which is interesting from a glitching perspective. So you control both the voltage and the clock. And then you just have a single pin for I-O. So as you're driving the clock, use that I-O to read and write commands and application data units. So APDUs, you're going to send commands. You can actually send admin commands and install Java applets and manipulate the operating system. Or unauthenticated commands that are just going to query this thing for a challenge response. 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. So smart cards have always fascinated me because they actually do a very, very good job at physical attacks. So it's common that you would drop your credit card and somebody could pick it up, right? They can still go make payments, but actually extracting that key, cloning cards is a big deal. 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. 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. They also have to have brownout detection. 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. So that means you're going to take it from your positive five volts to negative five volts. 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. They also, because you're controlling power, clock, all of these things, you have to program the logic very specially. So one of these two statements on the right is correct in an embedded system standpoint. If you're writing this for a computer software, they're both probably fine. But this is the code to check the pin when I'm entering the pin to say unlock my debit card. Does anybody have an inkling of which one is better than the other? We think number two is better. Correct. Number two is better. 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. 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. Which means you could then brute force this with unlimited tries. 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. 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. 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. So before we go break all these, why did we even build these in the first place? The real problem is that physical keys are one to one. There's one key that opens one door. If I want 1,000 people to open that one door, they all have the exact same key. 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. So in enterprise, this sucks. Smart cards can be one to many. You can have many different credentials that get into the same door. It used to be really complicated to carry a full computer in your pocket. As you can see, modern smart cards are actually little mini computers. Our smartphones are really big, fast computers. And you can put a picture on them. This should not be ignored. 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. 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. Enough with all that fluffy stuff. Let's go through some exploits. That's why we're at DEF CON. So when you're doing a vulnerability assessment, you first want to ask yourself, what's the goal, right? What's the worst that can happen? So we could use a card without someone's permission. I could, you know, swipe it out of your back pocket. I can clone the smart card or I can subvert the need for it altogether. So we already saw at the beginning some of the ways that you can just completely ignore the card. 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. And using the card without a person's permission is not particularly interesting because you're just stealing the card. There are ways that there are some smart cards that will have like biometrics built into them, you know, other things like that. We're going to specifically focus on cloning the smart cards. 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. So there's going to be one, an authentication key, an in-transit key that lets you read and write data. And then you can also encrypt the data at rest on the card. 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. And then I will also have effectively a key that encrypts the in-transit that lets me even talk to the card. It doesn't matter what the key for the encryption on the card is, if I'm just going to clone it outright. 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. So the whole goal of this, when we're trying to break into buildings with laptops, is just find that dang key. Whatever the key is that lets me read and write data from the cards is game over for that security system. Because now I can walk up next to anybody and just outright clone employee IDs. And in the case that I also know the at-rest key, I can just fabricate whatever keys I want. 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. So how are these attacks done? These are almost all exclusively physical attacks on the cards and their readers first. This one on the MyFairClassic, so this was the most prolific card early in the smart card era. This was used for everything, public transit, cash cards, so you'd actually store money in the value on the card. So breaking these was a really big deal in the research world. There were a couple professors at UVA that actually delidded the chip. 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. And then they applied image recognition to all of these images to reverse engineer the algorithm that was encoded in that chip. 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. Spoiler alert, yes, there was. MyFairClassic at this point is quite broken. 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. I wasn't involved in the porting of it, but mostly a user of all these great tools. But this is what it looked like way back in the day in your terminal window. Now it's a very awesome, you know, handheld little device. But you can effectively brute force all of those keys, break the keys. Back to the beginning of the talk, once you have the key, it's game over. You tap any card you're reading and writing. You can again come over to our booth. There's still hotel key cards and public transit cards and things today that are still using MyFairClassic. So in the enterprise environment, there's HID dominated. They were by far the monopolist in, you know, enterprise access control. This thing on the left probably looks very familiar to most of you. They're all around this conference. You've seen them probably in tons of buildings, airports, financial institutions, whatever. Every elevator here has one of these. These use symmetric keys, right? So we go back to how would you deploy a system like this? Every single one of these on Earth that is sold has the exact same symmetric key. Every single card, every single reader has the exact same key. So they've sold millions of these to many different buildings, one of which we are standing in today with the same key. So that would be absolutely terrible if that one key got leaked. It took a while actually to get this key. They did pretty good security. Nobody dissolved the cards in acid, didn't anything like that. 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. 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. So he just swapped pins one and pin three, plugged it in. Great. We're debugging it. There is a security feature on PIC, though, where you can't just read memory. That would be catastrophic and extremely dumb. They did not do that. This particular one, though, had a vulnerability where you could wipe individual sectors and write data to individual sectors. 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. 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. 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. They stored everything in PIC memory, including those keys. They weren't stored off chip in some sort of secure RAM or anything like that. So once you reverse engineer this go through, lo and behold, the keys just pop right out at you. That's game over. 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. 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. So it used to be you'd use this key, you just read the the credential off, and you could write arbitrary credentials. 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. 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. They also had a version that they would upsell you on called HID Elite Class. So what Elite Class would do is it would just change that standard key that's on every door on earth. 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. Sounds good. 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. 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. The backend, it would never spit them out, they were total failed transactions, and then offline, you could brute force the elite key. 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. 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. 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. Is this a typo? Like, is this algorithm real? And then, yes, it's all real. 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. I think the guy who ported it was hanging out in the RFID village, actually, one of the co-authors. So, like, it's awesome. Like, crazy stuff. Totally works. And people are literally flipping out these days. 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. 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. So, it is a pretty strange time to be in this world. 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. Like, this is a pretty bad exploit. But now that it's commoditized, hey, come play with it. So, the implications of this are actually huge. Most of the employee badges are, like, the world's largest companies. I still today walk around and have friends, and I'm always looking at people's IDs and trying to clone everything. And I have, like, way, way too many, oh, my God, moments, given that this key was leaked back in 2010. 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. Like, in Houston, there was a brand new building that was built. I was a tenant there for, like, six months. And on day one, I just, like, cloned the card they gave me and started walking through doors. I'm like, this is... why in 2024 did we just build this and buy this technology? So, there's still security theater, though. So, this actually is interesting. There is something to be said about, like, keeping the honest people honest. 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. And it is not highly publicized that this is out there. It's highly publicized at DEF CON. But outside of this, you know, there's not big signs, like, your HID reader key was leaked in 2010. What version are you running? And it's just an absolute headache for admins. Like, now you don't know if your keys have been cloned. Upgrading these is a huge hassle, because this is your whole infrastructure. These readers aren't cheap. They can go up, like, $1,500 a piece. Not to mention the labor of ripping one out and rewiring it. So, just to take a step back, though, the only common feature here is bad implementation. 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. I wasn't there making the decision. And normally, you don't realize it at the time. Like, you know, encoding strings that ended in null bytes. At the time, you're writing C, what could go wrong? And now we have buffer overflows forever. 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. But otherwise, the smart card community as a whole has really crushed it. I mean, to attack, like, the DoD CAC or a modern credit card is actually pretty complicated. You'll see attacks here, kind of few and far between. 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. And I remember going through this with my colleague and I'm like, man, everything actually does look fine. It looks totally shady. But if anyone used single key DES instead of, like, the triple keys on triple DES, this would be catastrophic. 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. Because SIM cards are these cards if you just cut more plastic off and shove it in a phone. But the security of these at its core is actually quite good if implemented well. So, okay, Chad, we have these ultra secure cards. Why don't we have more of them then? Why don't I have one for my credit card? They don't scale well at all. Like, they were intended to have a bunch of applets. We'd all have one card. I'd have my Chad card and it has my bank ID and my gym pass and my employee ID. But the security architecture in this Java OS has almost no isolation and it's pretty terrible. 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. So now I need one card for everything. And if I'm using them to log into websites, now we're talking a huge freaking nightmare, right? I'm gonna have a Rolodex of 800 cards coming in here trying to log into a site. They also require extra hardware, which people don't love. 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. And then for all, you know, your wallets are just gonna be crazy fat and they have no user interface. This one is actually pretty relevant. 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. There's no way to verify that. If you had a user interface on there, even with just this, you know, four digit pin, you could pretty much mitigate that attack. A four digit pin with some throttling or some, you know, threshold of five attempts, anyone who picked up that card would be doomed. But these are passively powered, so you can't have interfaces. So this is the research question I've asked myself my whole career. Like, can we do better? I hate passwords, smart cards, things in my pocket. And this was back in, God, I don't know, 2009. I'm like, why don't we use iPhones when they were new? And everyone's like, no one will ever take their iPhone to work. It's a terrible idea. The security on them was bad at the time. 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. So they actually already put smart cards in every single smartphone today. 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. It's called a secure element and it is soldered on the motherboard of every single person's phone in here today. And when you do tap to pay, that's where you're interacting with. Everything is stored in that secure element. 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. 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. 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. In ARM's version, they call it trust zone. So when the phone boots, it boots into a secure world that is your first stage bootloader. In there is where you're supposed to keep only your most sacred secrets and code. So your cryptographic keys, anything you use for authentication, payments, secure world. Then you create a sandbox called the non-secure world, and that's where you let iOS and Android and the operating systems play. So now if iOS gets totally rooted, 100% rooted, exploited, they still cannot touch the code in the secure world. So if you've ever played around with your Android phone, it tells you to push the physical button. 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. 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. Not just being used by malware or some proximity trying to read your phone. 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. 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. 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, or whatever. 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. We have an app that can talk to door readers. It all uses asymmetric encryption, uses all the good stuff, but can also talk to computers, SSH servers, websites, you name it. You can use that credential for all sorts of different protocols. 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. So thank you for attending. Question. And I think on time, I am very early, so there's plenty of time for questions. Has anybody broken into the CAC card? That's one of those questions where even if I knew the answer, I couldn't tell you. There is a library that we published when I used to work in Lincoln Laboratory called LLSmartCard. 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. 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. How well do trust execution environments stand up against physical attacks? Is that a downgrade from smart cards that have all of these physical anti-tamper in there? The answer is yes. There are some side channel attacks and things that have been published on tees. The way you would implement this is really to couple the tee with the secure element though. So you would keep all of your keying infrastructure in the secure element. 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. And you really need the tee specifically for a trusted user interaction. 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. But the computation itself should not be in the tee because you don't want RSA side channels. The one thing that I focused a lot of my PhD on, on the tee security in particular, was glitching attacks. So the one thing you can do when you're booting into secure world is if you can glitch at just the right time. This is actually how the Xbox One was hacked. I love it. If that person is here, introduce me to them so I can like hug them and give them a high five. But they actually, you're able to glitch it and skip the part where you would then put everything in non-secure world. So then you could have unfettered access to the secure element and start doing crazier attacks. So I actually looked extensively into how to write glitching resistant code in software only with a clang pass. We published a paper on it. 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. So I had to change it to glitching demystified or something far more lame. 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. So how effective are the RFID blocking badge holders and little sleeves that they get you? They're very effective. When I was doing this research, that was actually my number one thing I recommended to everybody and probably got the most enemies from. Because I'm like, hey, these things are annoying, but they absolutely work. And I work here. I'm trying to protect, you know, the stuff we're doing. 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. But then you can flip the plastic up, tap your badge and flip it back. Because otherwise you're like in this fight every morning trying to like slide it out of this stupid metal thing. They're not cheap. So they're hard to do at scale. But I don't know, they bought me one because I exposed all this stuff. And they were not happy with me, but happy enough to get me the fancy one. But they totally work, like RFID wallets and stuff. 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. So this is where I would come near you with a software defined radio, I would touch somewhere near your card. And I have my friend anywhere on earth with another software defined radio that just re-emits back and forth. 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. And that's really like those RFID wallets. That's what those are all about. Because somebody could come up to you, you're nowhere near the cash register. Someone else has a Proxmark up their sleeve and then they just bought, you know, a really fancy dinner on you. Thank you very much. So yeah, they totally work though. We've tested them in the lab and they do their job. The question there was about the legal action since the, you know, this key has been leaked since 2010. Has there any been class action suits? I don't know. And I don't know what the law is around that. I actually have a friend who's a law professor in Texas and asked her to speak recently about cybersecurity law in particular. And I came out of that talk with far more questions than I got answers. It is extremely complicated and confusing. 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. And it should be like strongly advertised, like, hey, you haven't updated yet. Maybe you should consider this free firmware update. So I don't know. 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. It is really freaking hard though. I will stress building a security product. It is way harder than it sounds when you're on the offensive side your whole career. Like, why didn't they just do this? And then you're on the other side. You're like, oh, damn, that is, that's a lift there. That is not as easy as I made it sound in my publication. Okay. I should have had this in my talk. Is there any way to secure your enterprise today with smart cards that I didn't go over? Yes. A hundred percent. These are just the known vulnerabilities. There are cards like the Dezfire, even like the Mifer Dezfire, Mifer Ultralights. There are cards that are properly, like they're using Dez, they're using AES, they're using good cryptography that is not broken. So you can get these cards with the good cryptographic standards on them and key them to your organization. And, you know, at least for now, there's no known vulnerabilities you're cruising. So yeah, there are card stocks out there. HID even sells Dezfire cards. So it's not that like all of their cards have to be this I-class or, you know, any brand. And most of these readers will read the good cards. 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. 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, what hasn't on our website. Any other questions about how to break into buildings? 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. So we can hang out for a little bit more. This question, I never know the answer to it. Someone's been coming to DevCon forever. How dangerous is it to walk around DevCon without your cards in a Faraday cage? Your credit cards are fine, unless it's a relay attack. There's no known, like, wireless attack that I'm aware of that can just clone cards. 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. 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. 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. But I don't know. 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. Like, no, there's bad people here. We're not all good. We're not all honest hackers. 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. You should be fine. Yeah, well, let's keep rifting. Yeah, so if we... let's say we go from smart cards to phones, what risk would we open ourselves up to? So the biggest one there, and the one that I've spent a lot of my research thinking about, was the software attack, right? Our phones are on the internet. Our smart cards are not. 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? Like, that's now an attack factor that wouldn't have existed on a smart card. 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. Back to the bad implementation, if done well, if done correctly, you can actually mitigate that software-based attack. It'll never be fully gone, right? There's always gonna be a chance that you didn't have before. It was zero percent chance before. 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? You could have your government ID on your phone and, like, election day comes out. You don't worry about waiting in some line. You could just cast your vote in some secure way. 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. So you're not really opening yourself up to another physical interface. 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. That's the one that I've spent most of my research freaking out about. 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? You know, if we put our stuff in there, is a neighbor going to be the one that actually crumbles the whole security? So that's the sticky part of putting things on phones. 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. Yeah. 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. And the question was, was that because of a security vulnerability? I'm not sure. Probably. That seems like a good reason. I know, like, that is the biggest issue with hardware tokens in general. And back to the counterpoint on phones, you can actually push over their updates to phones where you can't the physical security keys. 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. So that is actually another interesting thing. 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. That's going to take 10 years. So it's a tough game, like trying to build secure systems. It's really, really complicated. I do think we're getting much better at it, though. Just if you look at the frequency of exploits, it actually is going down over time. 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. Am I familiar with laser fault injection? Yes, like optical glitching attacks on hardware. I am familiar with. I've actually done one of them, not with the intent to succeed, but with the intent to learn, and it is freaking rad. Like, to look at an electron microscope, you're looking at, like, a couple nanometer resolution on this chip, and, like, it's sweet. He's, like, red fuming nitric acid. So how do I think that'll play into this going future? I think that's where you stand on the shoulders of giants in the smart card world, right? So, like, these secure elements really are done well to try to prevent against that stuff. Like, these physical attacks have really been thought about in depth. 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. 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? You're trying to drive cross down. And I know PIX in particular, that's what we had a PIX, is vulnerable to that attack. So we wanted to see that happen. We're like, okay, we want to spread, hit UV light here, flip the right protect bit, and dump the firmware. In particular, we were messing around with my Subaru WRX. So, like, we were able to roll the odometer and make the odometer say leet. That was, like, one of the fun wins of that. And then we just found some other things with known, some other processors with known attacks. So, I mean, 100%. The more security we start putting in our phones, the more we need to beef up the defense. 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. And the more we throw in there, the better job we have to do. And I'll leave you with, like, my adage on why I think that's a good thing. As a defender, and I worked for the DoD for a bit. So, if you watch the movie 300, as a defender, you want to create a choke point, right? Like, that's how you beat the Persians. You know exactly where they're coming, and you can focus all of your attack power there and all your defensive power. 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. Like, you now, your parsers are very rudimentary, can actually be audited quite well. 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. 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. 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. I don't know if I've convinced others yet. I have two minutes for either a final question or an awkward silence. All right. Thank you all so much. Hopefully, this was educational and useful. 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.