[00:00.000 --> 00:03.400] Alright, hello everyone and thanks for coming to our talk today. We're pretty [00:03.400 --> 00:06.880] excited to be speaking in the ICS village for the first time. We're going [00:06.880 --> 00:11.600] to talk about an ODE that we found in an ICS system. This is actually going to be [00:11.600 --> 00:15.500] somewhat of a redo of our talk in track 2 yesterday, but we're going to [00:15.500 --> 00:21.800] focus a lot more on challenges we faced specific to ICS systems. So first of all, [00:21.800 --> 00:25.700] who are the two crazy guys standing in front of you? My name is Doug McKee. I [00:25.700 --> 00:28.820] work for McAfee's Advanced Threat Research Team. I've got a little over [00:28.820 --> 00:32.780] eight years of experience in vulnerability research and pen testing. [00:32.780 --> 00:37.920] And I'm Mark. I'm also a researcher at McAfee's ATR team and I have a little [00:37.920 --> 00:41.940] over eight months of experience in vulnerability research and pen testing. [00:43.020 --> 00:47.640] Alright, so first what are we here to talk about today? Obviously it's going to [00:47.640 --> 00:53.500] be an ICS system. And for this it's Delta Controls and Telebus Manager. And this [00:53.500 --> 00:56.420] is a building controller. So what building controllers do is they're [00:56.420 --> 01:01.260] installed in commercial and industrial buildings to manage things like HVAC, [01:01.260 --> 01:06.120] access control, pressure rooms, and hospitals. And they do this largely over [01:06.520 --> 01:10.720] a networking protocol called BACnet. And that stands for Building Access Control [01:10.720 --> 01:15.260] Network. And this is not proprietary to this Delta system. It's [01:15.260 --> 01:19.340] actually the same across the industry. And so when we started looking at this [01:19.340 --> 01:23.740] system specifically, we kind of ran into what we like to call the perfect storm. [01:23.740 --> 01:27.800] And that's also why we started looking at it more heavily. One, it's [01:27.800 --> 01:31.120] network connected and these are connected to the Internet. So we [01:31.120 --> 01:34.740] always like to look for vulnerabilities that are network accessible because they [01:34.740 --> 01:37.440] tend to have a higher impact. And they give us a really good place to start [01:37.440 --> 01:41.760] from an attack surface. Also when we started looking at the device, we found [01:41.760 --> 01:45.360] that it had an active UART header on the board that did not require any [01:45.360 --> 01:49.520] authentication. And it dropped us right into a root shell, which allowed us [01:49.520 --> 01:53.300] easily to extract the firmware and to start debugging. And when we extract the [01:53.300 --> 01:56.340] firmware, we also found that the developers had left symbols in the [01:56.340 --> 01:59.820] binaries, which again made things easier for us to move forward. And I'll [01:59.820 --> 02:03.420] reference this throughout the presentation. And last but definitely not [02:03.420 --> 02:07.680] least, as most ICS systems do, that run Linux anyway, they have a busy box [02:07.680 --> 02:11.320] installed. And in this instance of busy box, Netcat was left installed on the [02:11.320 --> 02:15.640] box, which became extremely useful when we get to our post-exploitation phase. [02:16.200 --> 02:20.260] So I'm going to give you a really short, high-level understanding of the [02:20.260 --> 02:23.900] vulnerability and the exploit. And then we're going to focus on some of the [02:23.900 --> 02:28.020] challenges. So first, what is the vulnerability? We found using broadcast [02:28.020 --> 02:32.400] packets, BACnet broadcast packets, that we were able to find a buffer overflow. [02:32.400 --> 02:36.180] We were able to turn that buffer overflow into a write-what-where condition and use [02:36.180 --> 02:40.600] it to gain control of execution. So once we gained control of execution, we were [02:40.600 --> 02:45.180] able to redirect execution to shellcode, which we were able to put on the heap [02:45.180 --> 02:49.700] because of the buffer overflow. So a little bit more about the [02:49.700 --> 02:53.340] vulnerability. This is what it looks like in code using the IDD compilers. [02:53.340 --> 02:57.960] I've got it condensed here. The simplest way to look at it is we have a standard [02:57.960 --> 03:02.300] buffer size mismatch. So in the top diagram, you've got a buffer that I've [03:02.300 --> 03:07.020] labeled source, and it's being set to 1732 bytes, and it's being read directly [03:07.020 --> 03:11.760] from the wire. A little bit later down in the code, we have a second buffer being [03:11.760 --> 03:16.380] allocated to 1476 bytes. As you can tell, those sizes are not the same. It's [03:16.380 --> 03:20.920] eventually used for a mem copy, and therefore we have a buffer overflow. And [03:20.920 --> 03:26.020] in order to get that and to use to gain control of execution, we used the [03:26.020 --> 03:29.800] write-what-where condition to do something called a GOT overwrite. So if [03:29.800 --> 03:35.020] you're not familiar in Linux, the GOT stands for global offset table. This is a [03:35.020 --> 03:39.580] table which is populated at runtime, therefore it's generally writable, and it [03:39.580 --> 03:45.000] basically is a match between function name and address. So in our case, one of [03:45.000 --> 03:49.240] the functions in memory was scdcodebacknet UDP, and this function was [03:49.240 --> 03:53.060] very close to where we found the vuln. And so therefore, by overwriting the [03:53.060 --> 03:56.980] address for that function, we were able to redirect that function pointer to [03:56.980 --> 04:02.440] shellcode, which was stored in memory. So the shellcode, as I said, we controlled a [04:02.440 --> 04:06.220] very small amount of memory on the heap, which made shellcode slightly difficult, [04:06.220 --> 04:10.580] but we were able to do a little bit of hopscotch in memory to jump around and [04:10.580 --> 04:14.640] actually get our shellcode to work in memory. We did a classic return-to-lib C [04:14.640 --> 04:18.600] attack and leveraged the netcat that was already installed on the system to [04:18.600 --> 04:22.320] gain a reverse shell. And with that reverse shell is kind of the basis of [04:22.320 --> 04:26.260] where everything starts, and from there we're able to further [04:26.260 --> 04:32.420] infect and exploit the system. So I said, one of the things we want to focus [04:32.420 --> 04:36.820] on in here is the challenges we face during our process for ICS specific [04:36.820 --> 04:41.580] systems. And so like most people, static analysis is great, but we would really [04:41.580 --> 04:45.480] rather use dynamic analysis as much as possible in the exploitation process. [04:45.480 --> 04:51.060] It's just simply easier. So in order to do that, we compiled GDB server for the [04:51.060 --> 04:55.220] appropriate architecture, and we dropped it on the system. Now as soon as we [04:55.220 --> 04:58.760] started using GDB, we were instantly messed with a bunch of error messages, [04:58.760 --> 05:02.840] and then the system rebooted. Now the error messages have been redacted here [05:02.840 --> 05:06.520] at the request of the vendor, but the gist of the error messages were that [05:06.520 --> 05:09.880] there was a watchdog timer that failed, kicked the system, and therefore the [05:09.880 --> 05:14.200] system reboots. For those not familiar, in ICS systems, watchdog timers are [05:14.200 --> 05:19.140] typically used in order to ensure that if the system hangs for any period of [05:19.140 --> 05:23.660] time, an action is taken to stop it, to get it back going again. And in this case, [05:23.660 --> 05:27.640] the action is rebooting. Well that's obviously going to be not not good for [05:27.640 --> 05:33.500] dynamic debugging, but because we had symbols and because we were able to use [05:33.500 --> 05:37.040] those error messages, it's actually pretty simple for us to find in software [05:37.040 --> 05:41.500] where this is taking place. Here you can see that there's three areas where a [05:41.500 --> 05:46.480] counter is being decremented by five, and and when the counter hits zero, it reboots [05:46.480 --> 05:50.940] the device. Well from a software research perspective, this is actually not a hard [05:50.940 --> 05:54.860] problem to solve. All we have to do is a technique called binary patching, and we [05:54.860 --> 05:59.080] only need to patch one single byte in the entire binary. So what we did is we [05:59.080 --> 06:02.880] changed that five to a zero, and by changing that five to a zero, the code [06:02.880 --> 06:06.060] still executed, but it effectively didn't do anything. In fact, you can see up here [06:06.060 --> 06:09.140] on the screen on the right-hand side that IDA doesn't even recognize that [06:09.140 --> 06:13.320] that line exists anymore, because it's completely ineffective. So we did this [06:13.320 --> 06:16.900] and started debugging again, and we were successful for an entirely total of [06:16.900 --> 06:20.460] three minutes. And then the system rebooted again, and the watchdog got its [06:20.460 --> 06:24.660] revenge. And Mark and I are trying to figure out, we just washed the watchdog. [06:24.660 --> 06:29.720] Why is the system rebooting? Well again, something specific to ICS systems is [06:29.720 --> 06:33.420] there wasn't just a software watchdog, but there was a hardware watchdog, which [06:33.420 --> 06:36.720] is very common in ICS systems, and we had forgotten to handle the hardware [06:36.720 --> 06:40.380] watchdog. And so you can see that here on the UART screen, that the hardware [06:40.380 --> 06:45.520] watchdog is being set every 180, for up to 480 seconds every time on boot, and [06:45.520 --> 06:50.280] otherwise three minutes. So the important thing about hardware watchdogs is that [06:50.280 --> 06:54.060] if we have to deal with them as security researchers, the developers also have to [06:54.060 --> 06:57.020] deal with them. Which means if the developers have to deal with them, [06:57.020 --> 07:00.720] there's already code on the device to handle this problem. You just have to [07:00.720 --> 07:04.680] find a way to get access to it. Well in our instance, the developers had exported [07:04.680 --> 07:08.880] all of their functions to all of their SOs, meaning that all we had to do was [07:08.880 --> 07:13.140] write a very small C program, import their libraries, and call their functions, [07:13.140 --> 07:16.780] and have that boot up on start. And now we were able to kick the watchdog in the [07:16.780 --> 07:20.580] exact same manners that the developers did to prevent the device from rebooting. [07:20.780 --> 07:24.480] So by employing both of these two methods to handle the software and the [07:24.480 --> 07:27.880] hardware watchdog, we were able to debug the system dynamically, which was [07:27.880 --> 07:31.240] extremely helpful for the rest of our research. So we faced a couple more [07:31.240 --> 07:33.980] challenges, and to explain these I'm going to hand this over to my [07:33.980 --> 07:41.740] co-worker Mark. Thanks Doug. So yeah, the next challenge we encountered is that we [07:41.740 --> 07:44.880] wanted to get this exploit to work remotely. Up until this point, we had been [07:44.880 --> 07:48.240] conducting the attack on the same network the device lives on using [07:48.240 --> 07:51.560] broadcast traffic, which was nice because we didn't need to know the IP address of [07:51.560 --> 07:57.860] the device, but ultimately we wanted to expand the impact to be worldwide. Okay, [07:57.860 --> 08:02.820] so how would we go about doing this? As you may or may not know, the attack as it [08:02.820 --> 08:05.680] stands uses broadcast traffic, which normally does not travel over the [08:05.680 --> 08:09.780] internet. Well thankfully, a certain BACnet technology came to save the day. [08:10.640 --> 08:16.860] And that BACnet technology was BBMD, or Broadcast IP, or sorry, BACnet IP [08:16.860 --> 08:20.400] Broadcast Management Device, which is sort of a mouthful, but suffice it to [08:20.400 --> 08:26.040] say, it allows for the communication of BACnet broadcast traffic, the exact kind [08:26.040 --> 08:30.440] we're using, to travel over the internet. And so in the diagram on the right, you [08:30.440 --> 08:34.000] see two such BACnet networks connected over the internet, and each of them have [08:34.140 --> 08:39.100] a BBMD system. So the way this works is that traffic intended for a foreign [08:39.100 --> 08:43.800] network is first sent to the source network's BBMD. It uses unicast traffic [08:43.800 --> 08:48.380] to send it to the destination network's BBMD, whose job is then to rebroadcast [08:48.380 --> 08:52.220] that traffic. That's all well and good, but how does this help us? Well, [08:52.220 --> 08:56.100] ultimately, by using this technology, we discovered, through testing, that this [08:56.100 --> 08:59.140] actually gets our exploit to work entirely over the internet. I want to [08:59.140 --> 09:03.020] reiterate, at the time of this writing, any EBMGR device connected to the [09:03.020 --> 09:06.160] internet with its default network settings could be pwned 100% remotely [09:06.160 --> 09:11.840] using this exploit. Now, this is not the end of our challenges, not by a long shot, [09:11.840 --> 09:15.220] because after all, up until this point, all we have is a root shell to the device [09:15.220 --> 09:19.280] and persistence. This is very nice, but ultimately we're more interested, from an [09:19.280 --> 09:23.300] impact perspective, from controlling the hardware on the other end of this device. [09:23.300 --> 09:26.940] Whether this be HVAC systems in a data center, access control in a government [09:26.940 --> 09:32.040] building, or pressure rooms in a hospital, that's where the real impact lies. We [09:32.040 --> 09:36.440] need to gain control of those. So our initial hypothesis was to use the [09:36.440 --> 09:39.560] programming already on the device and see if we can get that code to work for [09:39.560 --> 09:44.440] us. The first approach we used was to try and look at the database files located [09:44.440 --> 09:48.260] on the device's file system, and these contain some information about the state [09:48.260 --> 09:51.660] of the I.O. hardware. The first thing that jumped out at us when we looked at [09:51.660 --> 09:55.440] these database files is that I had no idea what the hell I was looking at. This [09:55.440 --> 09:59.540] was too complicated, so we decided to keep looking. The next thing we tried to [09:59.540 --> 10:02.860] look at is controlling the I.O. state directly from the touchscreen as you [10:02.860 --> 10:06.960] would in normal operation. And then this actually generates loopback traffic, and [10:06.960 --> 10:10.180] we decided that if we could investigate how these packets are structured and [10:10.180 --> 10:13.880] maybe replay them, we could get it to work for us. And those paying close [10:13.880 --> 10:17.400] attention might notice that the packet structure is actually very similar to [10:17.400 --> 10:21.560] the database files and that I still have no idea what I'm looking at. So we [10:21.560 --> 10:26.480] tried something else again. And what we ended up, what ended up working for us [10:26.480 --> 10:31.180] is actually hooking to the functions that control I.O. natively. And you see [10:31.180 --> 10:36.280] one of these functions in front of you from GDB output. And once again, symbols [10:36.280 --> 10:40.260] being left in proved invaluable here since names like can I.O. write output [10:40.260 --> 10:46.000] proved to be a huge, you know, indicator this is a good place to start since we [10:46.000 --> 10:51.100] knew that all the I.O. modules are handled through the CAN bus. Now through [10:51.100 --> 10:53.860] some further reversing of these I.O. control functions, we discover there's [10:53.860 --> 10:57.300] actually different functions for handling all the different categories of [10:57.300 --> 11:03.640] I.O. And there are six such categories for the EBMGR. You have inputs, outputs, [11:03.640 --> 11:09.520] variables, and any of these can be either analog or binary. Now the idea would be [11:09.520 --> 11:12.520] to alter the parameters going to these functions in order to get the code to [11:12.520 --> 11:16.140] work for us. But the question is which parameters do we alter and how do we do [11:16.140 --> 11:20.520] it? Well for that, we did find one key commonality between all these various [11:20.520 --> 11:24.740] functions and that's the first parameter being sent. The first parameter, as we [11:24.740 --> 11:28.140] discovered, is actually a data structure that describes the hardware being [11:28.140 --> 11:32.220] altered. In particular, this data structure for the first four bytes are [11:32.220 --> 11:36.720] the ID or the fingerprint of the device and this is unique to each one. At a 12 [11:36.720 --> 11:40.200] byte offset, we also discovered the holds the current state of the device, which [11:40.200 --> 11:44.140] is the most crucial component. But additionally, at a varying offset, you [11:44.140 --> 11:47.640] could also find a descriptive string of that device, which is how we know this [11:47.640 --> 11:51.840] one is responsible for monitoring room temperature. So using this information is [11:51.840 --> 11:54.820] actually pretty straightforward to alter these data structures coming into these [11:54.820 --> 12:00.600] functions and thus get control of I.O., at least in theory. So using this [12:00.600 --> 12:04.240] information, we were able to craft malware that took advantage of this [12:04.240 --> 12:08.380] hooking method in order to control the I.O., but ultimately we had another [12:08.380 --> 12:12.020] challenge in front of us. And that challenge was that, unlike the watchdog [12:12.020 --> 12:15.460] kicking code, which we could just throw some C code onto the device and have it [12:15.460 --> 12:19.780] run, execute some functions that exist in memory, the handles to the I.O. hardware [12:19.780 --> 12:24.160] were trapped inside the program space of the existing programming. It could not be [12:24.160 --> 12:28.400] accessed normally from an external program. Somehow our malware had to be [12:28.400 --> 12:32.420] inserted into the memory space of the existing programming to do its job. How [12:32.420 --> 12:36.820] would we do it? Well, the solution ended up being something called LD preload. And [12:36.820 --> 12:40.680] for those that don't know, LD preload is a Linux environment variable. And [12:40.680 --> 12:44.580] the shared objects it points to are loaded first by a dynamic linker when a [12:44.580 --> 12:49.020] binary is executed. Now this is not a new or novel concept. We've not come up [12:49.020 --> 12:53.180] with this. It's actually a pretty common strategy in this field for inserting [12:53.180 --> 12:55.900] code into the existing program's memory space, which is exactly what we wanted [12:55.900 --> 13:01.260] to do. So in our case, we used persistence on the device in order to set this [13:01.260 --> 13:05.700] variable to point to our malware and thus we could insert it into the device's [13:05.700 --> 13:10.700] programming. But then the next challenge was, where do we put it? Well, here are [13:10.700 --> 13:16.620] our options. So this is a rough overview of the programming startup routine. And [13:16.620 --> 13:20.300] through some further reversing, we decided that the best place to put it would be [13:20.300 --> 13:24.860] this function called canioinit, highlighted in yellow. The reason being is, [13:24.860 --> 13:28.760] as Doug mentioned previously, this is a vastly multi-threaded application. It [13:28.760 --> 13:32.320] runs many threads in parallel. And in order to avoid race conditions or [13:32.320 --> 13:34.880] inconsistent behavior, we wanted a function that was called early [13:34.880 --> 13:39.660] initialization, called once, and called by a single thread. And this function met [13:39.660 --> 13:44.380] all those criteria. So what does it look like once our baby malware is inserted [13:44.380 --> 13:49.780] here? Well, once this function is executed, our malware starts up and it runs a [13:49.780 --> 13:52.600] thread in the background that listens for commands sent over the network by [13:52.600 --> 13:57.840] the attacker. It listens on a TCP port. And depending on the content of these [13:57.840 --> 14:03.140] commands, the malware will then intercept the corresponding calls to the IL [14:03.140 --> 14:07.240] control functions, alter the parameters, as I mentioned previously, thus granting [14:07.240 --> 14:12.300] us control of the hardware. Now, we were getting close to the end here, but we [14:12.300 --> 14:15.980] still had one and possibly the most important challenge in front of us. And [14:15.980 --> 14:20.540] that was, I couldn't afford my mortgage. Now hackers, we got to eat just like [14:20.540 --> 14:24.400] anyone else. So we wanted to see if we can make any money off this thing. Now [14:24.400 --> 14:28.900] obviously on stage, I would not try and sell any kind of malware. But purely [14:28.900 --> 14:33.560] hypothetically, if I was going to, I might mention that it does give you [14:33.560 --> 14:37.420] automatic discovery of all the hardware. You know, sit back and relax, it does [14:37.420 --> 14:43.100] all the recon for you. Hypothetically, of course. Another thing I might mention is [14:43.100 --> 14:47.380] that you get remote control through an interactive TCP session. A quick aside, [14:47.380 --> 14:52.500] how many of you here, show of hands, saw our original talk yesterday? Okay, that's [14:52.500 --> 14:57.800] not many. I'm going to recycle my jokes. Good. All right, so my therapist always [14:57.800 --> 15:01.320] told me that two-way communication is key to any healthy relationship. And so [15:01.320 --> 15:04.500] we decided to let you communicate with the malware through an interactive TCP [15:04.500 --> 15:09.000] session. Now am I saying this malware is going to fix your marriage? Yes, that's [15:09.000 --> 15:12.480] exactly what I'm saying. Okay, next, you can actually see the state of all the [15:12.480 --> 15:15.960] hardware in real time. So you can see exactly how much damage you're causing. [15:16.460 --> 15:19.940] And last but not least, send a single command and you revert the device to [15:19.940 --> 15:24.580] its original, unhacked state, wiping out any traces the malware is ever there. [15:25.100 --> 15:29.500] Best of all, if you call in the next 30 minutes, hypothetically, you could get all [15:29.500 --> 15:34.720] this and more for 30,000 easy payments of $19.95, shipping and handling not [15:34.720 --> 15:38.900] included. And if you're still not convinced, be sure to walk over 10 feet [15:38.900 --> 15:43.060] that way after the talk is over to check out our presentation. You can see this [15:43.060 --> 15:49.080] bad boy in action. But to show you a quick overview of how this looks in the [15:49.080 --> 15:55.200] real world, I'm going to hand it back to Doug. Thanks, Mark. And just to be clear, [15:55.200 --> 15:58.480] we're having some fun joking around, but we are in no way releasing the exploit [15:58.480 --> 16:03.600] code, malware code, or selling anything. I don't want to get fired and my boss is [16:03.600 --> 16:09.000] sitting right here. So, okay, so now that we've gone through a little bit of the [16:09.000 --> 16:12.100] challenges and a really high overview of how this works, what does this really [16:12.100 --> 16:17.320] look like? And one of our missions at McAfee's ATR team is we really want to [16:17.320 --> 16:21.100] demonstrate these in some means that it's really easy for everyone to see [16:21.100 --> 16:24.820] what the impact is. And because of that, we actually took the time to build a [16:24.820 --> 16:28.240] fully working demo unit, which as Mark said, is literally 10 feet over there [16:28.240 --> 16:31.300] afterwards if you want to see it in action. But I'll show you the demos as [16:31.300 --> 16:36.740] videos right now since they won't let us will it over. So what we built was a [16:36.740 --> 16:42.480] fully functional HVAC unit that's cooling a simulated data center. Because [16:42.620 --> 16:45.920] why a data center? Because this is one of the uses that this exact model is used [16:45.920 --> 16:50.560] for. We actually hired an installer that installs these on a regular basis to [16:50.560 --> 16:53.980] build this, and one of the main things they install it in is in data centers. [16:53.980 --> 16:58.020] Again, we're going for as realistic as possible. So if we take a look at what [16:58.020 --> 17:02.160] this unit looks like, excuse me, on the backhand side you see all the components [17:02.160 --> 17:06.860] of a normal working HVAC system. So we've got the valves, we've got fans, we've got [17:06.860 --> 17:12.240] pumps, and all this is doing is taking cold water from a cold water bin and [17:12.240 --> 17:16.520] using that to send cold air into our simulated data unit. You might say [17:16.520 --> 17:19.920] there's not usually cold water in a real unit, but again my boss was too cheap to [17:19.920 --> 17:23.940] buy an actual condenser, so that's what we were working with. On the other side [17:23.940 --> 17:28.800] we have a glassed-in simulated data center. We've got all this again HVAC [17:28.800 --> 17:32.100] equipment that you'd see in a data center, and we even have a raised floor [17:32.100 --> 17:35.640] with a server sitting on it generating heat. For a moment I'll bring your [17:35.640 --> 17:39.240] attention to one of the sensors. It's the independent temperature sensor. This is [17:39.240 --> 17:43.360] the only component not hooked up to the Delta system because it gives us [17:43.360 --> 17:46.460] ground truth for what the temperature is regardless of how much we mess the [17:46.460 --> 17:51.260] system up. On the top we have some simple LEDs indicating different states of the [17:51.260 --> 17:55.200] equipment. Again mostly just so it's visually easy to see, but the most [17:55.200 --> 17:59.400] important one is the alarm. And the alarm is an interesting one because in real [17:59.400 --> 18:03.900] life the alarm could be done one of two ways. It could simply be an LED, it could [18:03.900 --> 18:07.780] also be a siren, but more frequently the alarm is used for like email [18:07.780 --> 18:12.420] notification so that somebody knows this system's in distress. So anytime we [18:12.420 --> 18:15.600] talk about the alarm, that covers all of those. The attacker would be able to [18:15.600 --> 18:20.160] manipulate that as well. So I'm going to show you what this would actually look [18:20.160 --> 18:24.000] like if someone attacks it using our premium malware which will help pay for [18:24.000 --> 18:29.480] Mark's mortgage. On the upper right hand side of the screen you [18:29.480 --> 18:33.880] see the attacker running the exploit script that we ran. On the top right hand [18:33.880 --> 18:38.900] side of the screen you see the Delta controller picture-in-picture. As the [18:38.900 --> 18:43.100] attacker launches the exploit, leverages the vulnerability, it downloads our [18:43.100 --> 18:46.860] malware and a few other fun images and this reboots the system to leverage that [18:46.860 --> 18:50.920] LD preload method that Mark talked about. Here you can see we've replaced the [18:50.920 --> 18:55.080] images just to prove that it's hacked. No one would ever actually do this in [18:55.080 --> 18:58.580] the real world, but we're just going for a visual representation. Also we're [18:58.580 --> 19:02.540] logging in to follow along, but no one actually needs to touch or log in the [19:02.540 --> 19:06.880] system. So what are some of the things the attacker might do once they got to [19:06.880 --> 19:10.420] this point on the system? Well one thing they might do is control the outputs of [19:10.420 --> 19:13.900] the system. The system takes input and based on those inputs have a reaction [19:13.900 --> 19:18.300] to the outputs. So here what you're seeing is the attacker manually override [19:18.300 --> 19:22.680] several of the outputs on the screen one at a time. In the bottom right hand [19:22.680 --> 19:27.080] corner of the screen you will also see that the system is reacting [19:27.080 --> 19:31.220] accordingly. So the pump shutting off, the alarms turning off, etc. On the top [19:31.220 --> 19:34.560] right hand of this part of the screen you'll notice that the Delta screen is [19:34.560 --> 19:38.520] not reacting. In fact it's still staying in its previous state. This is because [19:38.520 --> 19:42.920] our premium malware has the ability to adjust or not adjust the screen based on [19:42.920 --> 19:46.780] the attacker's will. And if we start talking about alerting or [19:46.780 --> 19:51.740] whether the user is aware, this is a very important feature. So what you just saw [19:51.740 --> 19:55.720] turning stuff on and off, that's binary outputs. These systems typically have [19:55.720 --> 19:59.920] both analog and binary outputs. And all analog means is they're set to some [19:59.920 --> 20:04.780] floating point value instead of just on or off. So to manipulate those the [20:04.780 --> 20:08.420] attacker can do that as well through the same interface. This time that you will [20:08.420 --> 20:11.440] see the Delta screen update because we're going to have the attacker choose [20:11.440 --> 20:15.080] to update the screen. So they're going to change the fan speed in the valve and [20:15.080 --> 20:18.240] you can again see the component reacting appropriately in the bottom right hand [20:18.240 --> 20:22.680] corner of the screen. Also what we've done in this malware is provide a reset [20:22.680 --> 20:26.500] function which sets everything back to its original programming without [20:26.500 --> 20:29.760] removing the malware's presence. So it kind of gives the attacker a way to put [20:29.760 --> 20:35.040] things back and still have persistence on the device. So controlling outputs are [20:35.040 --> 20:38.220] fun but it would be a lot of work for an attacker to have to manipulate all the [20:38.220 --> 20:41.840] outputs in order to get the outcome that they wanted. Remember I mentioned that [20:41.840 --> 20:46.300] these systems are designed to take input and based on that input perform some [20:46.300 --> 20:50.820] action. So instead of controlling the outputs if we manipulated the [20:50.820 --> 20:55.320] incoming data then the the rest of the system would just function as normally. [20:55.520 --> 20:59.660] So in the world of HVAC if the system thought it was reading 30 and 40 [20:59.660 --> 21:03.280] degrees from the data center what would it do? It would do the same thing your house [21:03.280 --> 21:06.900] HVAC would do. It would turn itself off because it has no need to cool. That's [21:06.900 --> 21:10.280] exactly what we have going on here and you can see our independent temperature [21:10.280 --> 21:14.380] sensor in the bottom right hand corner the temperature is rising. Alarms are not [21:14.380 --> 21:17.560] going to trigger because the system doesn't think it's in distress. You know [21:17.560 --> 21:21.060] all the valves or dampers and stuff they're going to close on their own [21:21.060 --> 21:24.040] without the attacker doing anything because that's how the system's [21:24.040 --> 21:27.840] programmed to react when it thinks it's only 30 or 40 degrees inside the data [21:27.840 --> 21:31.440] center. So this is actually a more impactful scenario controlling the [21:31.440 --> 21:36.440] inputs than the outputs. And a data center again is just one example of how [21:36.440 --> 21:41.100] this how these would work in the real world but think about you know a major [21:41.100 --> 21:45.260] corporation insert your favorite name cloud provider and if their data center [21:45.260 --> 21:49.800] was to lose HVAC for a couple days without their technicians knowing being [21:49.800 --> 21:53.140] any of the wiser we could probably impact a pretty large portion of the [21:53.140 --> 21:57.900] internet. But we want to highlight that data centers are not the only thing [21:57.900 --> 22:02.160] because this is a building controller and it's not agnostic to one industry [22:02.160 --> 22:06.760] these are installed across a very wide range of industries and I'm [22:06.760 --> 22:09.420] going to highlight a couple of examples in those industries just so we [22:09.420 --> 22:14.320] understand the impact beyond melting down a data center. So the first one I'm [22:14.320 --> 22:17.620] going to talk about is the health care industry and the health care is slightly [22:17.620 --> 22:20.540] unique in the fact that building controllers control pressure in [22:20.540 --> 22:24.540] individual rooms throughout a hospital. And what do I mean by controlling [22:24.540 --> 22:29.060] pressure? Well by setting the pressure in different rooms, I'm sorry, by setting the [22:29.060 --> 22:33.500] pressure in different rooms to different degrees, it prevents the spread of [22:33.500 --> 22:36.940] disease. So by having a positive pressure in one room and negative pressure in the [22:36.940 --> 22:41.080] other room, disease can't travel from one side of the hospital to the other side. [22:41.080 --> 22:44.560] The other unique thing about controlling pressure is it's just a very very small [22:44.560 --> 22:48.280] change in pressure. Unlike temperature you might walk into a room and say hey [22:48.280 --> 22:51.860] it's kind of hot in here. If you walk into a room you're not going to say hey [22:51.860 --> 22:56.280] the pressure is kind of low in here. So the humans not going to notice that [22:56.280 --> 23:00.080] change, it's a very small change. And if an attacker was to get on one of these [23:00.080 --> 23:04.000] systems, make it so the hospital pressure was even throughout everything, I'm [23:04.000 --> 23:07.820] talking the OR, you know the quarantine room, the rooms where the housing [23:07.820 --> 23:12.060] critical diseases or samples, all of a sudden all that stuff would be able to [23:12.060 --> 23:15.740] travel airborne throughout the hospital. And that could actually affect human [23:15.740 --> 23:20.700] life. That's a pretty interesting scenario. If we talk about the [23:20.700 --> 23:23.680] government sector for a moment, I only bring up this one because we did some [23:23.680 --> 23:27.600] online open-source intelligence research and found that these systems are [23:27.600 --> 23:31.160] actually being used in certain government buildings, state governments, [23:31.160 --> 23:35.580] for access control. Well if you think about that impact, if we were able to [23:35.580 --> 23:38.980] access one of these systems in a state government building for access control, I [23:38.980 --> 23:42.080] don't think I have to go into too much detail at a hacker conference of [23:42.080 --> 23:45.820] what that would provide, right? We would be able to access maybe sensitive data [23:45.820 --> 23:50.680] that we weren't supposed to get to, social our way, engineer our way in. And [23:50.680 --> 23:54.160] last but not least, I'll take a moment just to highlight education just because [23:54.160 --> 23:57.400] I think it's a one that people are probably asking yourself, why do I care [23:57.400 --> 24:02.380] if you can affect the HVAC system in my kids preschool? And what I would argue is [24:02.380 --> 24:06.980] we often forget that because this system is completely accessible over the [24:06.980 --> 24:11.080] internet and remotely exploitable, it's not only about the system itself. [24:11.080 --> 24:14.460] Unfortunately, we find that a lot of times these are not air gaps and there's [24:14.460 --> 24:17.880] other systems on the network and being able to control a system that's on the [24:17.880 --> 24:22.020] network in a hundred percent capacity will allow us to potentially view video [24:22.020 --> 24:25.560] feeds that are going over the network or compromise other systems on [24:25.560 --> 24:28.200] the network, which all of a sudden you might care a little bit more about than [24:28.200 --> 24:33.740] just the temperature. But don't worry, no one would actually connect these systems [24:33.740 --> 24:36.740] to the network so we really have nothing to worry about from a network [24:36.740 --> 24:40.900] perspective. Oh, I forgot about that. Shodan does show us this a little [24:40.900 --> 24:44.840] different than the optimal version. So at the time that we originally did this, the [24:44.840 --> 24:51.360] exact model that we exploited that has the vulnerable firmware, there was [24:51.360 --> 24:56.300] about 500 of these on the internet at the given time. And the thing was, where [24:56.300 --> 24:59.900] we discovered this vulnerability is pretty low on the [25:00.980 --> 25:04.680] stack and it's because it digests the BACnet protocol, it's actually used [25:04.680 --> 25:08.160] across multiple Delta Controls devices. It's not specific to this Delta Control [25:08.160 --> 25:12.120] unit. And if we look at those numbers connected to the internet, all of a [25:12.120 --> 25:16.200] sudden we get to about 1,700 connected to the internet that has the potential to be [25:16.200 --> 25:19.900] vulnerable to this vulnerability. Give or take 10% or so for honeypots that we [25:19.900 --> 25:24.540] found on the internet as well. So with that said, I think we've [25:24.540 --> 25:30.060] covered just about all of the impact and the details of the vulnerability. I want [25:30.060 --> 25:33.880] to take a moment to highlight the vendor for this. Per McAfee's responsible [25:33.880 --> 25:38.560] disclosure policy, we disclosed to the vendor that we found this bug and [25:38.560 --> 25:42.980] everything that we were able to do with it in late 2018. A CVE number was [25:42.980 --> 25:46.360] generated and then we worked very closely with the vendor. And in [25:46.360 --> 25:52.280] June of 2019, the vendor released a patch. ATR has tested the patch and is happy to [25:52.280 --> 25:57.000] confirm the patch fully does mitigate this issue. And I also want to take a [25:57.000 --> 26:01.000] moment just to say that Delta was awesome to work with and they were kind [26:01.000 --> 26:03.680] of what I'd like to see as the gold standard going forward for security [26:03.680 --> 26:08.060] researchers releasing bugs. A lot of times, I've been in the industry for [26:08.060 --> 26:11.320] almost 10 years and there's a lot of bad blood sometimes between security [26:11.320 --> 26:15.100] vendors or security researchers and vendors. These guys were extremely [26:15.100 --> 26:18.340] receptive to the information we provided them with. They worked with us very [26:18.340 --> 26:21.700] closely to make sure the system has been patched. And this is really what we want [26:21.700 --> 26:24.740] to see from all the vendors in the industry. We're not trying to do anything [26:24.740 --> 26:27.540] negative. We're actually trying to help you and find these bugs before the bad [26:27.540 --> 26:31.820] guys do. And this is really a good example on how effective that can be if [26:31.820 --> 26:34.580] you can get a good relationship with the vendor because they're actively [26:34.580 --> 26:37.560] patching these systems right now. We've actually already seen the patch being [26:37.560 --> 26:41.900] applied and less of these systems vulnerable on the internet. So thank you [26:41.900 --> 26:46.480] for your time. Mark and I will be here at the our demo station which is again [26:46.480 --> 26:49.940] literally 10 or 20 feet over there. We're happy to answer any questions you might [26:49.940 --> 26:54.320] have further or and I think we're probably we're gonna get off stage here. [26:54.320 --> 26:57.260] So any questions you have please come to our station. Thank you.