1 00:00:00,000 --> 00:00:01,500 So I guess we'll get started here. 2 00:00:01,500 --> 00:00:02,600 Can you hear me okay? 3 00:00:02,600 --> 00:00:03,780 Is the audio working? 4 00:00:03,780 --> 00:00:04,660 Perfect. 5 00:00:05,320 --> 00:00:19,000 So today we're going to talk about Common Industrial Protocol and just kind of an introduction how to get started if you want to do your own exploitation, maybe learning about the protocol, do some basic pen testing, that kind of thing. 6 00:00:20,780 --> 00:00:23,880 So let's talk about what is CIP. 7 00:00:25,740 --> 00:00:33,900 Common Industrial Protocol is a communications protocol used by industrial devices. 8 00:00:34,440 --> 00:00:37,460 So you have things like programmable logic controllers. 9 00:00:37,460 --> 00:00:42,020 These are the computers actually in your industrial facilities. 10 00:00:42,020 --> 00:00:43,840 They're controlling your plant. 11 00:00:43,840 --> 00:00:51,060 They're running the logic, opening and closing valves, turning pumps on and off, looking at sensors. 12 00:00:51,060 --> 00:01:00,560 And a lot of PLC systems can communicate via CIP or they work with other devices in your plant that will use CIP. 13 00:01:00,560 --> 00:01:09,760 So examples would be like variable frequency drives, which are the devices that control the speed of motors running in your plant. 14 00:01:10,020 --> 00:01:11,640 You have things like motor starters. 15 00:01:11,640 --> 00:01:20,280 These would be energizing motors, power monitoring systems, smart sensors and instruments, devices that open and close valves. 16 00:01:20,280 --> 00:01:26,040 All of these devices can talk Common Industrial Protocol at one level or another. 17 00:01:26,820 --> 00:01:34,500 Now with that, CIP isn't a typical protocol in the sense that we think of for network protocols. 18 00:01:34,500 --> 00:01:38,520 It actually extends beyond your Ethernet networks in your plant. 19 00:01:39,140 --> 00:01:42,960 So there is versions of CIP like DeviceNet. 20 00:01:42,960 --> 00:01:46,420 DeviceNet uses a CAN bus based system. 21 00:01:46,420 --> 00:01:50,340 There's ControlNet, which is coaxial based. 22 00:01:50,520 --> 00:01:52,680 EtherNet IP, which is the Ethernet version. 23 00:01:53,060 --> 00:01:55,660 And CompoNet, which we're not going to talk about because nobody cares. 24 00:01:58,220 --> 00:02:06,820 So originally, it was developed by Allen Bradley, which is a company that builds a lot of industrial hardware, especially in the US. 25 00:02:06,980 --> 00:02:13,260 The very first implementation of it was revealed in Chicago in 1994. 26 00:02:13,260 --> 00:02:19,940 And it really opened up the world for what was possible bringing data onto the plant floor. 27 00:02:19,940 --> 00:02:23,560 How to actually have smart devices in your plant. 28 00:02:23,680 --> 00:02:29,040 Before then, you had primitive PLC systems that were all independent of one another. 29 00:02:29,040 --> 00:02:35,400 There was a couple vendors playing around with some serial forms of communication, but it was slow and clunky. 30 00:02:35,400 --> 00:02:51,380 And when DeviceNet came out, it opened you up to having very flexible installations of smart sensors and other types of devices than a PLC able to exchange data in your plant. 31 00:02:52,060 --> 00:02:57,460 In 1997, they released ControlNet, coaxial based. 32 00:02:57,460 --> 00:03:02,780 It's based on the 802.3b specification for its Layer 1. 33 00:03:02,780 --> 00:03:05,700 So that's your old school coaxial Ethernet. 34 00:03:05,700 --> 00:03:09,620 It uses the same type of Manchester signaling on the coax. 35 00:03:10,160 --> 00:03:12,920 Later in 2000, EtherNet IP came out. 36 00:03:12,920 --> 00:03:17,620 That's EtherNet Industrial Protocol, not to be confused with TCP IP. 37 00:03:18,120 --> 00:03:23,400 And it utilizes both UDP and TCP for transport, multicast, unicast. 38 00:03:23,400 --> 00:03:27,140 It's quite the interesting system. 39 00:03:27,380 --> 00:03:30,100 Again, nobody cares about CompoNet. 40 00:03:30,100 --> 00:03:33,760 So how does EtherNet IP actually work? 41 00:03:33,760 --> 00:03:35,940 Let's talk about the SIP stack. 42 00:03:36,560 --> 00:03:40,860 You have your TCP and your UDP. 43 00:03:41,660 --> 00:03:44,380 You have an encapsulation protocol. 44 00:03:44,380 --> 00:03:48,480 That's actually what is EtherNet IP, is that encapsulation protocol. 45 00:03:48,920 --> 00:03:53,100 You have different types of messaging, implicit and explicit. 46 00:03:53,100 --> 00:03:56,560 Implicit is just a device streaming information. 47 00:03:56,620 --> 00:03:59,640 Explicit is a request and a response. 48 00:03:59,640 --> 00:04:01,160 Single transactions. 49 00:04:01,740 --> 00:04:05,100 You have CIP network and transport. 50 00:04:05,100 --> 00:04:11,880 CIP is super unique in the sense that it was pre-EtherNet networks in the plant. 51 00:04:11,880 --> 00:04:17,240 So they invented their own method for doing things like routing, doing things like CRC checks. 52 00:04:17,240 --> 00:04:25,260 Everything that you take for granted that's handled for you at your EtherNet level, CIP has those mechanisms built into it as well. 53 00:04:25,260 --> 00:04:37,040 So when running on EtherNet-based networks, yes, you're taking advantage of TCP routing, but you're also taking advantage of CIP's network capabilities such as CIP routing. 54 00:04:37,580 --> 00:04:41,980 And then finally you have your application objects, your device profiles. 55 00:04:41,980 --> 00:04:52,720 These are actual C++ objects executing in the firmware of these devices that CIP hooks into, and that actually gives you the functionality for the protocol. 56 00:04:52,720 --> 00:04:54,240 And we'll talk about that. 57 00:04:55,460 --> 00:04:58,100 Like I said, objects. 58 00:04:58,100 --> 00:05:00,100 So what are CIP objects? 59 00:05:00,100 --> 00:05:08,300 CIP objects are fascinating because CIP operates a lot like a remote procedure call type protocol. 60 00:05:08,300 --> 00:05:20,960 You have objects in memory, in your firmware, and you have a class ID, and that ID number is a unique ID that references that C++ class. 61 00:05:20,960 --> 00:05:26,160 You have instance IDs, and they represent the instances of those classes. 62 00:05:26,360 --> 00:05:27,660 You have attributes. 63 00:05:27,660 --> 00:05:31,200 Your attributes are variables within those objects. 64 00:05:31,600 --> 00:05:39,120 And finally you have your services, which are actual functions in that object that you can call over the network. 65 00:05:39,800 --> 00:05:49,780 All of these different things, your class, your instance, your attribute, your service, they're addressed by unique identifiers, integer-based identifiers. 66 00:05:49,780 --> 00:05:51,300 So they're not using strings. 67 00:05:51,300 --> 00:05:52,780 They're not using names. 68 00:05:53,720 --> 00:06:13,140 When you send a CIP request, if I'm telling a device, hey, I want you to go turn this pump on, or I want you to energize 24 volts out to some device in the field, you do that with a CIP command that consists of what service you want to run, what class you're running it on, 69 00:06:13,140 --> 00:06:21,100 what instance you're executing that service actually against, and then sometimes what attribute that service is going to operate on. 70 00:06:21,100 --> 00:06:24,880 Maybe you're setting the value of a variable within that object. 71 00:06:26,780 --> 00:06:34,640 So let's talk about probably the most common, the most basic CIP object, the identity class. 72 00:06:34,640 --> 00:06:40,500 The identity class is instance ID 1, easy to remember. 73 00:06:40,880 --> 00:06:45,480 It has a default instance of that class, ID 1. 74 00:06:45,600 --> 00:06:53,100 And it supports a function, a service code of get all attributes, which is service 1. 75 00:06:53,300 --> 00:06:57,560 So, easy message to remember, 1, 1, 1. 76 00:06:57,560 --> 00:07:01,880 And that's going to tell you all the basic information about that device. 77 00:07:01,880 --> 00:07:05,300 So, we call that the who message. 78 00:07:05,960 --> 00:07:10,100 And in the who message, you're going to get things like the vendor of the device. 79 00:07:10,300 --> 00:07:21,320 And you can see, or maybe not because it's kind of cut off here at the bottom, but on the bottom you can see this JSON payload here where I've sent a who message to a device using a Python tool. 80 00:07:21,680 --> 00:07:27,180 And it's returned to me the vendor, the product type, the firmware revision. 81 00:07:27,180 --> 00:07:29,200 It's returned to me the device status. 82 00:07:29,200 --> 00:07:29,940 Is it running? 83 00:07:29,940 --> 00:07:30,740 Is it faulted? 84 00:07:30,740 --> 00:07:33,100 Is it in some kind of configuration mode? 85 00:07:33,600 --> 00:07:36,840 It's told me the serial number of the device. 86 00:07:37,400 --> 00:07:42,580 It's told me the actual product name, the string of the device, which is on the end over here so you can't see it. 87 00:07:44,820 --> 00:07:50,940 The who message retrieves all the information about the device from the identity object. 88 00:07:50,940 --> 00:07:57,060 And just like the identity object exists, there's hundreds of CIP objects within these devices. 89 00:07:57,060 --> 00:07:59,580 And all of them have a very specific purpose. 90 00:07:59,720 --> 00:08:05,860 They have very specific services which retrieve data out of them, or they perform functions within that object. 91 00:08:06,280 --> 00:08:12,260 And all of these objects all together make up your CIP protocol. 92 00:08:12,420 --> 00:08:14,940 So, different devices will have different objects. 93 00:08:14,940 --> 00:08:19,960 The core specification says which ones you're required to have, which ones are optional. 94 00:08:19,960 --> 00:08:24,740 And most vendors throw all that out the window and just say we're going to implement whatever we want. 95 00:08:24,980 --> 00:08:30,020 And so you're really up to the vendor to tell you what objects exist and why they exist and how to use them. 96 00:08:30,020 --> 00:08:32,160 And generally they don't like giving up that information. 97 00:08:34,580 --> 00:08:41,960 So, if we want to actually talk to one of these devices, access these CIP objects, there's three ways to do this. 98 00:08:41,960 --> 00:08:46,720 There's three forms of what we call explicit communication. 99 00:08:46,720 --> 00:08:51,180 That's where we're doing a request and we get a response from the device. 100 00:08:51,540 --> 00:08:53,220 There is UCMM. 101 00:08:53,280 --> 00:08:56,400 That's your Unconnected Message Manager. 102 00:08:56,820 --> 00:09:06,760 And what that means, we talked about how CIP has its own mechanisms for things like routing and other network services that TCP already provides. 103 00:09:07,060 --> 00:09:12,520 So, UCMM, that's kind of similar to saying, hey, I don't need a session. 104 00:09:12,520 --> 00:09:17,120 That's saying, you know, kind of like you're sending out a UDP request and getting it back. 105 00:09:17,120 --> 00:09:19,240 That would be the equivalent in networking terms. 106 00:09:19,240 --> 00:09:25,100 Now, this is over TCP, but I'm creating a CIP request without a CIP session. 107 00:09:25,100 --> 00:09:27,120 And I'm saying, hey, do this thing. 108 00:09:27,120 --> 00:09:28,160 Send me the data back. 109 00:09:28,160 --> 00:09:30,060 There's no CIP routing involved. 110 00:09:30,060 --> 00:09:32,740 There's no other CIP networking mechanisms involved. 111 00:09:32,740 --> 00:09:35,140 It's the most simple type of request. 112 00:09:35,660 --> 00:09:40,360 Then there's unconnected messaging, unconnected requests. 113 00:09:40,360 --> 00:09:43,920 Unconnected means I'm creating a CIP session. 114 00:09:43,920 --> 00:09:45,360 I'm creating a request. 115 00:09:45,360 --> 00:09:52,620 I'm using all of the capabilities of CIP routing, but I'm only going to do it for a single request. 116 00:09:52,780 --> 00:09:56,000 And so both sides know, hey, we spent all this effort. 117 00:09:56,000 --> 00:09:58,440 We set up a CIP route. 118 00:09:58,440 --> 00:10:00,460 We had multiple devices involved. 119 00:10:00,460 --> 00:10:02,300 I'm processing the request. 120 00:10:02,300 --> 00:10:06,400 I send you the response, and then we automatically destroy that connection. 121 00:10:06,760 --> 00:10:10,060 So it is a single session used for a single request. 122 00:10:10,660 --> 00:10:16,900 And finally, there are connected sessions, connected CIP requests. 123 00:10:16,900 --> 00:10:20,460 And that's identical to unconnected, but it leaves the connection open. 124 00:10:20,460 --> 00:10:29,980 So you can now reuse all of that information that you've specified for your routed path, for any other network infrastructure you set up between those devices. 125 00:10:29,980 --> 00:10:31,760 They'll persist that connection. 126 00:10:31,760 --> 00:10:35,760 You have a session number, and you can reuse that session number. 127 00:10:35,760 --> 00:10:41,220 That session number is interesting because that is completely independent of your TCP session. 128 00:10:41,300 --> 00:10:46,320 Your TCP session can make or break a hundred times, and CIP doesn't care. 129 00:10:46,320 --> 00:10:48,820 Your CIP session will persist. 130 00:10:49,300 --> 00:11:03,440 So you can see that layer of abstraction where we have duplications of infrastructure scaffolding in our networking environment where CIP has its own versions of things like sessions and routing, independent of TCPs. 131 00:11:04,940 --> 00:11:10,740 So let's talk about routing, because routing in CIP is one of the things that makes it super fascinating. 132 00:11:11,820 --> 00:11:21,640 CIP, because it is different types of networks, not just Ethernet, it has mechanisms in it to allow it to be backwards compatible with its predecessor networks. 133 00:11:22,020 --> 00:11:25,700 So here on the top, I have a CIP path. 134 00:11:26,360 --> 00:11:28,320 You can see IP addresses in there. 135 00:11:28,320 --> 00:11:31,420 That doesn't really look like a normal web path, does it? 136 00:11:31,960 --> 00:11:35,740 On the top, we have an Ethernet IP network. 137 00:11:35,740 --> 00:11:37,320 That's our SCADA network. 138 00:11:37,320 --> 00:11:41,180 This would be your process control network, perhaps, in your plant. 139 00:11:41,220 --> 00:11:42,980 And we're saying we're some device. 140 00:11:42,980 --> 00:11:46,020 We're starting here, somewhere on our plant floor. 141 00:11:46,220 --> 00:11:56,560 And I want to connect all the way down here to a card in this PLC, a module that is in the chassis of a PLC somewhere completely else in my plant. 142 00:11:57,220 --> 00:12:01,360 Well, we can build out a path to do that, because all these devices talk CIP. 143 00:12:01,420 --> 00:12:06,060 And we can say, hey, I want to talk to whatever device is 10.0.10.10. 144 00:12:06,420 --> 00:12:09,060 And that takes me to that Ethernet card in that chassis. 145 00:12:09,360 --> 00:12:15,900 I can say comma 1 to go out port 1 of that device, which actually takes me to the backplane of that chassis itself. 146 00:12:16,160 --> 00:12:18,460 I can say then, go to slot 10. 147 00:12:18,500 --> 00:12:21,160 And that takes me to slot 10 in my chassis. 148 00:12:21,760 --> 00:12:23,780 From there, I say, go out port 2. 149 00:12:23,780 --> 00:12:25,860 That's that purple 2. 150 00:12:25,980 --> 00:12:30,360 And that takes me out the control net port of that card. 151 00:12:30,360 --> 00:12:35,420 We've now transitioned from an Ethernet-based network onto a control net-based network. 152 00:12:35,600 --> 00:12:40,140 From there, I'm going to say, go to node 4, which is my HMI down here. 153 00:12:40,580 --> 00:12:47,880 From node 4, I'm going to say, go out port 3, which is the redundant Ethernet connection on that HMI. 154 00:12:48,300 --> 00:12:51,780 And then I'm going to say, go to 192.168.1.1. 155 00:12:52,080 --> 00:12:54,480 That's my PLC down here at the bottom. 156 00:12:54,480 --> 00:12:56,240 That's its Ethernet card. 157 00:12:56,240 --> 00:13:02,340 And finally, comma 1 to go to its backplane, comma 5 to go to slot 5. 158 00:13:02,380 --> 00:13:14,400 I just sent a request from one Ethernet network that had no Ethernet-based connections to another Ethernet-based network by utilizing CIP routing. 159 00:13:14,400 --> 00:13:16,500 I traversed a control net network. 160 00:13:16,500 --> 00:13:20,700 I traversed three different devices to get there. 161 00:13:21,900 --> 00:13:30,060 Essentially, we took two networks that, from a network topology standpoint, looked like they were air-gapped. 162 00:13:30,160 --> 00:13:33,640 And we got a command between them. 163 00:13:34,400 --> 00:13:43,720 That's what makes CIP routing so fascinating, is the security implications of what you can do on these devices between networks. 164 00:13:44,240 --> 00:13:45,720 It's freely available. 165 00:13:45,720 --> 00:13:49,640 You can route between these types of networks all day long, and these devices do not care. 166 00:13:51,800 --> 00:13:53,980 So now we're going to talk about the fun stuff. 167 00:13:54,820 --> 00:13:58,720 Just a quick disclaimer, this is critical infrastructure. 168 00:13:58,920 --> 00:14:03,360 We are going to be talking a little bit about how to get started hacking critical infrastructure. 169 00:14:03,620 --> 00:14:07,420 So with that, we'll put on our blue team hats, not our red team hats, right? 170 00:14:08,420 --> 00:14:12,100 These systems do protect humans, right? 171 00:14:12,100 --> 00:14:15,300 When hacking into these systems, you never want to hack a live system. 172 00:14:15,300 --> 00:14:17,480 You could kill people, many people. 173 00:14:17,480 --> 00:14:19,880 These systems protect the environments. 174 00:14:19,880 --> 00:14:26,180 When hacking into these systems, there are catastrophic environmental consequences if you do something incorrectly. 175 00:14:26,500 --> 00:14:28,820 And finally, physical infrastructure itself. 176 00:14:28,820 --> 00:14:32,200 You could take down entire refineries, power grids. 177 00:14:32,340 --> 00:14:37,160 The astronomical impacts of these systems when they go down is quite large. 178 00:14:37,540 --> 00:14:41,880 We don't do this for the sake of breaking into things because it's fun. 179 00:14:41,880 --> 00:14:47,400 We do this for the sake of knowing how to protect our critical infrastructure, right? 180 00:14:49,260 --> 00:14:50,180 Okay. 181 00:14:50,180 --> 00:14:51,520 There's the scary talk. 182 00:14:51,520 --> 00:14:52,800 Let's do the fun talk. 183 00:14:52,800 --> 00:14:53,880 Fuzzing! 184 00:14:53,880 --> 00:14:55,460 Everybody like fuzzy things? 185 00:14:55,460 --> 00:14:56,680 I like fuzzy things. 186 00:14:56,680 --> 00:14:58,080 My dog is fuzzy. 187 00:15:00,040 --> 00:15:06,780 Fuzzing is when we send targeted random values to a device through the protocol. 188 00:15:07,200 --> 00:15:13,000 So we talked about how we have these ID numbers for classes, instances, attributes and services. 189 00:15:13,220 --> 00:15:14,500 They're just numbers. 190 00:15:14,500 --> 00:15:23,960 What if we selected some number ranges and just sent requests where we said, hey, I want to send a specific service. 191 00:15:24,020 --> 00:15:31,160 Maybe I'm going to use the GetAttributeListService, service three, on every instance zero. 192 00:15:31,280 --> 00:15:35,220 And instance zero is the singleton or static instance of a class. 193 00:15:35,460 --> 00:15:39,680 And I'm going to say, do it on every instance number between X and Y. 194 00:15:39,720 --> 00:15:41,540 I'm just going to see what I get back. 195 00:15:41,540 --> 00:15:51,720 And that's a really common way to find out what C++ objects in my firmware are attached to the CIP protocol within that device. 196 00:15:51,800 --> 00:15:57,980 That gives me very quick and dirty knowledge of what actually is in there in the device. 197 00:15:58,340 --> 00:16:02,240 How do I find what functions I have available to me? 198 00:16:02,240 --> 00:16:05,620 Because there's no way to say, hey, tell me what you can do. 199 00:16:05,760 --> 00:16:07,760 The vendors don't want it to have that function, right? 200 00:16:07,760 --> 00:16:10,580 So it's not going to give you a list of everything it supports. 201 00:16:10,580 --> 00:16:12,300 You have to go find it. 202 00:16:12,640 --> 00:16:15,640 So fuzzing is a really cool technique to do this. 203 00:16:16,280 --> 00:16:17,980 So here's a fuzzing example. 204 00:16:18,440 --> 00:16:21,540 I've built a simple Python script here. 205 00:16:21,600 --> 00:16:24,900 I'm using service, zero, three. 206 00:16:25,100 --> 00:16:27,260 That's GetAttributeList. 207 00:16:27,820 --> 00:16:33,020 I'm using class code of class ID, as you can see, which is in my for loop. 208 00:16:33,020 --> 00:16:35,960 And I'm saying, I just want to hit every class from one to a thousand. 209 00:16:35,960 --> 00:16:38,140 Let's just see what we can find, right? 210 00:16:39,240 --> 00:16:40,740 I'm using instance zero. 211 00:16:40,740 --> 00:16:43,820 I'm querying the singleton instance of these classes. 212 00:16:44,280 --> 00:16:49,240 And I'm using attribute zero, which is the null attribute, meaning I don't need an attribute in this case. 213 00:16:50,540 --> 00:16:55,540 At the bottom, you're going to see an output, a snippet of what this script returned here. 214 00:16:55,540 --> 00:17:01,320 And you can see, we have a whole bunch of these destination unknown, class unsupported, instance, yada, yada, yada. 215 00:17:01,440 --> 00:17:04,160 Basically telling me, hey, there's nothing there. 216 00:17:04,160 --> 00:17:04,900 Good luck. 217 00:17:04,900 --> 00:17:05,760 Try again. 218 00:17:05,760 --> 00:17:07,800 But you can see we've got two hits there. 219 00:17:07,800 --> 00:17:10,560 And I've put those in red boxes. 220 00:17:10,680 --> 00:17:17,240 The first one, class 0xA1, we've got a service not supported. 221 00:17:18,040 --> 00:17:20,320 Okay, what does that tell us? 222 00:17:20,320 --> 00:17:21,860 There's an object there. 223 00:17:22,040 --> 00:17:27,480 It doesn't support the GetAttributeList service, but we know there's an object there now, right? 224 00:17:27,480 --> 00:17:35,280 So if we wanted to expand on our fuzzing, what we'd do is reset up our script to go hit every service code and see what service codes give us errors. 225 00:17:36,260 --> 00:17:37,740 That's good to know, right? 226 00:17:37,740 --> 00:17:44,700 We can now start pentesting that particular object and figuring out what it's capable of, what data it's storing. 227 00:17:45,160 --> 00:17:47,680 We've got another hit, class 0xAA. 228 00:17:47,700 --> 00:17:53,140 In this case, this is a known object that's actually part of the protocol specification. 229 00:17:53,640 --> 00:17:56,340 It's the Ethernet TCP IP object. 230 00:17:56,340 --> 00:18:02,010 It's the object that stores the device's IP address, MAC address, diagnostics counters for its Ethernet ports. 231 00:18:02,700 --> 00:18:05,740 And we've got a service not supported from it as well. 232 00:18:06,260 --> 00:18:07,560 Well, that's easy. 233 00:18:07,560 --> 00:18:13,240 I'm just going to go get the spec out and say, hey, what services does this object actually have in it as part of the specification? 234 00:18:13,560 --> 00:18:16,320 Because I know this device now has that object. 235 00:18:16,660 --> 00:18:19,760 Now, granted, I'm talking to it on an Ethernet-based network. 236 00:18:19,760 --> 00:18:21,320 It better have that object. 237 00:18:21,320 --> 00:18:31,460 But the fact that it's exposing that object to me on the network means I can now access that object, I can query that object, and I can control that object. 238 00:18:31,460 --> 00:18:46,320 Because as part of the CIP specification, the TCP object allows me to remotely set the IP address of the device, change its gateway, change its subnet mask, without requiring any authentication mechanism. 239 00:18:47,200 --> 00:18:54,060 You can modify the script right here to go change the IP address of this device just like that, and the device would have a new IP address. 240 00:18:56,660 --> 00:19:00,800 So, that's kind of a quick and dirty intro into fuzzing. 241 00:19:01,140 --> 00:19:02,520 What do you do next? 242 00:19:03,020 --> 00:19:08,540 Well , in the Rockwell-Allen-Bradley world, we have what we call a Minerf. 243 00:19:08,540 --> 00:19:10,300 Really fun word to say. 244 00:19:10,540 --> 00:19:14,060 That is a major non-recoverable fault. 245 00:19:14,060 --> 00:19:17,320 And it is the easiest thing to do to a controller. 246 00:19:17,320 --> 00:19:20,620 It's also perhaps one of the most dangerous things to do to a controller. 247 00:19:20,740 --> 00:19:25,540 A Minerf will stop whatever device is from executing. 248 00:19:25,540 --> 00:19:27,400 So, it will halt execution. 249 00:19:27,460 --> 00:19:32,620 It will cause it to dump its entire configuration out of memory. 250 00:19:33,020 --> 00:19:35,560 It has no more program, no more configuration. 251 00:19:35,820 --> 00:19:41,660 It is just a dumb, dead box waiting for a technician or engineer to plug into it and give it a new program. 252 00:19:42,720 --> 00:19:46,920 That's dangerous because, as we talked about, these devices are running critical infrastructure. 253 00:19:47,180 --> 00:19:56,960 So, you can imagine, you have some computer in your plant, and it's controlling the pressure on a pressure vessel that's at 10,000 PSI. 254 00:19:56,960 --> 00:19:59,060 And all of a sudden, that computer just halts. 255 00:19:59,060 --> 00:20:00,800 It says, no, I'm done. 256 00:20:00,800 --> 00:20:07,920 And, you know, you might have some valve feeding that system, providing whatever product is going into that vessel. 257 00:20:07,920 --> 00:20:12,780 And if it can no longer say, hey, we're getting too much pressure, we need to close that valve. 258 00:20:12,780 --> 00:20:15,580 And that vessel is just going to overpressure and blow up. 259 00:20:15,920 --> 00:20:26,680 Now, presumably, your mechanical engineering team has put some other types of safety mechanisms in place, like pressure relief valves or any other type of mechanism like that. 260 00:20:26,680 --> 00:20:28,600 Like, generally, these systems are fail-safe. 261 00:20:28,600 --> 00:20:32,700 So, if one of these computers crashes, you have relay logic. 262 00:20:32,700 --> 00:20:38,860 And as part of the electrical installation, how these systems are wired, your valves should go to whatever their safe position is. 263 00:20:38,860 --> 00:20:40,180 Maybe you're venting that vessel. 264 00:20:40,180 --> 00:20:43,500 Maybe you're cutting off the flow of product into that vessel. 265 00:20:43,500 --> 00:20:49,160 But still, you have caused a disruption that very potentially could have major impacts. 266 00:20:49,800 --> 00:20:57,420 The reason minerfs are easy to find from a fuzzing perspective is these systems do integrity checks on themselves continuously. 267 00:20:58,600 --> 00:21:09,280 And if they see that there was a failure to validate input and it caused a buffer overflow, the system's going to go, hey, I don't have data integrity anymore. 268 00:21:09,440 --> 00:21:10,900 I need to minerf. 269 00:21:11,880 --> 00:21:13,560 And boom, it's gone. 270 00:21:13,600 --> 00:21:23,580 So, you could presumably go through and, during your fuzzing, have given it a service ID that they didn't account for when they do their input validation. 271 00:21:23,580 --> 00:21:28,480 And all of a sudden, the code goes off into some random branch that it's not supposed to go out into. 272 00:21:28,800 --> 00:21:31,140 And it fails that integrity check in minerfs. 273 00:21:31,920 --> 00:21:37,840 In my experience, when I'm doing fuzzing, I can find, on average, three minerfs a day. 274 00:21:39,840 --> 00:21:43,480 So, that just tells you how often these minerfs occur in these devices. 275 00:21:45,860 --> 00:21:50,560 I would say that I spent many, many hours in Wireshark. 276 00:21:50,560 --> 00:21:52,600 I'm sure everybody here knows what Wireshark is. 277 00:21:52,600 --> 00:21:57,980 Wireshark has awesome, awesome capabilities at decoding CIP. 278 00:21:58,320 --> 00:22:05,380 I don't know who, but some poor soul spent a lot of time building the CIP plugin for Wireshark, and it's absolutely fantastic. 279 00:22:05,380 --> 00:22:08,020 So, definitely utilize Wireshark. 280 00:22:09,980 --> 00:22:11,340 And that's it. 281 00:22:11,340 --> 00:22:12,600 So, thank you. 282 00:22:12,600 --> 00:22:13,720 Thanks for coming. 283 00:22:13,720 --> 00:22:15,920 I'm going to leave you with a couple tools. 284 00:22:16,140 --> 00:22:25,880 So, first, if you go to the ICS Village GitHub account in our CTF repository, every script and demo I used to build this presentation is in that repository. 285 00:22:25,880 --> 00:22:27,900 You can actually get that tooling to do fuzzing. 286 00:22:27,900 --> 00:22:31,040 I have fuzzing tools in that repository to get you started. 287 00:22:31,840 --> 00:22:34,260 You can also use the Molex Ethernet IP tool. 288 00:22:34,260 --> 00:22:36,340 This is a free tool provided by Molex. 289 00:22:36,580 --> 00:22:38,940 It's for doing device validation and testing. 290 00:22:39,120 --> 00:22:41,100 Awesome tool for this kind of stuff. 291 00:22:41,500 --> 00:22:46,940 And finally, if you're a Python guy and you just want to do it all on your own, PyCom 3 is a fantastic library. 292 00:22:47,280 --> 00:22:49,600 I am not the developer, but I know the developer. 293 00:22:49,600 --> 00:22:52,500 He is awesome, very open to suggestions. 294 00:22:53,440 --> 00:22:54,980 And I say, just go to eBay. 295 00:22:55,020 --> 00:22:56,020 Find some hardware. 296 00:22:56,020 --> 00:22:57,060 That's what I do. 297 00:22:57,140 --> 00:22:59,920 This stuff on eBay isn't cheap, but it's not too expensive. 298 00:22:59,920 --> 00:23:03,020 It won't break the bank if you want to have your own little cyber range at home. 299 00:23:03,720 --> 00:23:07,200 And finally, once you find something, report it to sysevents. 300 00:23:07,640 --> 00:23:14,180 They'll help you get connected with the vendor, build those relationships for you, and that way the vendor can get it fixed. 301 00:23:15,200 --> 00:23:16,420 And that's it. 302 00:23:21,820 --> 00:23:22,820 Thank you.