1 00:00:00,000 --> 00:00:03,100 Alright, hello everyone and thanks for coming to our talk today. 2 00:00:03,100 --> 00:00:06,120 We're pretty excited to be speaking in the ICS village for the first time. 3 00:00:06,340 --> 00:00:10,820 We're going to talk about an ODE that we found in an ICS system. 4 00:00:10,820 --> 00:00:20,060 This is actually going to be somewhat of a redo of our talk in track 2 yesterday, but we're going to focus a lot more on challenges we faced specific to ICS systems. 5 00:00:20,360 --> 00:00:24,060 So first of all, who are the two crazy guys standing in front of you? 6 00:00:24,060 --> 00:00:25,480 My name is Doug McKee. 7 00:00:25,480 --> 00:00:28,000 I work for McAfee's Advanced Threat Research Team. 8 00:00:28,000 --> 00:00:32,780 I've got a little over eight years of experience in vulnerability research and pen testing. 9 00:00:32,780 --> 00:00:34,560 And I'm Mark. 10 00:00:34,560 --> 00:00:41,940 I'm also a researcher at McAfee's ATR team and I have a little over eight months of experience in vulnerability research and pen testing. 11 00:00:43,020 --> 00:00:46,740 Alright, so first what are we here to talk about today? 12 00:00:46,740 --> 00:00:49,180 Obviously it's going to be an ICS system. 13 00:00:49,480 --> 00:00:52,920 And for this it's Delta Controls and Telebus Manager. 14 00:00:52,960 --> 00:00:54,720 And this is a building controller. 15 00:00:54,720 --> 00:01:04,540 So what building controllers do is they're installed in commercial and industrial buildings to manage things like HVAC, access control, pressure rooms, and hospitals. 16 00:01:04,640 --> 00:01:08,420 And they do this largely over a networking protocol called BACnet. 17 00:01:08,420 --> 00:01:11,520 And that stands for Building Access Control Network. 18 00:01:11,520 --> 00:01:15,140 And this is not proprietary to this Delta system. 19 00:01:15,140 --> 00:01:17,260 It's actually the same across the industry. 20 00:01:17,600 --> 00:01:23,740 And so when we started looking at this system specifically, we kind of ran into what we like to call the perfect storm. 21 00:01:23,740 --> 00:01:27,320 And that's also why we started looking at it more heavily. 22 00:01:27,340 --> 00:01:30,420 One, it's network connected and these are connected to the Internet. 23 00:01:30,500 --> 00:01:36,040 So we always like to look for vulnerabilities that are network accessible because they tend to have a higher impact. 24 00:01:36,040 --> 00:01:38,880 And they give us a really good place to start from an attack surface. 25 00:01:39,180 --> 00:01:46,280 Also when we started looking at the device, we found that it had an active UART header on the board that did not require any authentication. 26 00:01:46,340 --> 00:01:52,180 And it dropped us right into a root shell, which allowed us easily to extract the firmware and to start debugging. 27 00:01:52,180 --> 00:01:59,640 And when we extract the firmware, we also found that the developers had left symbols in the binaries, which again made things easier for us to move forward. 28 00:01:59,640 --> 00:02:01,600 And I'll reference this throughout the presentation. 29 00:02:02,200 --> 00:02:08,460 And last but definitely not least, as most ICS systems do, that run Linux anyway, they have a busy box installed. 30 00:02:08,460 --> 00:02:15,640 And in this instance of busy box, Netcat was left installed on the box, which became extremely useful when we get to our post-exploitation phase. 31 00:02:16,200 --> 00:02:21,880 So I'm going to give you a really short, high-level understanding of the vulnerability and the exploit. 32 00:02:22,340 --> 00:02:24,660 And then we're going to focus on some of the challenges. 33 00:02:24,740 --> 00:02:26,480 So first, what is the vulnerability? 34 00:02:26,480 --> 00:02:32,400 We found using broadcast packets, BACnet broadcast packets, that we were able to find a buffer overflow. 35 00:02:32,400 --> 00:02:37,980 We were able to turn that buffer overflow into a write-what-where condition and use it to gain control of execution. 36 00:02:38,320 --> 00:02:46,840 So once we gained control of execution, we were able to redirect execution to shellcode, which we were able to put on the heap because of the buffer overflow. 37 00:02:47,320 --> 00:02:50,320 So a little bit more about the vulnerability. 38 00:02:50,320 --> 00:02:53,340 This is what it looks like in code using the IDD compilers. 39 00:02:53,340 --> 00:02:54,760 I've got it condensed here. 40 00:02:55,640 --> 00:02:59,700 The simplest way to look at it is we have a standard buffer size mismatch. 41 00:02:59,700 --> 00:03:08,040 So in the top diagram, you've got a buffer that I've labeled source, and it's being set to 1732 bytes, and it's being read directly from the wire. 42 00:03:08,040 --> 00:03:14,100 A little bit later down in the code, we have a second buffer being allocated to 1476 bytes. 43 00:03:14,100 --> 00:03:16,100 As you can tell, those sizes are not the same. 44 00:03:16,100 --> 00:03:20,140 It's eventually used for a mem copy, and therefore we have a buffer overflow. 45 00:03:20,760 --> 00:03:29,160 And in order to get that and to use to gain control of execution, we used the write-what-where condition to do something called a GOT overwrite. 46 00:03:29,160 --> 00:03:34,160 So if you're not familiar in Linux, the GOT stands for global offset table. 47 00:03:34,160 --> 00:03:42,680 This is a table which is populated at runtime, therefore it's generally writable, and it basically is a match between function name and address. 48 00:03:42,800 --> 00:03:51,260 So in our case, one of the functions in memory was scdcodebacknet UDP, and this function was very close to where we found the vuln. 49 00:03:51,260 --> 00:03:58,900 And so therefore, by overwriting the address for that function, we were able to redirect that function pointer to shellcode, which was stored in memory. 50 00:03:59,180 --> 00:04:12,860 So the shellcode, as I said, we controlled a very small amount of memory on the heap, which made shellcode slightly difficult, but we were able to do a little bit of hopscotch in memory to jump around and actually get our shellcode to work in memory. 51 00:04:12,860 --> 00:04:20,000 We did a classic return-to-lib C attack and leveraged the netcat that was already installed on the system to gain a reverse shell. 52 00:04:20,080 --> 00:04:28,240 And with that reverse shell is kind of the basis of where everything starts, and from there we're able to further infect and exploit the system. 53 00:04:30,080 --> 00:04:37,840 So I said, one of the things we want to focus on in here is the challenges we face during our process for ICS specific systems. 54 00:04:37,940 --> 00:04:45,480 And so like most people, static analysis is great, but we would really rather use dynamic analysis as much as possible in the exploitation process. 55 00:04:45,480 --> 00:04:47,040 It's just simply easier. 56 00:04:47,280 --> 00:04:53,680 So in order to do that, we compiled GDB server for the appropriate architecture, and we dropped it on the system. 57 00:04:53,940 --> 00:05:00,700 Now as soon as we started using GDB, we were instantly messed with a bunch of error messages, and then the system rebooted. 58 00:05:01,020 --> 00:05:10,820 Now the error messages have been redacted here at the request of the vendor, but the gist of the error messages were that there was a watchdog timer that failed, kicked the system, and therefore the system reboots. 59 00:05:10,820 --> 00:05:22,920 For those not familiar, in ICS systems, watchdog timers are typically used in order to ensure that if the system hangs for any period of time, an action is taken to stop it, to get it back going again. 60 00:05:22,920 --> 00:05:25,040 And in this case, the action is rebooting. 61 00:05:25,040 --> 00:05:39,120 Well that's obviously going to be not not good for dynamic debugging, but because we had symbols and because we were able to use those error messages, it's actually pretty simple for us to find in software where this is taking place. 62 00:05:39,140 --> 00:05:47,280 Here you can see that there's three areas where a counter is being decremented by five, and and when the counter hits zero, it reboots the device. 63 00:05:47,380 --> 00:05:51,760 Well from a software research perspective, this is actually not a hard problem to solve. 64 00:05:51,760 --> 00:05:57,680 All we have to do is a technique called binary patching, and we only need to patch one single byte in the entire binary. 65 00:05:57,760 --> 00:06:05,100 So what we did is we changed that five to a zero, and by changing that five to a zero, the code still executed, but it effectively didn't do anything. 66 00:06:05,100 --> 00:06:12,040 In fact, you can see up here on the screen on the right-hand side that IDA doesn't even recognize that that line exists anymore, because it's completely ineffective. 67 00:06:12,380 --> 00:06:17,880 So we did this and started debugging again, and we were successful for an entirely total of three minutes. 68 00:06:17,880 --> 00:06:21,280 And then the system rebooted again, and the watchdog got its revenge. 69 00:06:21,640 --> 00:06:24,660 And Mark and I are trying to figure out, we just washed the watchdog. 70 00:06:24,660 --> 00:06:26,220 Why is the system rebooting? 71 00:06:26,420 --> 00:06:37,660 Well again, something specific to ICS systems is there wasn't just a software watchdog, but there was a hardware watchdog, which is very common in ICS systems, and we had forgotten to handle the hardware watchdog. 72 00:06:37,760 --> 00:06:46,920 And so you can see that here on the UART screen, that the hardware watchdog is being set every 180, for up to 480 seconds every time on boot, and otherwise three minutes. 73 00:06:47,220 --> 00:06:54,860 So the important thing about hardware watchdogs is that if we have to deal with them as security researchers, the developers also have to deal with them. 74 00:06:54,860 --> 00:07:00,160 Which means if the developers have to deal with them, there's already code on the device to handle this problem. 75 00:07:00,160 --> 00:07:02,500 You just have to find a way to get access to it. 76 00:07:02,520 --> 00:07:14,800 Well in our instance, the developers had exported all of their functions to all of their SOs, meaning that all we had to do was write a very small C program, import their libraries, and call their functions, and have that boot up on start. 77 00:07:14,800 --> 00:07:20,580 And now we were able to kick the watchdog in the exact same manners that the developers did to prevent the device from rebooting. 78 00:07:20,780 --> 00:07:30,100 So by employing both of these two methods to handle the software and the hardware watchdog, we were able to debug the system dynamically, which was extremely helpful for the rest of our research. 79 00:07:30,200 --> 00:07:35,000 So we faced a couple more challenges, and to explain these I'm going to hand this over to my co-worker Mark. 80 00:07:36,240 --> 00:07:37,300 Thanks Doug. 81 00:07:38,500 --> 00:07:43,760 So yeah, the next challenge we encountered is that we wanted to get this exploit to work remotely. 82 00:07:43,760 --> 00:07:56,760 Up until this point, we had been conducting the attack on the same network the device lives on using broadcast traffic, which was nice because we didn't need to know the IP address of the device, but ultimately we wanted to expand the impact to be worldwide. 83 00:07:57,400 --> 00:08:00,640 Okay, so how would we go about doing this? 84 00:08:00,640 --> 00:08:06,480 As you may or may not know, the attack as it stands uses broadcast traffic, which normally does not travel over the internet. 85 00:08:06,480 --> 00:08:09,780 Well thankfully, a certain BACnet technology came to save the day. 86 00:08:10,640 --> 00:08:28,480 And that BACnet technology was BBMD, or Broadcast IP, or sorry, BACnet IP Broadcast Management Device, which is sort of a mouthful, but suffice it to say, it allows for the communication of BACnet broadcast traffic, the exact kind we're using, to travel over the internet. 87 00:08:28,880 --> 00:08:35,520 And so in the diagram on the right, you see two such BACnet networks connected over the internet, and each of them have a BBMD system. 88 00:08:35,660 --> 00:08:42,160 So the way this works is that traffic intended for a foreign network is first sent to the source network's BBMD. 89 00:08:42,340 --> 00:08:49,320 It uses unicast traffic to send it to the destination network's BBMD, whose job is then to rebroadcast that traffic. 90 00:08:49,320 --> 00:08:51,780 That's all well and good, but how does this help us? 91 00:08:51,840 --> 00:08:58,720 Well, ultimately, by using this technology, we discovered, through testing, that this actually gets our exploit to work entirely over the internet. 92 00:08:58,800 --> 00:09:07,320 I want to reiterate, at the time of this writing, any EBMGR device connected to the internet with its default network settings could be pwned 100% remotely using this exploit. 93 00:09:08,460 --> 00:09:16,620 Now, this is not the end of our challenges, not by a long shot, because after all, up until this point, all we have is a root shell to the device and persistence. 94 00:09:16,620 --> 00:09:23,300 This is very nice, but ultimately we're more interested, from an impact perspective, from controlling the hardware on the other end of this device. 95 00:09:23,300 --> 00:09:31,920 Whether this be HVAC systems in a data center, access control in a government building, or pressure rooms in a hospital, that's where the real impact lies. 96 00:09:31,920 --> 00:09:33,640 We need to gain control of those. 97 00:09:33,920 --> 00:09:40,280 So our initial hypothesis was to use the programming already on the device and see if we can get that code to work for us. 98 00:09:40,500 --> 00:09:48,760 The first approach we used was to try and look at the database files located on the device's file system, and these contain some information about the state of the I.O. 99 00:09:48,760 --> 00:09:49,460 hardware. 100 00:09:49,680 --> 00:09:54,920 The first thing that jumped out at us when we looked at these database files is that I had no idea what the hell I was looking at. 101 00:09:55,120 --> 00:09:57,780 This was too complicated, so we decided to keep looking. 102 00:09:58,620 --> 00:10:01,360 The next thing we tried to look at is controlling the I.O. 103 00:10:01,360 --> 00:10:04,220 state directly from the touchscreen as you would in normal operation. 104 00:10:04,460 --> 00:10:12,460 And then this actually generates loopback traffic, and we decided that if we could investigate how these packets are structured and maybe replay them, we could get it to work for us. 105 00:10:12,680 --> 00:10:20,600 And those paying close attention might notice that the packet structure is actually very similar to the database files and that I still have no idea what I'm looking at. 106 00:10:20,980 --> 00:10:22,880 So we tried something else again. 107 00:10:23,560 --> 00:10:29,460 And what we ended up, what ended up working for us is actually hooking to the functions that control I.O. 108 00:10:29,500 --> 00:10:30,140 natively. 109 00:10:30,340 --> 00:10:34,200 And you see one of these functions in front of you from GDB output. 110 00:10:34,640 --> 00:10:39,700 And once again, symbols being left in proved invaluable here since names like can I.O. 111 00:10:39,700 --> 00:10:46,860 write output proved to be a huge, you know, indicator this is a good place to start since we knew that all the I.O. 112 00:10:46,860 --> 00:10:48,840 modules are handled through the CAN bus. 113 00:10:50,120 --> 00:10:52,540 Now through some further reversing of these I.O. 114 00:10:52,540 --> 00:10:57,780 control functions, we discover there's actually different functions for handling all the different categories of I.O. 115 00:10:57,960 --> 00:11:01,220 And there are six such categories for the EBMGR. 116 00:11:01,260 --> 00:11:07,580 You have inputs, outputs, variables, and any of these can be either analog or binary. 117 00:11:08,260 --> 00:11:13,500 Now the idea would be to alter the parameters going to these functions in order to get the code to work for us. 118 00:11:13,500 --> 00:11:16,740 But the question is which parameters do we alter and how do we do it? 119 00:11:16,860 --> 00:11:23,620 Well for that, we did find one key commonality between all these various functions and that's the first parameter being sent. 120 00:11:23,620 --> 00:11:28,980 The first parameter, as we discovered, is actually a data structure that describes the hardware being altered. 121 00:11:29,000 --> 00:11:35,740 In particular, this data structure for the first four bytes are the ID or the fingerprint of the device and this is unique to each one. 122 00:11:36,060 --> 00:11:41,760 At a 12 byte offset, we also discovered the holds the current state of the device, which is the most crucial component. 123 00:11:42,020 --> 00:11:50,280 But additionally, at a varying offset, you could also find a descriptive string of that device, which is how we know this one is responsible for monitoring room temperature. 124 00:11:50,680 --> 00:11:58,980 So using this information is actually pretty straightforward to alter these data structures coming into these functions and thus get control of I.O., at least in theory. 125 00:11:59,600 --> 00:12:09,920 So using this information, we were able to craft malware that took advantage of this hooking method in order to control the I.O., but ultimately we had another challenge in front of us. 126 00:12:09,920 --> 00:12:19,500 And that challenge was that, unlike the watchdog kicking code, which we could just throw some C code onto the device and have it run, execute some functions that exist in memory, the handles to the I.O. 127 00:12:19,500 --> 00:12:23,380 hardware were trapped inside the program space of the existing programming. 128 00:12:23,380 --> 00:12:27,040 It could not be accessed normally from an external program. 129 00:12:27,120 --> 00:12:31,860 Somehow our malware had to be inserted into the memory space of the existing programming to do its job. 130 00:12:32,100 --> 00:12:33,340 How would we do it? 131 00:12:33,460 --> 00:12:36,640 Well, the solution ended up being something called LD preload. 132 00:12:36,680 --> 00:12:39,920 And for those that don't know, LD preload is a Linux environment variable. 133 00:12:40,280 --> 00:12:45,700 And the shared objects it points to are loaded first by a dynamic linker when a binary is executed. 134 00:12:46,080 --> 00:12:48,340 Now this is not a new or novel concept. 135 00:12:48,340 --> 00:12:49,240 We've not come up with this. 136 00:12:49,240 --> 00:12:56,460 It's actually a pretty common strategy in this field for inserting code into the existing program's memory space, which is exactly what we wanted to do. 137 00:12:56,760 --> 00:13:06,340 So in our case, we used persistence on the device in order to set this variable to point to our malware and thus we could insert it into the device's programming. 138 00:13:06,340 --> 00:13:09,640 But then the next challenge was, where do we put it? 139 00:13:09,740 --> 00:13:11,600 Well, here are our options. 140 00:13:11,740 --> 00:13:16,220 So this is a rough overview of the programming startup routine. 141 00:13:16,460 --> 00:13:23,560 And through some further reversing, we decided that the best place to put it would be this function called canioinit, highlighted in yellow. 142 00:13:23,760 --> 00:13:28,700 The reason being is, as Doug mentioned previously, this is a vastly multi-threaded application. 143 00:13:28,700 --> 00:13:30,440 It runs many threads in parallel. 144 00:13:30,440 --> 00:13:38,720 And in order to avoid race conditions or inconsistent behavior, we wanted a function that was called early initialization, called once, and called by a single thread. 145 00:13:38,720 --> 00:13:40,820 And this function met all those criteria. 146 00:13:41,220 --> 00:13:45,040 So what does it look like once our baby malware is inserted here? 147 00:13:45,040 --> 00:13:53,380 Well, once this function is executed, our malware starts up and it runs a thread in the background that listens for commands sent over the network by the attacker. 148 00:13:53,560 --> 00:13:55,500 It listens on a TCP port. 149 00:13:55,860 --> 00:14:08,640 And depending on the content of these commands , the malware will then intercept the corresponding calls to the IL control functions, alter the parameters, as I mentioned previously, thus granting us control of the hardware. 150 00:14:09,520 --> 00:14:15,700 Now, we were getting close to the end here, but we still had one and possibly the most important challenge in front of us. 151 00:14:15,700 --> 00:14:18,320 And that was, I couldn't afford my mortgage. 152 00:14:18,800 --> 00:14:21,400 Now hackers, we got to eat just like anyone else. 153 00:14:21,400 --> 00:14:24,120 So we wanted to see if we can make any money off this thing. 154 00:14:24,240 --> 00:14:28,020 Now obviously on stage, I would not try and sell any kind of malware. 155 00:14:28,060 --> 00:14:35,780 But purely hypothetically, if I was going to, I might mention that it does give you automatic discovery of all the hardware. 156 00:14:35,940 --> 00:14:38,900 You know, sit back and relax, it does all the recon for you. 157 00:14:39,300 --> 00:14:40,540 Hypothetically, of course. 158 00:14:41,260 --> 00:14:46,340 Another thing I might mention is that you get remote control through an interactive TCP session. 159 00:14:46,400 --> 00:14:50,800 A quick aside, how many of you here, show of hands, saw our original talk yesterday? 160 00:14:51,900 --> 00:14:52,840 Okay, that's not many. 161 00:14:52,840 --> 00:14:53,840 I'm going to recycle my jokes. 162 00:14:53,840 --> 00:14:54,440 Good. 163 00:14:54,560 --> 00:15:01,120 All right, so my therapist always told me that two-way communication is key to any healthy relationship. 164 00:15:01,120 --> 00:15:05,140 And so we decided to let you communicate with the malware through an interactive TCP session. 165 00:15:05,400 --> 00:15:08,300 Now am I saying this malware is going to fix your marriage? 166 00:15:08,540 --> 00:15:10,060 Yes, that's exactly what I'm saying. 167 00:15:10,320 --> 00:15:13,680 Okay, next, you can actually see the state of all the hardware in real time. 168 00:15:13,680 --> 00:15:15,960 So you can see exactly how much damage you're causing. 169 00:15:16,460 --> 00:15:24,580 And last but not least, send a single command and you revert the device to its original, unhacked state, wiping out any traces the malware is ever there. 170 00:15:25,100 --> 00:15:35,420 Best of all, if you call in the next 30 minutes, hypothetically, you could get all this and more for 30,000 easy payments of $19.95, shipping and handling not included. 171 00:15:36,000 --> 00:15:42,700 And if you're still not convinced, be sure to walk over 10 feet that way after the talk is over to check out our presentation. 172 00:15:42,700 --> 00:15:44,280 You can see this bad boy in action. 173 00:15:44,580 --> 00:15:50,900 But to show you a quick overview of how this looks in the real world, I'm going to hand it back to Doug. 174 00:15:53,100 --> 00:15:54,140 Thanks, Mark. 175 00:15:54,260 --> 00:16:00,820 And just to be clear, we're having some fun joking around, but we are in no way releasing the exploit code, malware code, or selling anything. 176 00:16:01,880 --> 00:16:04,400 I don't want to get fired and my boss is sitting right here. 177 00:16:04,400 --> 00:16:13,000 So, okay, so now that we've gone through a little bit of the challenges and a really high overview of how this works, what does this really look like? 178 00:16:13,040 --> 00:16:22,360 And one of our missions at McAfee's ATR team is we really want to demonstrate these in some means that it's really easy for everyone to see what the impact is. 179 00:16:22,360 --> 00:16:29,840 And because of that, we actually took the time to build a fully working demo unit, which as Mark said, is literally 10 feet over there afterwards if you want to see it in action. 180 00:16:29,840 --> 00:16:33,360 But I'll show you the demos as videos right now since they won't let us will it over. 181 00:16:34,540 --> 00:16:41,780 So what we built was a fully functional HVAC unit that's cooling a simulated data center. 182 00:16:41,780 --> 00:16:43,180 Because why a data center? 183 00:16:43,180 --> 00:16:46,300 Because this is one of the uses that this exact model is used for. 184 00:16:46,300 --> 00:16:53,980 We actually hired an installer that installs these on a regular basis to build this, and one of the main things they install it in is in data centers. 185 00:16:53,980 --> 00:16:56,780 Again, we're going for as realistic as possible. 186 00:16:57,000 --> 00:17:04,280 So if we take a look at what this unit looks like, excuse me, on the backhand side you see all the components of a normal working HVAC system. 187 00:17:04,280 --> 00:17:15,920 So we've got the valves, we've got fans, we've got pumps, and all this is doing is taking cold water from a cold water bin and using that to send cold air into our simulated data unit. 188 00:17:15,920 --> 00:17:22,860 You might say there's not usually cold water in a real unit, but again my boss was too cheap to buy an actual condenser, so that's what we were working with. 189 00:17:22,860 --> 00:17:27,480 On the other side we have a glassed-in simulated data center. 190 00:17:27,480 --> 00:17:34,540 We've got all this again HVAC equipment that you'd see in a data center, and we even have a raised floor with a server sitting on it generating heat. 191 00:17:34,600 --> 00:17:36,920 For a moment I'll bring your attention to one of the sensors. 192 00:17:36,920 --> 00:17:38,740 It's the independent temperature sensor. 193 00:17:38,740 --> 00:17:47,020 This is the only component not hooked up to the Delta system because it gives us ground truth for what the temperature is regardless of how much we mess the system up. 194 00:17:47,620 --> 00:17:51,880 On the top we have some simple LEDs indicating different states of the equipment. 195 00:17:51,880 --> 00:17:56,860 Again mostly just so it's visually easy to see, but the most important one is the alarm. 196 00:17:57,280 --> 00:18:01,820 And the alarm is an interesting one because in real life the alarm could be done one of two ways. 197 00:18:01,820 --> 00:18:10,980 It could simply be an LED, it could also be a siren, but more frequently the alarm is used for like email notification so that somebody knows this system's in distress. 198 00:18:11,260 --> 00:18:14,720 So anytime we talk about the alarm, that covers all of those. 199 00:18:14,720 --> 00:18:17,140 The attacker would be able to manipulate that as well. 200 00:18:17,320 --> 00:18:24,980 So I'm going to show you what this would actually look like if someone attacks it using our premium malware which will help pay for Mark's mortgage. 201 00:18:26,460 --> 00:18:32,580 On the upper right hand side of the screen you see the attacker running the exploit script that we ran. 202 00:18:32,580 --> 00:18:38,100 On the top right hand side of the screen you see the Delta controller picture-in-picture. 203 00:18:38,140 --> 00:18:49,500 As the attacker launches the exploit, leverages the vulnerability, it downloads our malware and a few other fun images and this reboots the system to leverage that LD preload method that Mark talked about. 204 00:18:49,500 --> 00:18:53,040 Here you can see we've replaced the images just to prove that it's hacked. 205 00:18:53,420 --> 00:18:57,900 No one would ever actually do this in the real world, but we're just going for a visual representation. 206 00:18:58,140 --> 00:19:03,320 Also we're logging in to follow along, but no one actually needs to touch or log in the system. 207 00:19:03,940 --> 00:19:08,260 So what are some of the things the attacker might do once they got to this point on the system? 208 00:19:08,280 --> 00:19:11,040 Well one thing they might do is control the outputs of the system. 209 00:19:11,040 --> 00:19:15,180 The system takes input and based on those inputs have a reaction to the outputs. 210 00:19:15,280 --> 00:19:21,640 So here what you're seeing is the attacker manually override several of the outputs on the screen one at a time. 211 00:19:21,640 --> 00:19:27,780 In the bottom right hand corner of the screen you will also see that the system is reacting accordingly. 212 00:19:27,780 --> 00:19:30,380 So the pump shutting off, the alarms turning off, etc. 213 00:19:30,380 --> 00:19:35,620 On the top right hand of this part of the screen you'll notice that the Delta screen is not reacting. 214 00:19:35,620 --> 00:19:37,720 In fact it's still staying in its previous state. 215 00:19:37,720 --> 00:19:44,200 This is because our premium malware has the ability to adjust or not adjust the screen based on the attacker's will. 216 00:19:44,200 --> 00:19:50,020 And if we start talking about alerting or whether the user is aware, this is a very important feature. 217 00:19:50,580 --> 00:19:54,380 So what you just saw turning stuff on and off, that's binary outputs. 218 00:19:54,380 --> 00:19:58,020 These systems typically have both analog and binary outputs. 219 00:19:58,020 --> 00:20:03,320 And all analog means is they're set to some floating point value instead of just on or off. 220 00:20:03,400 --> 00:20:07,240 So to manipulate those the attacker can do that as well through the same interface. 221 00:20:07,240 --> 00:20:12,840 This time that you will see the Delta screen update because we're going to have the attacker choose to update the screen. 222 00:20:12,840 --> 00:20:19,520 So they're going to change the fan speed in the valve and you can again see the component reacting appropriately in the bottom right hand corner of the screen. 223 00:20:19,860 --> 00:20:28,140 Also what we've done in this malware is provide a reset function which sets everything back to its original programming without removing the malware's presence. 224 00:20:28,140 --> 00:20:32,480 So it kind of gives the attacker a way to put things back and still have persistence on the device. 225 00:20:33,520 --> 00:20:40,620 So controlling outputs are fun but it would be a lot of work for an attacker to have to manipulate all the outputs in order to get the outcome that they wanted. 226 00:20:40,680 --> 00:20:47,180 Remember I mentioned that these systems are designed to take input and based on that input perform some action. 227 00:20:47,320 --> 00:20:55,320 So instead of controlling the outputs if we manipulated the incoming data then the the rest of the system would just function as normally. 228 00:20:55,520 --> 00:21:02,280 So in the world of HVAC if the system thought it was reading 30 and 40 degrees from the data center what would it do? 229 00:21:02,280 --> 00:21:04,060 It would do the same thing your house HVAC would do. 230 00:21:04,060 --> 00:21:06,560 It would turn itself off because it has no need to cool. 231 00:21:06,560 --> 00:21:13,280 That's exactly what we have going on here and you can see our independent temperature sensor in the bottom right hand corner the temperature is rising. 232 00:21:13,740 --> 00:21:17,120 Alarms are not going to trigger because the system doesn't think it's in distress. 233 00:21:17,400 --> 00:21:28,280 You know all the valves or dampers and stuff they're going to close on their own without the attacker doing anything because that's how the system's programmed to react when it thinks it's only 30 or 40 degrees inside the data center. 234 00:21:28,280 --> 00:21:33,080 So this is actually a more impactful scenario controlling the inputs than the outputs. 235 00:21:33,900 --> 00:21:53,960 And a data center again is just one example of how this how these would work in the real world but think about you know a major corporation insert your favorite name cloud provider and if their data center was to lose HVAC for a couple days without their technicians knowing being any of the wiser we could probably impact a pretty large portion of the internet. 236 00:21:54,360 --> 00:22:12,820 But we want to highlight that data centers are not the only thing because this is a building controller and it's not agnostic to one industry these are installed across a very wide range of industries and I'm going to highlight a couple of examples in those industries just so we understand the impact beyond melting down a data center. 237 00:22:13,200 --> 00:22:22,880 So the first one I'm going to talk about is the health care industry and the health care is slightly unique in the fact that building controllers control pressure in individual rooms throughout a hospital. 238 00:22:22,900 --> 00:22:25,420 And what do I mean by controlling pressure? 239 00:22:25,520 --> 00:22:34,180 Well by setting the pressure in different rooms, I'm sorry, by setting the pressure in different rooms to different degrees, it prevents the spread of disease. 240 00:22:34,180 --> 00:22:41,080 So by having a positive pressure in one room and negative pressure in the other room, disease can't travel from one side of the hospital to the other side. 241 00:22:41,080 --> 00:22:45,940 The other unique thing about controlling pressure is it's just a very very small change in pressure. 242 00:22:46,000 --> 00:22:49,500 Unlike temperature you might walk into a room and say hey it's kind of hot in here. 243 00:22:49,500 --> 00:22:53,680 If you walk into a room you're not going to say hey the pressure is kind of low in here. 244 00:22:53,720 --> 00:22:58,520 So the humans not going to notice that change, it's a very small change. 245 00:22:58,520 --> 00:23:14,420 And if an attacker was to get on one of these systems, make it so the hospital pressure was even throughout everything, I'm talking the OR, you know the quarantine room, the rooms where the housing critical diseases or samples, all of a sudden all that stuff would be able to travel airborne throughout the hospital. 246 00:23:14,420 --> 00:23:16,280 And that could actually affect human life. 247 00:23:16,380 --> 00:23:18,440 That's a pretty interesting scenario. 248 00:23:19,120 --> 00:23:33,040 If we talk about the government sector for a moment, I only bring up this one because we did some online open-source intelligence research and found that these systems are actually being used in certain government buildings, state governments, for access control. 249 00:23:33,160 --> 00:23:43,580 Well if you think about that impact, if we were able to access one of these systems in a state government building for access control, I don't think I have to go into too much detail at a hacker conference of what that would provide, right? 250 00:23:43,580 --> 00:23:49,500 We would be able to access maybe sensitive data that we weren't supposed to get to, social our way, engineer our way in. 251 00:23:50,400 --> 00:24:00,540 And last but not least, I'll take a moment just to highlight education just because I think it's a one that people are probably asking yourself, why do I care if you can affect the HVAC system in my kids preschool? 252 00:24:00,720 --> 00:24:11,080 And what I would argue is we often forget that because this system is completely accessible over the internet and remotely exploitable, it's not only about the system itself. 253 00:24:11,080 --> 00:24:26,100 Unfortunately, we find that a lot of times these are not air gaps and there's other systems on the network and being able to control a system that's on the network in a hundred percent capacity will allow us to potentially view video feeds that are going over the network or compromise other systems on the network, 254 00:24:26,100 --> 00:24:29,300 which all of a sudden you might care a little bit more about than just the temperature. 255 00:24:30,060 --> 00:24:37,680 But don't worry, no one would actually connect these systems to the network so we really have nothing to worry about from a network perspective. 256 00:24:37,940 --> 00:24:39,480 Oh, I forgot about that. 257 00:24:39,480 --> 00:24:42,920 Shodan does show us this a little different than the optimal version. 258 00:24:42,920 --> 00:24:54,120 So at the time that we originally did this, the exact model that we exploited that has the vulnerable firmware, there was about 500 of these on the internet at the given time. 259 00:24:54,800 --> 00:25:06,680 And the thing was, where we discovered this vulnerability is pretty low on the stack and it's because it digests the BACnet protocol, it's actually used across multiple Delta Controls devices. 260 00:25:06,680 --> 00:25:08,940 It's not specific to this Delta Control unit. 261 00:25:08,960 --> 00:25:17,480 And if we look at those numbers connected to the internet, all of a sudden we get to about 1,700 connected to the internet that has the potential to be vulnerable to this vulnerability. 262 00:25:17,480 --> 00:25:21,840 Give or take 10% or so for honeypots that we found on the internet as well. 263 00:25:22,260 --> 00:25:29,680 So with that said, I think we've covered just about all of the impact and the details of the vulnerability. 264 00:25:29,680 --> 00:25:32,440 I want to take a moment to highlight the vendor for this. 265 00:25:32,580 --> 00:25:41,840 Per McAfee's responsible disclosure policy, we disclosed to the vendor that we found this bug and everything that we were able to do with it in late 2018. 266 00:25:42,080 --> 00:25:46,200 A CVE number was generated and then we worked very closely with the vendor. 267 00:25:46,200 --> 00:25:49,720 And in June of 2019, the vendor released a patch. 268 00:25:50,020 --> 00:25:54,980 ATR has tested the patch and is happy to confirm the patch fully does mitigate this issue. 269 00:25:55,380 --> 00:26:05,940 And I also want to take a moment just to say that Delta was awesome to work with and they were kind of what I'd like to see as the gold standard going forward for security researchers releasing bugs. 270 00:26:06,340 --> 00:26:13,660 A lot of times, I've been in the industry for almost 10 years and there's a lot of bad blood sometimes between security vendors or security researchers and vendors. 271 00:26:14,020 --> 00:26:17,240 These guys were extremely receptive to the information we provided them with. 272 00:26:17,240 --> 00:26:20,660 They worked with us very closely to make sure the system has been patched. 273 00:26:20,660 --> 00:26:23,640 And this is really what we want to see from all the vendors in the industry. 274 00:26:23,640 --> 00:26:25,200 We're not trying to do anything negative. 275 00:26:25,200 --> 00:26:28,420 We're actually trying to help you and find these bugs before the bad guys do. 276 00:26:28,460 --> 00:26:36,060 And this is really a good example on how effective that can be if you can get a good relationship with the vendor because they're actively patching these systems right now. 277 00:26:36,060 --> 00:26:40,140 We've actually already seen the patch being applied and less of these systems vulnerable on the internet. 278 00:26:40,700 --> 00:26:42,900 So thank you for your time. 279 00:26:43,040 --> 00:26:48,240 Mark and I will be here at the our demo station which is again literally 10 or 20 feet over there. 280 00:26:48,240 --> 00:26:54,320 We're happy to answer any questions you might have further or and I think we're probably we're gonna get off stage here. 281 00:26:54,320 --> 00:26:56,440 So any questions you have please come to our station. 282 00:26:56,440 --> 00:26:57,260 Thank you.