Okay. So, I'm talking about picking electronic locks using TCP sequence prediction. Welcome Rick. Thank you. Okay. So, I've probably met a few of you by this point, but I've been drinking a lot this weekend, so I don't remember. So, this is who I am. I've got a couple of security certs. I'm a network technician at Texas State University in beautiful San Marcos, Texas. And I've been working on their electronic building access systems, and in my spare time I've been breaking the electronic access systems. So, basically what I'm talking about is whenever people start talking about the security of these systems, it's usually involving the readers, like the RFID cards or, you know, vulnerabilities in biometrics and things like that. But nobody really concentrates on the network side of things. And a lot of these door controllers are moving to IP-based systems for obvious reasons in large organizations. But... There... They're networked devices that have little or no network security. They've got persistent TCP sessions with no encryption and predictable sequence numbering. So, what I wondered is, is it possible to send a spoofed command across the network and open the door without needing a card or a retinal scan or anything? And since you're seeing this presentation here, you can guess what the answer is. So, a brief overview of electronic building access. You've got your authentication device, which is your reader, and then you've got your locking device. And both of those are connected to a door controller, which is then connected to the network. And client programs can send remote commands to these, specifically locking and unlocking commands. And they also, you know, monitor the state of the door and, you know, alarm points and all that stuff. So, this is the part where I start using goofy diagrams to illustrate my points. So, you've got your client that's connected to a database that's connected to a door controller that's connected to some doors. So, the client says, I want to open a door. Wee! So, the open command goes through the database. The database sends it to the appropriate door controller. And the door controller opens the door. Now, what happens in this scenario? And you can tell he's the bad guy because he's red. Like a communist. Okay. So, same thing again. The client says, open the door. And now the attacker has a copy of that command. And, you know, then he forwards it on to the door controller. And the door controller opens the door. Just like normal. Everybody's happy. Hang on. Okay. So, now the attacker has a copy of the command. And some time goes by. And he says, okay, I want to open the door. And pop goes the weasel. The door controller interprets it just like any other command. And you'll notice that nothing happened on the database at all. So, there's no log of the command. No alarms are tripped because the door controller saw it as a valid open. Everybody's happy. So, the reason it works is because these devices have really, really predictable sequence numbering. That allows you to inject a packet into their session. Sequence number prediction was usually used in hijacking TCP sessions. But we don't really need to do that. We're just sticking our own packet in an existing session. It's been fixed in most modern operating systems. But embedded systems are still notoriously bad. Another goofy diagram. So, here's an example conversation between a sender and a receiver with sequence numbering. Can anybody see a pattern in the sequence numbering? I'd like to say this is a really simple example. But it's not. So, the attacker guesses the next sequence number in order. Sends a packet. The receiver says, yeah, that's the next one. The sender then tries to send its packet with that sequence number. And the sender's like, well, I already got that packet. Send the next one. So, now we get to talk about some code. Okay. So, I used the SCAPI library for the packet manipulation. This is really, really simple code. But, yeah. Basically, you just take two variables. One of which is the target IP of the door controller. And the other is the payload that you want to inject. And I suppose I should probably mention that I tested this on a... It's an HID door controller that's running Seaboard Squadron firmware. And I've actually talked to Seaboard about this. And they say they've got an update coming. So, we'll see. But, yeah. So, first things first. It takes the hex stream that you send to it and formats it properly so that it'll interpret it. And then you start sniffing some traffic so that you can get your IP addresses that you need and your window sizes and all that stuff. The important command, and I can't really highlight on here, but I'm going to point. Down near the bottom, you'll see a function, SR1. That's sending, receiving. And basically, at the end of that line, it says sequence plus 40. That's it. That's the secret. You add 40 to the sequence number. And then you attach your payload to the end. And, yeah. It opens the door. I don't get it. So, my conclusion is it's not necessary to break the authentication medium in order to bypass these systems. You know, these are network devices. And they need to protect themselves against network vulnerabilities. And it's not hard to fix. Like, you know, first off, what you can do to protect yourself is obviously put your door controllers on a separate LAN that your users can't get to. And monitor that LAN for man in the middle attacks. But really what it comes down to is the vendors making their sequence numbers harder to guess. And for the love of God, encrypt the traffic. Like, Seaboard at least says that they are encrypting. But I'm thinking, like, they might be confusing encrypting and encoding. Because, you know, the open commands, they always start off with the exact same hex values. And I don't care what the rest of the command says. I just know that that's the command that I need. So I just, you know, grab that hex stream and inject it whatever it says. And it does what it does. So, yeah, encrypt the traffic at the session level so that I can't see the sequence numbers. And that will fix it. All right. I don't know if that was 20 minutes. Thank you. Thank you. . If it's an incorrect sequence number, it just ignores it. Yeah. You can keep trying as much as you want. If it's a correct sequence number, then it ends up burning the session and, you know, redoing the handshake and all that stuff. But if it's an incorrect sequence number, you can just guess as much as you want. Sorry? It doesn't on the Seaboard system, or at least it does, but every once in a while, the sessions get torn down anyway, so it's not seen as an important event. hey, I've already, I've opened this door and sent it back to the log file? It probably could. I mean, again, the normal events aren't really paid attention to. Like, anything that's normal activity isn't really flagged, so. How often do you find that an LMS is locked on the same thing as a regular network? Hopefully not often. I mean, we set it up like that originally until I started messing around with this stuff and now we've taken them off of the networks. But, I mean, you know, it's really easy to put these door controllers in a comm room and just plug them into the network. So it probably happens quite a lot. Along with that, do you prefer, perhaps, because these are used to say, buy things on campus, would you spoof to say your car has more money? Maybe. I haven't really messed around with the point of sale side of things. So I'm not really sure. I mean, this is really, really just scratching the surface of the vulnerabilities in these systems. So. All right. Thank you.