Okay, good afternoon everyone. It is now the top of the hour, 12 p.m. in beautiful Las Vegas, Nevada. Welcome back to the Packet Hacking Village. Thank you so much for being here. And now we have a fantastic, fantastic guest speaker. We have a fantastic speaker here. Kyle Kosher, researcher at the University of California, San Diego, who will talk about snipping skater. It is my honor to bring Kyle Kosher. Hello. Hello. Hello. All right. So I'm Kyle Kosher. Today I'm going to talk about sniffing skater. So this is sort of a fun side project that I've been doing. So mostly I do research on security for embedded systems, and I'm starting to get into wireless and things like that. So this was sort of a fun side project for us. So first, as a quick introduction, in case you're not familiar what skater is, it stands for supervisory control and data acquisition. And that's basically just a boring way of saying it's systems that remotely monitor and control industrial systems. So things like power grids, water supply systems, oil and gas systems, things like that. So it covers a lot of critical infrastructure and things like that. And it's starting to become a hot thing now. So last year, at DEF CON, they had the ICS village. I think it might be here again this year. They had it at RSA this year, demoing it there. At the National Collegiate Cyber Defense Competition this year, they had their own set up there. And the student teams tried to protect their fake skater systems there. And it's gotten to the point that the, you know, the, you know, the, you know, the DEF CON CFP and Black Hat CFP reviewers are getting tired of skater talks. And I guess also Internet of Things talks. So it's getting old. But it's, you know, these issues have been around for a while. So there was a talk at Black Hat back in 2006 about all the various ways that these skater systems can be compromised and all of the fails that these people have been able to find in their professional pen testing services. And so some other people have done mass scans of the Internet and looking for open VNC servers. And you'll see some crazy things like, I think, I'm not quite sure what this is, but it looks kind of dangerous. There's some water filtration system, I think. We have some power generation or power transmission. And they're using it for some reason. I think somewhere in South Korea, maybe. I don't know. And you even see things like, you know, a control system for a skating rink or hockey rink. And so there have been a lot of people looking at skater, but they've mostly been looking at it from the IP angle. But skater systems aren't just on the Internet. There are many other ways that you can talk to them. So a lot of skater systems still go over these legacy serial lines. Some are connected through dial-up modems. Or some go through lease lines, dedicated copper, things like that. And some go over RF radio links. And so what you see here is actually a distribution transformer here. And there's a little box here that is doing the monitoring and control of this transformer. And that is actually going up to this pole to this antenna, which then radios back to the central control station. And so we were interested in, so these are all over San Diego. And we were interested in what exactly these are doing and what you might be able to do with them and whether they were secure or not. So the first thing we do is go to the San Diego utilities website. And helpfully enough, they have this section on their website called standards. And they have a lot of information about what they can do with standards and manuals. And this is what they provide contractors, construction services, things like that, for their specs for how to build the utility infrastructure in San Diego. And so you'll see fun things like here's a diagram showing how to build a pad-mounted transformer here. So you have this pad-mounted equipment. And then you have a lot of information about what you can do with it. Actually this is a control switch so you can switch on and off power and redistribute power, things like that. So monitoring goes back here to this box where the control for the switches are. And then that goes up to this antenna. And it tells you all the things that you need to buy and install or obtain for this. And the one thing that we found was interesting is this line here, which says MDS radio. And so this is a place where you can, you can like, hmm, what is this MDS radio? We'll get to that in a minute. The second part of this equation is what frequency are they transmitting on? And so we went to one of my favorite websites, the FCC universal licensing system, and we were able to look up all the licenses that they have for this equipment. And so most of this equipment is running in some of the pager bands, and so they're reusing that for doing this two-way communication, and so we can get some of the links here. And as you'll see later, some of this protocol seems kind of old school, and you're wondering, like, why is this, you know, back from the day when people didn't consider security or not? Well, no, you know, they granted this license in 2005. Maybe you would consider that old, but here's another new license that was granted in 2013. So they're obtaining these licenses, and they're building these things up. And as you'll see, it's not that great. So now focusing our attention on what that actual MDS modem is, we go to another favorite site of mine, the FCC Office of Engineering and Technology Equipment Authorization Database. And so on every device sold in the U.S. that transmits, it needs to have a... equipment authorization from the FCC. So it'll have an FCC ID. And so we can go on to the GEMDS website and obtain the FCC ID from there. And then you'll get all sorts of fun things. And most of the time, the really juicy things, like the theory of operation, the schematics, all that stuff are held back from public view. But there was one that I think they mistakenly let through which talks all about exactly how the modulation process goes. It has a block diagram of their transmitter and receiver. And it even included a full description and theory of operation of how the radio worked down to the individual part number. So it said, like, U16 is a power amplifier, U22 is a DSP chip, blah, blah, blah. I'm going to tell you exactly how this works. And so we started poking around the error. And we found out that there was a problem with that. And so we were trying to see if we could actually decode some of this information based on the information we found on the Internet and what we were able to sniff over the air. So for part of that, the one other thing we got off the Internet is we went on to GEMDS's website. And they just have firmware for these radios available to download. And so you download them. They're Motorola S28 hex files. So you can just load them into your favorite hex editor, and you can start pulling it apart. On that image are actually two firmware images. One is for the main Motorola HC 11 microcontroller, which does sort of the higher-level management stuff. And then there's a lower level of DSP controller that actually does the modulation and demodulation on that. And there's even a does all the modem stuff. And it was kind of hard to figure out exactly which part of the firmware was for DSP and which part of the firmware was the HC11 and where things were and things like that. So we were in IDA Pro and trying to figure this all out. And it was kind of baffling looking at the DSP code and then we realized we had some byte ordering issues. And so after we swapped the byte order, suddenly things started making sense. And so actually one of the crazy things about this DSP chip is that there are, I believe, three different memory spaces. So there's program space, there's X space and Y space. And so many DSP microcontrollers are super optimized for doing signal processing. And so this thing can do like three operations simultaneously. It can like multiply something from X memory, from Y memory, add them together, put them back into X memory or Y memory and things like that. So we started dumping what we thought was X mem and Y mem. And we graphed them as floating point numbers. And some interesting things immediately pop out when you graph these bytes as numbers. And you see sort of these squiggly waves here. And so what these are actually, these are actually, these are actually what those are. They are the filter tap coefficients for the incoming and outgoing signals. And I'm not going to get into a whole lot of detail about how that works. If you're really interested in that, tomorrow at the wireless village I'm going to talk more about how RF actually works and how you modulate and demodulate bits. And so, you know, we found some more of the these. And so, from there we could actually reverse engineer some of the filter parameters that we were interested in, blah, blah, things like that. Once we, once we put some of these filter parameters into GNU radio, it really cleaned up the incoming signal that we were getting off the air. So the way that these modems work is they are, you know, they're very simple. They are 9600BPS and they generate audio which is then FM modulated over the air. And so in GNU radio you can just build an FM demodulator block, just drop that in and then you can look at the waveform and see what it looks like. And after you apply some filters, you do get some things that look pretty nice. So you see this, uh, repeating, uh, sign wave there. That looks pretty regular. That's the, the preamble. That is what, um, well, this experiments you're kind of done. These stuff, they, I don't know, are going to be lock on to the signal and get a precise timing on here. Now the interesting thing about the modulation scheme used on this radio is it uses something called dual binary. So normally when you have digital modulation schemes you have either a 1 or a 0 or if you have some crazy things you can have like 16 different points or 4 different points. Different things like that. Well this has 3 different points that it can be. It can either be plus 1, minus 1, or 0. And there are some theoretical reasons for this that I won't go into. But basically what you can do is you sample these at bit intervals and you can recover bits out of that. And we wrote some software that we'll make available to do that. But that wasn't, that wasn't all of the challenge in reverse engineering this. The other challenge was figuring out exactly what these bits mean. And so a common technique that is used to whiten the spectrum and basically make it more efficient and robust and make it have some nicer signal properties is they put the raw bits through a data scrambler. And so what comes out, what goes into that is the data scrambler. And what goes into the modem is basically a pseudo random stream of bits. And so we didn't know the scrambling function. And so at this point, like, okay, we can recover this in IDA Pro. But it's a pain. So how hard would it be to actually get one of these modems. And for a while we felt like this was cheating. This was, you know, we wanted to just reverse engineer it totally based on information we got over the internet and sniffing over the air. But as it turns out, you can just go on eBay and there's one for 50 bucks. Now, you might point out that that's a bit. That's the starting bit. That's not the actual sale price. Well, you can go to a buy it now one for 115 bucks and just obtain it. And so we obtained one of these. And it has this nice RS232 interface. Has a DB25 connector. It's not standard. They do some crazy crap with that. Takes 13.8 volts in. It's kind of esoteric. But it's relatively straightforward to interface with. So we started sending some test packets. And this is sort of this debug view that I have out of my GNU radio demodulator. And so what we did is we started sending some test packets. So this is, I believe, the character A and this is the character B. And I spent a fair amount of time just staring at this trying to figure out what the bit differences were. And from there we concluded that the packets are really simple. They have this simple preamble that indicates whether it's coming from a master station or from an out station. They support the out of band management. So you can send commands to manage the radio as opposed to pass through directly to the electronic control systems. For packets coming from an out station, there's a bit that it can send to say, I'm done sending. Don't try to decode anything more. And it had a really simple linear feedback shift register that it would use to generate this data. So that's kind of the way we've been doing it for several years. So once we found some of these parameters, then we went back into ITAPRO and tried to tear the firmware apart, try to figure out how the de-scrambling worked and things like that. And so now that we have data out, we wanted to look at what was actually going over the air. And so there are two major SCADA protocols that are generally used over these systems. One is an older one called Modbus. But the one that is used in San Diego is called DNP3. And these are pretty old standards that are designed to work over multi-drop serial lines. So you'll have basically imagine a shared bus where multiple things connect. And there's like one transmitter and it'll transmit a packet and everyone will receive it and look at the ID and see if it's for them. If it is, then they'll process the request and send a reply back on this bus. And so these RF links sort of emulate that situation. What these protocols let you do is they let you read values out of sensors. You can use them to they can, you can pull these systems for changes in values. You can actually send control signals. So you can send a signal to say turn a switch on or off. Or for some systems you can like adjust a pressure like a gas vessel or something like that. And interestingly enough, as we learned, these are fully supported by Wireshark. And so it is actually as simple as this to sniff SCADA. You just plug in this modem that you got off of eBay. You cap the serial device. You packetize it through Netcat. And then you go into Wireshark. You listen on the port that Wireshark expects for DMP3, which is port 20,000. And then you get all these fun things. You see all these responses from these outstations with different IDs going back to one, which is the master station reporting back all of their values. And so what the master station is doing here is it's pulling all these outstations for changes that come in. And so you see all these response data objects here. And you probably can't read it here. Probably post these slides and also show you some other things later. But the, some points to take away here is it has, you know, a time stamp here. It says I have a bunch of analog change events. And here are the new values and they're all stamped and things like that. But now the question is, like, okay, well, it says .25 changed to negative 6800. What does that mean? And so this brings us to the final part of the project, which is figuring out what all of these points actually mean. So backing up a bit, DMP3 defines these different object types. And you can, like, analog events, binary events, things like that. And you can read and write these objects, pull for changes. The tricky part is figuring out what these points are. But helpfully enough, our friends at San Diego Gas and Electric put these labels on everything, including the exact model number of the switch that they have, the voltage that it's running at, all sorts of things, like, the value of that. So then we go back to our good old friend Google. We put that in for the manufacturer of, um, the switch there and put in DMP point list. And, uh, one of the popular manufacturers for, uh, uh, electric distribution switches, uh, S&C, just publishes all these, um, these point lists. Uh, some are custom for, uh, Pacific Gas and Electric, and some are sort of generic. And the, you go through these, through all the equipment, and there's some very interesting things that you'll find in there. So, might not be able to read it, but you can measure things like current of phase A, current of phase B, voltage of phase A, voltage of phase B. So these are, um, if you're not familiar, uh, electricity is distributed in three phases, or three wires that are sort of out of sync with each other. Um, that's just, they're, they're reasons for that that aren't really important. But you can monitor, like, the cabinet temperature, the battery voltage of the backup battery for this control system, things like that. Uh, you can also get binary events, like, whether the, uh, the power transfer switch is open or closed, or things like that. Whether, uh, remote control is enabled, or if it's being overridden locally, things like that. Whether the cabinet door is open. Um, uh, and you can also send some control commands to like start a battery test or open and close a switch, you know, take down the power. Things like that. And then some really crazy things here. Like, you can send a packet to enable the, uh, local Wi-Fi interface on some of these switches. So you can turn them on, you can turn them off, you can test them. Uh, there's also a Wi-Fi intrusion alarm. So, I don't really know what that is, but, uh, it's, it's a little bit of a know what this is. But it looks like the switches have the ability when Wi-Fi is on to detect an intrusion, whatever that means. And when it detects an intrusion, then it will send an event back to the master station. And then the master station can say, okay, I acknowledge that intrusion. I'm going to set a bit and you'll forget that that ever happened. So that's some pretty crazy things. This didn't get us the whole story because the manufacturers of the actual physical switches are not necessarily the manufacturers of the control systems that are in that switch box. So we're not still super clear that these match up. So now what we're doing right now is trying to correlate values that we see with things that make sense and try to group them and try to get them to match up. So we're trying to get them to match up. And then we're trying to figure out what all these points mean. And this is still a work in progress. But here's an example of some of the things that we can pop out. So ignore this bit in here. This is when our monitoring crashed and we weren't aware for a while. But this is just one point from one station that we have that we're monitoring. And so I believe this is probably a voltage for one of the phases. And so it goes between like 6600 volts and 7800 volts. And it's sort of cyclic as probably as the load on the system increases or decreases. And so we actually have a website that one of the students at UCSD put together that can let us visualize all the data that we have collected so far. We have a nice antenna on the roof of our building. And that gets us to a lot. We're still, we have plans for getting even more data that I'll talk about in a minute. Now one of the problems here is that, or one of the things that we wanted to do is we don't exactly know which station this is coming from. Like we know that this data is coming from Skatebox 5338. So, okay, what is 5338? How do I know that? Well, once again, our friends at SKATEBOX have a lot of data that we can use. So we have the SDG&E helpful put the exact address on all of the boxes. And so we've started a sort of small scale crowd sourcing effort for anyone who sees any of these boxes to just write down its location. Write down the number. And what we eventually want to do is make this nice big map like the ones that you see on TV with like all the different power switches and their current status and things like that. And we're building this. And so this is our things out of CSI cyber or something like that. Just for the lulls. So let's see here. So this is all fine and dandy but let's say that you don't want to necessarily go out and buy one of these dedicated radios. How can you start actually sniffing this for yourself? Well if you have one of those $10 or $20 RTLS ER dongles and GNU radio, oh yeah. I was just going to show that this number here does in fact match up with exactly what you see in Wireshark. It's pretty straightforward. But as I was saying, we have actually written a GNU radio block which implements the receive side of the modem and the transmit side of the modem and the receive side should actually be simpler to implement but we can't actually legally or ethically send control packets to this system and figure out what it actually does. So we're receive only for right now. But we do have some code that we'll be releasing soon that will let you actually sniff this traffic for yourself, let you put it into Wireshark, figure out what it does, figure out if there's interesting things in your own community. I lived in Seattle for several years. It didn't look like they had anything interesting up there, but I did. So when I was scanning through the frequency bands up there, I did hear some, the very distinctive modem signal that you'll hear. And I wish I had a sample for you to play here. So that turns out to be a very nice system. It's called the MPPT. The MPPT is the radio control system and I don't know about you, but I was wondering what it is. Uh, it's probably it's a time control system. But it's not, it's a temp control system. But it's actually a couple of different kinds of things. It uses a susceptive radio to do radio works, I'm not exactly sure what that is. I didn't have enough chance to look into it. MDS also makes radios for remote train control systems. And so they make these radios for things that are for like positive train control and things that they were saying should be installed to prevent that kind of accidents that happens. And and New England, things like that. So this may also work for that. I don't know. One of the other points that I want to go back to is that while we think we can, we have identified the points that we can use to control the power grid, we can't actually test that. So it is possible for them to configure the switches for only monitoring and not control. We think that they do actually remotely control them. We have not observed them doing that yet, but we'll probably see that in the future. So just to wrap up, despite a lot of major attention on industrial control system and SCADA security over the years, there's a lot of critical infrastructure like the power grid in San Diego that's still completely exposed over these non-Icebergs. So I think it's important to recognize that and to understand that the things that we're looking at are not really looking at the main IP channels that people are really looking at. As you've seen, the barrier of entry to actually looking at this stuff is really low. It's like $100 on eBay or get my software in $10 for an RTL-SDR. And really looking through a lot of these standards, it was apparent that no one was really accepting responsibility for security. So the radio people say it is up to the SCADA box, box, the SCADA control module to do security, the SCADA box say or says that it's up to the link level to do security and so no one ends up securing the system at all, completely unencrypted, completely authenticated. And so if you're looking at these systems, they sort of need to be evaluated holistically and not just assuming that someone else is going to take care of the security for you. And finally the last point I want to make is that you shouldn't just focus on looking at IP vulnerabilities because there's a lot of interesting things just over the air, over serial lines, over some crazy things like that. So with that I'd like to thank you for your attention and that's all I have. Subtitles by the Amara.org community