Okay, everyone, thank you for coming. Welcome. I'm calling this talk Ghosting the Paxman, Basics of Physical Access Control and Physical Access Control Systems and Beyond. This is a very fast and abridged but hopefully fun comprehensive crash course into physical access control systems. This is not only going to talk about RFID. A lot of people like to focus on RFID. And that's just the very tip of the access control iceberg. And so we're going to be jumping around a lot. We're going to be talking about a lot of different things. I hope that it all makes sense. This is normally content that it takes me two days, two eight-hour days to train folks on. I just spent the last few hours collapsing it all into 80 minutes or less. So fingers crossed. If there's any questions, there will be time at the end. If not, with me in front of the microphone, certainly with me standing right over there behind the table so there won't be a problem. So without further ado, let's get started. Who am I? My name is Babak Javadi. I'm a lock picker, hardware hacker and covert entry instructor. I have been teaching methods of covert entry for over ten years. I'm the co-founder of the Open Organization of Lock Pickers, otherwise known as TOOL. Who knows about TOOL? Yeah, that's right. It's pretty awesome, right? It's amazing to me how much that organization has grown over the years and I continue to be thoroughly impressed by all of the people who continue to be so passionate about it. I served as the director there for about 13 years and finally decided it's time to let other people dump in their passion into the project so I have some room for some other things. I'm also founder and director of research for the Core Group. That is my consultancy. We specialize in penetration testing, reverse engineering and research just like about every other company here. So, not very exciting. Also co-founder of the Red Team Alliance. We specialize in physical security training and certifications and that's all I'll say about that. So let's jump right into it. Who has used an electronic door lock? Yes, that's right. When most people think of electronic door locks, this is what they think of. That's so easy. That's one of the main reasons why we use access control, right? It's easy for everyone. It's easy for the user. You get to pull out your card. You just wave it. Some magic happens and the door is open. It's great. From the administrative side, it's also pretty easy, right? If someone says, oh, no, I lost my card. No problem. Credential revoked. Someone decides they want to do something against company policy. They get terminated. Credential revoked. Very, very easy, right? You want to do time of day access. You want to only let someone in during the hours of 8 and 5. No problem. Just punch that into the access control system. It's all taken care of. Very, very easy. But ultimately, anything electronic, there's some feedback, isn't there? Is that bothering anyone else? I want to make sure you all are comfortable. Yeah? All right. I have to pick the right distance somewhere between like here, deeper. I've got to eat the ice cream. All right. We're going to do our best. So anytime you have something electronic meeting physical, there has to be an interconnect, right? Where the electronic world meets the physical world has to have an interface of some kind. And when it comes to modern access control, that comes in usually one of three different ways. So first you have this. What is this? What are we looking at in these photos? Can anyone tell me? Electrified strike. That is correct. So this would take place of the existing strike plate. And it's a little solenoid in there. Whenever you apply a voltage to it, it allows the little strike thing to swivel out of the way and you can just pull the door open without even turning the handle. What's this? Mag lock. Yes, magnetic lock. Two-piece construction. You have an electromagnet and the giant boxy thing on the right. You have a steel plate and the boxy thing on the left. And when you apply power, they stick together really, really, really well. That's also very, very popular. Third kind is an electrified lock set. This is an example of an electrified lock set. So this does not use an electrified strike or a magnetic lock plate, but rather has a solenoid hidden inside of the lock. And I used to have a photo of this, of a different lock. This was the official manufacturer's photo. Does this photo bother anyone else? No? What bothers you about this photo, sir? What's that? Well, there's a lock. Okay. Red and black wires really in general should never be designed to go right into each other. That just seems like bad design. But that is the official manufacturer's photo. But regardless of all of those things and all of these cases, what's happening is you have a source of power, whether that be a transformer, AC or otherwise, and a backup battery perhaps, if the crap has really hit the HVAC system, so to speak. And these are powering these secure entry and exit devices, whether they be mag locks or electrified strikes. The simplest form can be sometimes seen in your friendly neighborhood cheap discount jewelry store. If you have ever walked up to a store where the door is locked and you have to like knock on the glass or press a doorbell and someone like presses another button underneath the counter, that's not access control that we're talking about today. What we're talking about is something a little bit more common in enterprise. So this is a better example of what we're talking about in terms of physical access control systems today. What we're looking at is a door controller. What is a door controller, you may ask? A door controller is a fancy term for embedded Linux device with some relays on it. That's about it. So this door controller is actually what's in charge of all the logic that takes place in an access control system. Every time you use the door, every time you open a door, every time you close a door, every time you present a card to the reader, there is a signal or a series of signals of some kind that is monitored by the door controller and that's making decisions. The most common type of input into a door controller is what? Credentials, of course. So I'm going to go ahead in parts of this talk, I'm going to insult your intelligence a little bit, not literally, but I like to use analogies. I like to use analogies because it demystifies how opaque some of this technology is. I want to really break it down into the simple, simple building blocks. So if this seems overly simplistic, I hope that you're not too bothered by it, but I do know that for a lot of folks it helps kind of drive the point home. So we are going to, and I'm going to have trouble with this word, anthropomorphize. Someone help me out here. That, what these groups of people here just said, we're going to do that to the access control system. And here are our players. We have our RFID credential in the lower left there. His name is Alberto. And we have our RFID reader as a security guard. That executive manager person over there, that's the door controller panel. And of course our electrified strike is played by the door hardware. Pretty straightforward. So, basic idea, door, the card reader is always going to be interrogating the credential, whatever that credential is. It's going to be saying hi, who are you, over and over and over again. The credential is going to identify itself. It's going to supply a means of identification to the card reader. The card reader is going to interpret that response, convert it, and sanitize it into a format that the door controller can understand and send that information to the door controller. The door controller receives that response, processes some logic. It says, hey, I know who that person is. I know that card number. I'm going to go ahead and let that person in and I'm going to fire the electrified strike and that's going to let them in. Pretty straightforward, right? That's the whole system in a nutshell. So, credentials are one type of input that goes into an access control system. Of course, credentials, we're going to talk about them a little bit more in depth in a moment. They come in a couple different formats. They can be something you have, something you know, or in the case of biometric systems, something you are, such as fingerprint, iris, facial, all that stuff. These are all different forms of inputs that go into the door controller. There is another really common type of input. We're going to get that out of the way first. It's this. Who can tell me what this is? This is a REX, otherwise known as a request to exit sensor. This is the most common use of this type of sensor. It is basically a fancy name for a motion sensor and that also gets tied into the door controller. And there's a couple of different ways that a REX can be set up. The most common type of way, show of hands, who has ever walked through a secure door and as you approach the door, the door unlocks? Yep. So that's using a request to exit sensor. Here's the basic concept behind it. Here's a request to exit sensor right over here. So our credential comes, or user rather, comes along. The sensor says, hey, I see some motion. Someone is probably trying to leave. Let the door controller know. Door controller says, hey, there's motion on the secured side of the door. We're going to go ahead and let them out. Fire the electric strike. They can exit. Easy peasy. Now here's the thing. This guy doesn't have a great vision plan. He can't see very well. So as a result, you can kind of trick him sometimes. And a lot of folks have probably seen this, but I want to show it to those who haven't just again to drive the point home. Here's a couple of examples of how you can do that and how you can mess with that. So what did we just see happen? We were standing on the secured side of the door and our friendly neighborhood doctor Tran himself used not a credential. What did he use instead to enter? Can of air. That's right. So he's turning that upside down, spraying it through the gap in the door and magically the door opens. Here's another example. Research lab in Philly. I'm showing my colleague how this works and trying to teach him building owners to standing behind us. And initially he's using it wrong. And so I have to correct him a little bit. And notice we're not interacting with the card reader on the right at all. We're just interacting with the gap in between to get into that particular lab and he's going to go ahead and spray that, turn that upside down and doors open. Well, why does that work? That's really dumb. Like this shouldn't be a thing, right? And it works all the time. You can do this in a couple of different ways and we're not going to go in depth into all of them. But basically the most common type of the sensor is called a PIR sensor. Anyone know what PIR stands for? Yes, that's right. Passive infrared. Infrared is really good at detecting a change in what? Heat. Right. So heat is a 2D heat map, right? So they're very good at detecting change in heat. Now the problem with that is if you folks in the audience saw the sensor and I take one step back or one step forward, has the 2D heat map that you can see change in an appreciable way? No, not really. I got to do this, right? So as a result, in order to prevent users from running smack into the door, they have to turn the sensitivity up really, really high so people can get in really, really easily, right? Because you don't want angry users. So as a result, they're very, very easy to manipulate. There's another type of sensor we're not going to get into really much. It's called RCR or range controlled radar, also known as microwave. That detects change in distance. It's very good in this forward and backward direction. Not quite as good as the side to side. And so these RCR sensors are usually dual technology sensors that incorporate both infrared and microwave and you have to activate both in order for it to fire usually. You'll see these all over the place. They'll be mounted above door frames, on the side of door frames. Sometimes you'll see them like in really, really high up places. Like take a look at where the sensor is here. It's all the way up top in this corner. And because you have this huge, wide hallway, we don't actually have to be very close to it in order to trigger it. Now, you don't have to use CanDare. Here's our colleague Dave Kennedy. And what he's going to do is he's just going to use his fancy physical security compromise tool in his hand. What is that? Yeah, it's a vape. Pretty straightforward. And it's our favorite door. And he's just going to blow right through. It's not going to work the first time. So he's going to give it another shot. And on the second draw, that vapor is just hot enough and warm enough to go ahead and activate that door. And we're in. Of course, if you don't vape, maybe you like whiskey, right? Here's my business partner, Deviant, out on a night on a town. And he's looking at this ATM lobby. And he's like, hmm, I don't feel like using my card. I'm just going to go ahead and do that. And the door will pop open. And again, you can use a lot of different varieties of substances to do this. But this is just one type of input in a access control system. So there's a couple of things that we need to consider when looking at an access control system. We have our credentials. And they can come in a variety of different formats. We're going to talk about that. We have our readers. They can also come in a variety of different architectures and formats. We'll talk about that as well. We have our door hardware, whether they be mag lock or electrified strike. We have our motion sensors and door contacts. We will talk about door contacts in a bit. We have our door controller, which all this is connected to that makes the logical decision. And of course we have our administrative software that door controller has to know which users are allowed to get in and which users are not. All of this is one happy family, right? Hmm, kind of. So each one of these links speaks a different language. And that creates some really fun security situations as we will find out. So when most people talk about RFID, what they're actually talking about is only that first link, right? When most people think of RFID, they're actually thinking of the whole system, right? They're like, oh, that whole thing is RFID. No. False. Only that very first link is RFID. Like I said, RFID is the very tip of the access control iceberg. So whether you have Prox, MyFair, iClass, MagStripe, who's a what's it, biometric, doesn't matter. It's still all only talking about that first link. So let's talk about that first link. Let's learn a little bit of the history of access control. Who's heard of WeGand? Yeah. Who knew WeGand was a person? A couple people. Impressive. So let's learn about John Richard WeGand, a very badass OG German hacker born in 1912. Immigrated to the U.S. to study choral conducting at Juilliard, right? Huge music nerd. And while he was there, you know, in order to reproduce music, you have to use what? Speakers, right? So he became really interested in audio amplifiers and through that electromagnetics. And he went through a couple of different really interesting jobs. He, for a while, made tape recorders for the U.S. government and stuff like that. And eventually he became so interested in electromagnetics that he made some really interesting discoveries. He came up with something called WeGand wire. Originally patented 1974. Very old technology. You can look up the patents yourself. It's really, really cool stuff. To put it bluntly, it is a little piece of wire with a soft inner core and a hard outer shell. Now that may not make any sense. You might be thinking, Bobik, metal is hard. What are you talking about? Soft metal. That doesn't make any sense. Well, what we're talking about is relatively speaking, right? So if you ever take a paper clip and you bend it back and forth, what happens to the material right before it breaks? Yeah, work hardening. It gets brittle, right? Its characteristics, its physical characteristics change. And you can twist wire and you can do interesting things to it such that the outer shell, the outer layers of the wire become more hard and more brittle than the inner layers. And when you do that to certain iron alloys, really interesting things happen. We don't have to get into the science really, really deeply. However, weekend wire is literally pieces of wire embedded in a plastic card, drum or encoder of some kind that passes by two permanent magnets with a sense coil in between. And as it passes in between, some really cool stuff happens inside the wire. Basically the outer core of the outer surface of the wire magnetizes first, then the inner core magnetizes and as you pass the wire past the second magnet, the inner polarity, the magnetic polarity of the inner core flips and that flip is actually detected as an electromagnetic pulse by the sense coil. And that's actually how original systems worked. This is an example of an original weekend card, okay? So the original access control cards, when access control, modern access control was first invented, were not proximity. They were swipe cards, not mag stripe. We'll talk about that in a moment. And they literally had two rows of wires. The wires physically represented the zero bits and the one bits. So as you slid this card through the reader, they would pass over two different read heads and those wires would physically produce little blips on the line, right? So here we have 26 wires in the card and as you slide that through the reader, there's a data zero and data one line. It's a five volt signaling protocol and every time a little wire passes by the sensor, one of those signal lines is shorted to ground for a very short amount of time and a signal is sent down the wire representing zero or one. This became very, very, very popular. So it was invented in 74. By the 80s, it was considered leading edge, best of the best. And by the mid 90s, this thing was everywhere. It was widespread. Everyone was using it. I mean everyone. To such an extent that by 1996, SIA, the security industry association adopted it as the official standard communication protocol for card readers and door controllers. And everyone began to use it to make things backwards compatible. So I want to show you an example of what weekend wire looks like because it's not something you get to see very, very often. And we're going to place this here. And let's see if we can get our camera working. We'll do... there we are. We'll do this. And we'll flip over to duplicate mode. All right. So what we have here is just a neat little demo tool that we've created. All right. This is an original weekend swipe card reader. And we have a weekend card. Now, for those of you that can't see, you'll notice that as I tilt it, you can actually see physically something embedded in the card. And what I'm going to do is I'm actually going to shine a flashlight through the bottom. You'll actually be able to see the physical zero bits and one bits. So you can actually see as we move the flashlight, there's literally wires embedded in the card. And that's actually what's going to be detected by the reader as I swipe this through. So we're going to go ahead and try that. And that's it. And so this screen here is a little decoder. It's going to take that, those little blips of weekend data and it's going to try to decode it in a number of different human readable formats. Now, here's what's interesting. We're going to talk about this a little bit later in the presentation. Notice how there's 36 bits, but there's a number of different ways to decode them. There are different facility codes and card numbers. And these are all just different ways of decoding the same physical data. So we're in a little bit going to talk about bit formats and how it's kind of a nightmare when it comes to access control. And that's a very important thing to understand about weekend cards. So we'll go ahead and minimize that. And let's talk about another old technology because context is really, really important. You might be thinking, man, we're in wireless village. Why are we talking about weekend? Because you got to know where you came from before you know where you're going, right? So let's take a look at a magnetic stripe card. One of these guys here, right? So we'll again switch back to our camera. Here's our mag stripe card. We'll go ahead and pop that into focus. Increase our exposure so we can actually see what we're doing. All right. So mag stripe, I like to think of it as fancy bar code. Not literally. It's not quite the same encoding, but it is close. What I'm going to use is pretty cool stuff. It's really, really basic, actually. This is magnetic developer, which is just a fancy way of saying really fast evaporating solvent with really, really tiny particles of iron in it. And I'm going to drip this on the card and you're going to again see the physical representation of that credential data encoded on the card. That is not my favorite example, but you can actually see on the left-hand side especially, you can see where that strip has been magnetized and where those iron particles are sticking. Again, these are all just different ways of physically encoding logical data, right? So if you have a card number, say 1, 2, 3, 4, 5, 6, there are different ways you can encode it, right? We can use weekend wire. We can use mag stripe. We can use a bar code. We can use a QR code. We can use a key pad. These are all just different ways of physically ‑‑ man, sorry, guys. These are all different ways of physically encoding the same data. And this is what we need to keep in mind when we talk about RFID and access control is ‑‑ let's go back here. There we go. These are all just different ways of saving different types of data on a physical card. How many different ways are there to save data? A lot. This is a really, really awesome website that one of the Proxmark developers created, cardinfo.barkweb.com.au. And just to show you what it looks like briefly, I wonder if I can zoom in. Let's see. There we go. So this is just 70, and this is not all inclusive. This is just 70 different card formats. These are weekend bit formats. And if you look, there's a lot of these that are the same number of bits long, and they all represent different ways of encoding the same data, right? So, for example, I just clicked on a random one. This is ATS weekend 32‑bit. This is 32 bits of data. And they're saying when used with an ATS system, we're going to use the first 12 bits as the site code or facility code, and then we have a card number, and then we have some parity bits as well. And, again, we are not going to be dealing with that a whole lot, but what's important to understand is these are the physical bits that are encoded on the card, and the card number is just how that particular vendor decides to decode that weekend information and is something human readable, right? Because a sysadmin or physical security person, they're not going to be sitting there typing in 47, 50, however many ones and zeros for each user to encode their credential, right? They want to just encode card number 4256 or card 555137, and they want to be done with it. So these are just different ways of representing that raw data as something that we can more easily and colloquially understand as we use our access control system. So let's take a look at a modern credential, right? So things ‑‑ that system became really, really popular, and they said, hey, this weekend stuff is awesome, but we have something new for you, right? So we've got this new awesome card reader, it's a prox reader, it's a whatever reader, and the best part about all this is, is you don't have to rip and replace your existing system. You can take it, and it's backwards compatible. You can keep your same door controller, and all you have to do is replace your card readers and your cards, and it just works. Isn't that wonderful? Yeah. It is and it isn't, right? Saves you a lot of money, but it means that even today in 2019, we're still using a communication standard developed in 1974 for transporting credential data. How awesome does that sound? Yeah. Really great. So let's see how things changed over time. So again, we're still just dealing with card numbers. We're still just dealing with different ways of physically encoding that credential data. Let's look inside of an RFID tag, right? What's inside of an RFID card? It's literally a chip and an antenna, and we are going to zoom in and focus here. All right. So here we are. These are two different credentials actually physically placed into the same piece of plastic. So we have a low frequency traditional prox credential. That is actually the thicker antenna in the middle. And then we have a high frequency, high freak, 13.56 megahertz credential. It happens to be I class. That's actually the thinner antenna around the outside. Generally speaking, you're going to find that low frequency readers and cards are going to use more turns, more loops of wire, and the higher frequency uses a shorter piece of wire. So fewer turns of wire. So one of the easiest ways to tell if something is low frequency or high frequency is literally just to shine a flashlight through it and see if the antenna looks like it's low frequency or high frequency without even having to connect it to your prox mark or anything like that. So when we talk about prox, as I mentioned, we are talking about credential to reader communication. So there are different types of credential readers. They represent different types of technologies. Here in North America, we have a couple of really, really popular low frequency and high frequency credentials. On the low frequency side, we have prox and DALA, IOPROX, EM and AWID. Those are less popular, but they are still here in North America and Europe. They have a lot of other credentials that they like to use. On the high frequency side, we have some other common brand names, HID I class and NXP My Fair and stuff like that. And we already talked about this, right? What's happening here? Well, when we talk about cloning a credential, what we're doing is we've basically learned the language that the card and the card reader are speaking. And so what we do is we pretend to be a card reader, right? So we go and we talk to the credential and we say the same thing the card reader says to it and says, hi, who are you? The credential identifies itself and now we have that information. And as long as we can produce it in the same way and reproduce that signal for the reader on demand, then the reader has no way to discriminate between an original and a clone, right? So we approach the reader, we present our credential, we can say the same thing. It's kind of like a replay attack basically, right? That's what a clone is. A clone is a delayed replay attack and everything works as you would expect it to. The most common type of tool that we use today to do this is the Proxmark 3. That's not this. This is the original Proxmark. It's gone through a couple of iterations. Originally designed by a student named Jonathan Westhues back in 2006, really 2004 and then he kept developing it, made the Proxmark 2, made the Proxmark 3, open sourced it and then people had this wonderful contraption to drag around with them. Here's mine with the hand-wound antenna that I had to make to make it work. And then eventually it was remixed a couple of different ways. If anyone saw Iceman's talk yesterday morning, he actually went really in depth into all the different hardware revisions that have been out there. But we have the Proxmark 2 and it had some really good antennas. Then there was a Proxmark 3 RDV3. Then now we have the current, in my opinion, best iteration, which is the Proxmark 3 RDV4. This is the same base hardware remixed to be more stable, more efficient in its use of physical space. So it's very, very compact. The antennas are really beautifully built into it and it's really just a delightful, wonderful package. So that was co-developed by Iceman and Proxgrind of the RFID research group. You can buy them at Hacker Warehouse. They're really, really awesome. So yes, you can use a Proxmark like this. You can use it in simulate mode. Here's one of my original Proxmark 3s way back in the day and I can do that. And that's really, really great, but that's not very practical, is it? So let's take a look at an example of what cloning a low frequency credential looks like just so folks can see what I'm talking about. So what we have here is we're going to connect our Proxmark 3. We have some credentials. Once I find the little plastic bag where the credentials are. Let's see. Here we are. All right. So we have our credential. And just to show you folks what we have here, this is a simulated access control system very similar to that more beautiful one and larger one that you see in the case over there. So we have two card readers. We have a real live genuine door controller making all of our decisions with some credentials cached and programmed into it. And of course, what demo is complete without very pretty, pretty lights, right? So we have those two. I mean, it looks pretty good, right? It's not bad. So let's take a look. And we have our Proxmark 3. We have our credential, right? We have our baggage handler that we're going to target. And at the moment, this credential will go ahead and open that door. Ooh, ah, right? If you want to make a door controller go or a door rather and card reader go green, you too can do that. We're running a CTF right now where you too can try your hand at cloning some credentials and seeing how many points you can accrue. So we have our Proxmark 3. We have our credential, but that's not enough. We also need to run our client. So I'm going to very awkwardly try to do that while using this microphone. All right. And if I don't move, it will work. So we have our Proxmark 3 client. This talk is not about how to use Proxmark 3. So we're going to go pretty quick. I'm going to use a command called LF search. And actually, I'll make it a little bit easier for you folks to see what I'm doing. I'm going to go ahead and bump that font size up to 20. And hopefully that will be less awful. Is that less awful? Yeah? Okay. I'm seeing some nodding. That's good. So we'll do LF search. And oh, my goodness, we found a Prox tag. Yay. And what we can do is we can just go ahead and grab that raw data. And we can use a different command called LF HID sim and that. And in theory, if all went well, there we go. Green. But that's not ‑‑ it's really easy. Trust me. I know you want to clap because that's the polite thing to do. But I'm sitting up here going, no, don't clap for that. But thank you. So let's talk about something a little bit more practical than that. Let's see here. Oh, that is the wrong presentation. You will see that at the end if we have time. We'll go back here. And we'll jump back. So we saw how we can clone a credential just by simulating it. And there are a lot of different credentials out there. We have Prox by HID. Sometimes their cards are labeled really, really obviously. Sometimes less so. Their readers are really, really easy to recognize if they're original readers. Although there are a lot of third parties that also make readers. There's another brand that they sell called Indala. Those are different credentials, different ways of encoding that same card number data. And of course their readers also look different. They look very cool in my opinion. They have that fun little four lights. And what's really important in my opinion, and this is something I go more in depth when I have more time usually, what's important to understand about these different readers is being able to identify them in advance allows you to tell what tools you need to bring with you if you're on an engagement. You need to do your proper recon on your target. Here's Kantech Tyco IO Prox. They have different tags, different readers. They all have a certain visual aesthetic that works really well. There's other tags, EM. They make them in a couple different formats. They make a couple different readers. Again, we're not going to deep dive into all this stuff because this is just a light overview of some of the different components of the system so you can see how it all works as a whole. We have AWID, Applied Wireless ID. They make their own special tags. They make their own special readers. But all of these things, these are just different ways of encoding the same data. So when we talk about cloning, you know, it's not really practical to hang a Proxmark 3 off of your badge holder. That's not really going to make you blend in very, very well, is it? So instead, we want to have a legit looking badge. And since we can't just take our badge, stick it in a copy machine and call it good, we're going to use the Proxmark 3 and we're going to use another type of credential called the Atmel T5577. This was not a chip that was originally designed for pen testers. This was originally designed for OEMs that were tired of making their own chips. They said, hey, instead of making your own silicon, you can buy our chip. You can make it emulate almost any credential you want. You know, you can change the frequency. You can change the data rates and the modulation. We don't have to worry about all that stuff because it's built into the Proxmark. And the Proxmark allows you to use that same T5577 to recreate almost any low frequency credential regardless of whether or not it's Prox or Indala or IOProx or EM or AWID. It's really, really cool. We're not going to go super deep into cloning other than I'll just show you really quick how that works. Actually, I don't have any T5577s in front of me. So for the sake of time, I'll actually do it with the same credential, which is not as exciting, I realize, because this is actually a T5577. So what I'll do is I will copy this, which is our original enrolled credential, and I will wipe the card first. And we'll make sure it's wiped by doing search. There's no known tags. So it does nothing. Oh, no. We broke our credential. Never fear. Proxmark is here. LF HID clone. And to check our work, we'll go ahead and do LF search. It says it's working. And that is basically how you would make a clone. And you can do that with almost any low frequency credential because these are all different ways. Yes, thank you. These are all different ways of encoding different types of data, different types of signals, but it's still following the same physical communication medium, right? So we're able to emulate different types of cards as long as they're all low frequency with this particular card. And that is really, really cool because you can actually get this in a couple different formats. They even make stickers and implantables. So you, too, can embed a T5577 in your hand if you want. And now you'll never forget your apartment key again. You can just wave your hand in front of the door and the door will open for you. They make them for MyFairCards as well. So if you want to open your hotel room with your hand, you can do that as well. Now, in the field we're not using a Proxmark. Proxmarks only work for very short distances. In the field what we do is we take a reader and we weaponize it. Ooh, ah, doesn't that sound great? Doesn't that sound hackery and cool? Well, it's actually very, very simple. Readers, remember, they take power and they take credentials and they spit out zeros and ones. That's it. It's not a bidirectional system. It's very, very simple. So that reader, once it gets that credential information, it's just sending that down the wire to the door controller. So when we talk about long range readers or weaponized readers, all we're doing is really just taking a long range reader that is used, say, for parking lots, for garages, any application where you don't want the user to have to get within two inches of the reader and you install like an Arduino or a Raspberry Pi or something just to record those ones and zeros. That's basically it. It's not a very complicated system, but it allows you to get very reliable longer range reads out of the device. I have to apologize. I realize I'm going pretty fast, but I am worried about getting everything done in time. So if you have questions, please forgive me. I'll do my best to answer them at the end of the talk. If you watch TV, you might have seen a show called Mr. Robot. Who's seen Mr. Robot? Yeah, they use a long range reader in the show. It's actually fairly accurate how they do it, although it's a little bit dramatized. They go a little bit over the top, right? So here we are. There we go. We won't make it quite so loud. Here's a scene that a lot of you folks might remember. They have their long range reader and, you know, he's getting himself psyched up. He's prepping and he does something that in my opinion is unnecessary. It attracts undue attention to yourself, but it drives the point home for the non-hacker folks out there, right? He kind of bumps into the guy physically and is able to read that credential. Of course in real life you don't have to do that. You don't have to get that close. You don't have to physically almost assault someone to get that credential information. And it's very easy to get credentials because credentials are usually very, very, you know, obvious, right? People are hanging them off their hip. You see them in trains. You see them in, you know, when people are standing in line. Very easy to get to. You see them where people are their most vulnerable. I wish I could say that I was better than the idea of not doing this, but I have to say that if you've ever been to a bathroom, a stall, you might have sometimes seen like a toilet seat cover dispenser, right? To make you feel a little bit better about using a public restroom. So you can actually buy those toilet seat cover dispensers and you can put RFID reading electronics behind them and then you go into the bathroom stall and you just kind of stick it with double stick tape as a convenience, right? You're offering a hygienic product to everyone. And in exchange for this toilet seat cover, all you ask is for a copy of their credential. And it works out well. People seem to be really happy with that exchange. So what about high frequency, right? What about these smart cards, these high end secure credentials, right? Well, again, I'm going to insult your intelligence a little bit because I think it's helpful to understand the main difference between low and high frequency. So if we pretend our low frequency credential is a piece of paper with a number written on it, right? We understand that we don't care if that number is in English or if it's obfuscated in some sort of weird wingdings type language. We can just take that piece of paper and stick it in a copy machine and as long as we produce another piece of paper with the same markings, it's going to work, right? So that's basically what low frequency is in a nutshell. As long as we're able to reproduce that signal, which is relatively easy to do, the reader is going to be able to talk to it because that credential information itself isn't protected really. It's just using a different communication medium. It's basically just a very fancy bar code. Now what we do when we talk about high frequency credentials, I'm going to shut this off for the moment. When we talk about high frequency credentials is we're going to take that piece of paper that has our very sensitive, secure credentialing information. We're going to fold it up. We're going to put it in an envelope. We're going to put that envelope in a safe, alright? And that's basically what a high frequency smart card is. It's a digital lock box. It's a digital safe for sensitive information and in this case it happens to be RFID. So this is actually a really cool example or analogy in my opinion because this particular safe has a serial number plate on the side and it has a combination to open it. So similarly, if you imagine that you could use a special algorithm and pre-shared secret key to based off of the serial number, which is on the outside of the safe, calculate what the combination is going to be, you can unlock the safe and get to the credentialing information, right? So if you're designing an access control system, you wouldn't use the serial numbers of the safe as the credential data, right? Because anyone can read that. You would try to protect it in some way. And when we talk about high frequency credentials, whether it's iClass or MyFair or Desfire, that's what we're talking about. We're talking about taking a credential information, putting it into a block of data and that block is read protected by a key, by a password, by some authentication mechanism of some kind. So by way of example, let's for example talk about MyFair Classic, very, very popular credentialing format used by a lot of transit systems, by a lot of events and by a lot of access control systems in Europe and abroad. So again, we're not going to get too technical into it because I don't think it's actually necessary to understand how the technology works as a whole. Here you have a MyFair credential memory map, right? So you have your credential and then the memory is broken up into different sectors and blocks. And in order to read those different sectors, you have to have the right key. So when you do cracking of MyFair, when you run MyFair dark side attack or the nested attack or this or that, these are all just different methods of recovering these keys that are on the card that protect the information encoded onto the blocks, right? So you would not use the serial number, which happens to be encoded in block zero. You would not use the serial number to run your access control system. Instead, you would store your credential in one of these other blocks and you would protect it with a key. And again, this is how all these different credentialing formats work. There is some method of authentication that is used that unlocks the card and that's what the reader is doing. That moment when you present your card to the reader, it's doing a little handshake, right? There's some mutual authentication that's taking place and it's unlocking the card and it's reading protected memory inside the card. So in order to clone that particular card, you actually have to figure out how to unlock it first. And so you have to either find the key, whether it's leaked or cracked or otherwise or find a way to brute force the key in order to clone it. We're not going to go in depth into how to do those things because again, this talk is talking about high level how a modern access control system works. So let's talk about another way that these things can be abused, right? So we've talked about how we have low frequency and high frequency credentials. But how does one switch from low frequency to high frequency? It's easy when you only have one system or one door because you go up to it on a weekend, you rip out all the stuff and you replace it and you're done, right? But imagine you're a company. Imagine you have hundreds or thousands of doors and hundreds or thousands of users. Is it reasonable to expect that in one weekend during non-business hours, you could go in and rip and replace everything? No, absolutely not. That sounds incredibly infeasible and impractical. So they make these things called migration readers. And I wish I had jammed a photo of a migration reader in here. I apologize that I don't have one at the moment. But imagine you have, it actually, this is a migration reader. This is an example of a migration reader. It reads both high and low frequency credentials. So again, by way of example, I'm going to go ahead and power this system on. I will grab the credential for it. And to show you that these are two different technologies, we remember that the airport credential, that was a low frequency prox card. What I'm going to do is we're going to pop back over to our prox mark and here we are. Here's our research assistance credential, Louise McDougall. And her credential, if I run my HF search command, you will find once it switches all the FPGA code, let's see if we can get that into the right spot. There we go. So this is an I class credential. This is a high frequency smart card type credential. These are two different technologies and yet we have both the old credential and once that door closes, we'll try our high frequency I class credential and we'll see that they both unlock the door. This reader can talk to two different technologies, both old and new. And the reason that exists is the idea is, okay, don't worry, you guys want to upgrade to our newest, latest and greatest technology. We got you covered. What we're going to do is we're going to sell you our migration readers. They can read both your old cards and the new cards and you'll slowly upgrade your readers at your own pace. And once all those readers are upgraded, remember meanwhile everyone's old credentials, they're still working, right? Once you've upgraded all the readers, then you can take everyone's credentials again at your own pace and you can replace them, right? Makes sense. Now here's the thing. After you do that, your fancy new reader can still read old ass credentials. So what that leaves you open to is what I call a format downgrade attack. This is something where you would take a secure credential such as a CEOS credential which is, hi. Datagram everyone. Oh, nothing. Just came up, said hi and left. All right. So you can take your secure credential and maybe you can't clone it but you can find a reader that reads it and remember, what does every reader use as a communications protocol to send credential data back to the door controller? WeGand, right. It still converts it to the same end format. So you can take this high security credential, you can read it with something besides the Proxmark, you can read it with a regular reader made by that particular company and then you can take that WeGand data, you can save it onto an older format card and now you can downgrade the format of the card to something that is more easily clonable and manipulatable and the door controller will treat that card the same way because there's no way for the door controller to know the difference between the different types of credentials that were presented at the reader. The reader doesn't give that information to the door controller. The door controller just sees 26 bits of WeGand, right. So that's also another important consideration. If you have questions about this, please feel free to ask. I'll do my best to clarify it. I know we're jumping around a lot. So let's talk about door contacts and sensors. We were talking about different types of inputs into physical access control systems. Whoops. There we go. So what we're seeing here is a tall door and we're going to use our mirror and it's really hard to see in this particular photo, but as we slide our mirror over, what we see here, let's see if it works, is the very edge of a little door contact and what that is, that's a little magnetic read sensor that tells the door controller the state of the door. How is that used? Well, that's often used as a way of detecting forced entry. So remember that door controller is always monitoring a bunch of different types of inputs. So for example, let's say you have a door that you're monitoring and you have a card reader on the secured side and you have a motion sensor like this on the other side, right? So what the door controller does, it says, okay, if I detect that the door is opened and there is no valid card read and there was no motion detected before the door was opened, what do I assume happened? What's that? I heard it. Forced entry, right? So logically, again, the access control system says, hey, this door has been opened. The door contact sensor is no longer in contact. I'm assuming the door is open. No one presented a card first and no one exited. So then it triggers an alarm condition. So again, by knowing that that's how the system is designed, we can take advantage of that. So what we're going to see here, here's a rec sensor. It is not used to automatically unlock the door. It is instead used to decide if there's a forced entry alarm or not. So what you're going to see is I'm going to use canned air and you can tell from the noise, where are we? We're in a server room, right? So we use the canned air to trigger the motion sensor and then we just slip the latch with some plastic. And because of this process, that video, you just saw an entry. But what did the door controller think took place? An exit, that's right. By simulating motion first before bypassing the door, we told the door controller that we're actually leaving instead of entering and so no alarm was triggered. How do you find door contacts? One of the easiest ways is to use a tool like this. This is really cool. This is a door contact sensor. That's what I call it. It's actually just a little magnet on a swivel. I'll show you what it looks like. Here it is. And basically any time it comes near a magnet, this little guy here points in the direction of the magnet and you can just kind of wave this around the edge of the door and anywhere where there's a magnet in the door, it will tell you that's where the door contact is. So if you're not as fortunate as being able to say just use a mirror to look into the side of the door and see that that door contact is there like this, and again, what we're looking at is right here. There's our door contact. By the way, in this example, we're about to try to break into this data hall. We see the door contact. What's the easiest dumbest way to bypass this door contact? Magnet, yeah. I didn't have a lot of fancy tools with me. We were overseas. So what I did is I just took out my hotel key card and I bent it at 90 degrees just to create a little shelf and I taped a magnet to it. I taped a magnet to it and I shoved that in the door and that was enough to bypass that sensor. So here our door into the data hall is opened but according to the door controller, according to the access control system, what is the current state of this door? It's closed. That's right. So these are all over the place. You'll see them on the top of frames. You'll see them on the sides of frames. Here's a really close-up photo of a door contact. What have we done to this door contact? Yeah, we stuck a magnet on there. But what did we do to make it extra clever? Our tape is in the shape of a circle. So unless I would have told you that, hey, this is a door contact that we bypassed, your average user is not going to notice that. And these are the small things about modern access control systems besides RFID that you want to be aware of in order to know, okay, what is the lowest, easiest path of entry. Oftentimes it's not the RFID card. It's finding a combination of bypasses to make the system behave or think differently. So we've talked about RFID and we've talked about how all these different credentials, whether they're mag stripe or smart card or high freak or low freak, these are all just different ways of encoding the same data that is stored on the card, right? And that's still sent over WeGand, right? So we talked about this. We talked about how this is all just different ways of doing the same function. But once that data leaves the reader, it's still usually WeGand. Now, there are other communication protocols that technically exist. They are not very popular. And even the other ones that do exist, with the exception of one protocol, which we will talk about, everything in red here, these are protocols that transport that credential information without encryption, without any protection. You can just connect to the wires and read that information. And this has been done for years. Like over ten years ago, Adam Laurie and Zach Franken, they came up with something called the Gecko. The Gecko was something that you would install behind the reader and it was a literal man in the middle. You would connect it to the WeGand data wires and you would try to read that information as it goes across the wires and then replay that information. And that's a very, very old technique. You don't even need a special tool to do it. You can use an Arduino or anything you want that can record and replay two minutes. Holy crap. They said 80 minutes. Someone said it was an 80-minute talk. Is that not correct? Oh, well, that's unfortunate. Okay. Someone in the audience said that it was on the schedule for 80 minutes, so that's why I had adjusted my talk. Okay. That's what the schedule says. That's what people are saying. All right. All right. Well, I will show you this last thing and then I guess if you have more questions, unfortunately, we'll just have to ‑‑ okay. So everyone is looking at their phones and they're saying 80 minutes. So I'm going to ‑‑ who's the next talk? Are they here? Okay. All right. So we're going to finish up this one section with apologies and then if you have more questions, please find me afterwards. So we can intercept the data. It's really, really easy. There's a couple different tools to do it. There was the Gecko. There was the BLE key a few years ago. One of our friends made an even better tool, Kenny McElroy, OctoSavvy on Twitter, he created this tool called the ESP key and the ESP key is the interception tool that you install behind the reader and it's a literal man in the middle, right? Look at that cool hacker looking guy, right? So that man in the middle is going to monitor those communications and as that credential information goes across the wire, we can replay that information. So what I'm going to do is we're going to skip through a couple slides as the very last thing and this is brave. I'm going to try to show you a demo of how this all works. You're going to watch me install one of these keys in the video and while that's happening, I'm going to try to set up my demo here and we're going to see if it works. Oh, video paused so I can't do that. So I'm going to fast forward through it. So we have our ESP key. I'm going to pop that out. I'm outside of a server room door. I have not disconnected the reader from the door controller. I'm just getting those data control wires out of there. I've got my power. I've got my ground. I'm just using a punch down tool to punch those wires down onto the wall there. And once it's all said and done and we're going to fast forward just a few seconds. Here we go. You can see our ESP key is turned on. And we're going to feed that back into the wall. And we're done. So this is a bold demo attempt in the wireless village. I'm going to see if this is even a possibility. If I'm able to connect to my ESP key or not. Or if someone is going to screw with it instead. Fingers crossed. Yeah, demo gods are not smiling upon us today. We'll try two more times. Nope. Yeah, of course. Wi-Fi village can't connect to any Wi-Fi. Such is life, right? All right. And last time. Nope. So in any other space but this one, we would be able to connect to our ESP key and be able to replay, intercept and replay that credential information without interacting with the card reader at all. Later on, I will try to have this working. I don't know how possible that's going to be with all of this stuff going on in the airwaves right now. But you get the idea. We can replay the information and that works. So let's see. I think that's going to have to be it. I can't think of ‑‑ we're going to shut this off. Let's see if there's any last minute great things that we can talk about in 30 seconds. Oh, yeah. I'll share one thing. There's an easy fix for interception. It's a new standard. It's called OSDP. If you install a new system, you absolutely 100% should be using OSDP. It protects the panel to server communication. It allows you to encrypt and secure that communication between the reader and the door controller. It's bidirectional so you can do cool things like preventing eaves dropping. It can do ‑‑ if you want to learn more about it, go to securityindustry.org slash OSDP or ask me more questions about it later. And then with sincere apologies, we're going to call that done. And I'm going to go ahead and put my contact information up on the slides here if you have any questions. We'll do this. We'll scroll all the way down. And there you go. Thank you. I'm really sorry that was so much information that we couldn't get through. As I said, this is normally two days worth of material that we tried to cram into just a few minutes. So if you have any questions, please come find me over there while Woody sets up his next awesome talk. Thank you again.