1 00:00:00,000 --> 00:00:01,520 Okay, so hi everybody. 2 00:00:01,520 --> 00:00:05,760 Welcome to a talk regarding the medical word of IP buckets. 3 00:00:05,760 --> 00:00:07,880 We're going to explain the topic soon. 4 00:00:08,980 --> 00:00:12,860 This is Tal and myself, Sharon. 5 00:00:12,860 --> 00:00:15,820 We work for Clarity for the past few years. 6 00:00:15,820 --> 00:00:19,840 We mainly do reverse engineering in the OT domain. 7 00:00:19,840 --> 00:00:23,740 So we break up PLCs, HMIs, engineering stations, etc. 8 00:00:23,880 --> 00:00:26,880 And we research OT protocols. 9 00:00:27,680 --> 00:00:36,240 And today we're going to talk about the research that we have conducted regarding some ICS vendors. 10 00:00:36,860 --> 00:00:39,780 But before that, we want to show you our cool lab. 11 00:00:39,780 --> 00:00:41,100 This is our setup. 12 00:00:41,100 --> 00:00:47,140 We have different vendors, different PLCs from all over the world. 13 00:00:47,240 --> 00:00:50,580 Rockwell, Schneider, Siemens, you name it. 14 00:00:50,580 --> 00:00:52,440 We have everything from everything. 15 00:00:52,740 --> 00:00:58,440 And this is where the research mainly was conducted. 16 00:00:59,060 --> 00:01:04,600 So today we're going to talk about what are change IP packets. 17 00:01:04,600 --> 00:01:11,560 We're going to explain why they're being used and who uses them. 18 00:01:11,560 --> 00:01:19,560 We're going to show some protocol examples of how different vendors implemented the change IP packets. 19 00:01:19,560 --> 00:01:30,440 We're going to discuss the security implications and security aspects of what it means that you have change IP packets in your network. 20 00:01:30,560 --> 00:01:40,560 And finally, we're going to sum everything up and we're going to release some of our custom SNOT rules that we have developed according to our research. 21 00:01:41,320 --> 00:01:45,040 So, change IP packet. 22 00:01:45,040 --> 00:01:52,280 Think of the situation that you're buying a new device and you want to plug it into a network. 23 00:01:52,280 --> 00:02:01,840 The device has no network settings, but still you plug it into a network and somehow you're able to communicate with it. 24 00:02:01,860 --> 00:02:04,140 So, how it is done? 25 00:02:04,300 --> 00:02:25,420 When you plug in your device inside your network, you send a change IP packet, a magical change IP packet to the device, and suddenly the device gets a new IP address and you're able to communicate via layer three, which is the IP layer. 26 00:02:26,280 --> 00:02:30,480 Yes, it's true that you need to know some basic element about the device. 27 00:02:30,480 --> 00:02:36,480 For example, in modern Ethernet networks, you need to know at least the MAC address of the device. 28 00:02:36,480 --> 00:02:46,880 But since MAC address is relatively easy element to achieve in a network, if you're sniffing the network, you can see ARP responses or goticious ARPs. 29 00:02:46,880 --> 00:02:52,820 So, it's relatively easy to get the MAC address, so we assume it's a no problem. 30 00:02:55,300 --> 00:03:05,180 Before diving deeply into the magic change IP packets, we want to give you some examples from the IT world regarding what a change IP packet is. 31 00:03:06,000 --> 00:03:11,430 So, let's talk about what are magic packets. 32 00:03:12,000 --> 00:03:14,980 Think of the IT domain. 33 00:03:15,600 --> 00:03:27,880 Back then, it's the late 90s where computers was in the rise and the power consumption of the entire computer industry was in the rise as well. 34 00:03:28,300 --> 00:03:42,300 Many vendors and governments wanted to reduce the power consumption, so they recommended people to shut down the network devices or computers when they're not being used. 35 00:03:42,300 --> 00:03:53,480 That was fine until the IT administrators wanted to conduct some maintenance processes, but the computers were turned off. 36 00:03:53,480 --> 00:03:58,480 So, they could not back up the computers, they could not perform any updates. 37 00:03:59,170 --> 00:04:01,000 They got really mad. 38 00:04:01,000 --> 00:04:05,320 So, that's why AMD and HP came with a solution. 39 00:04:05,320 --> 00:04:14,760 The computer, when it's not being used, will be turned off, but only the network card will be always connected. 40 00:04:14,760 --> 00:04:21,530 So, the network card will always get electricity power and will constantly sniff the network. 41 00:04:22,330 --> 00:04:34,750 Once it detects a magical sequence of bytes, in our case, the Wacom LAN packets are six times Fs and then 16 times the MAC address of the network card. 42 00:04:34,750 --> 00:04:44,710 Only then, magically, it will turn on the computer and now the IT admins can perform their maintenance processes. 43 00:04:44,710 --> 00:04:50,950 So, the computer was turned off, only the network card is connected to the electricity power. 44 00:04:50,950 --> 00:04:56,550 It detects a magical sequence of bytes and then it turns on the computer. 45 00:04:56,970 --> 00:05:00,430 That's, in general, the concept of magic packets. 46 00:05:00,870 --> 00:05:08,890 Another example we can find in the malicious world, for example, the chaos or the C door back door. 47 00:05:08,890 --> 00:05:28,530 Those back doors are constantly sniffing the network and once they detect a magic sequence, it can be a magic sequence of bytes or it can be a magic sequence of attributes, for example, port knocking, and once they detect those magical sequences, they will do something and in the malicious world, 48 00:05:28,530 --> 00:05:32,490 they're probably going to send a reverse shell back to the attacker. 49 00:05:32,610 --> 00:05:35,530 So, that's the concept of magic packets. 50 00:05:35,950 --> 00:05:37,890 Now, let's talk about... 51 00:05:40,190 --> 00:05:42,370 this is how the packet looks. 52 00:05:42,370 --> 00:05:46,810 You see the six times Fs and then 16 times the make address. 53 00:05:46,850 --> 00:06:01,890 And now that we've covered some classical IT examples of what a magic packet is, I want to discuss what are change IP packets and why do we use them and what's so magical about them. 54 00:06:01,890 --> 00:06:06,630 So, first of all, we're human beings, right? 55 00:06:06,630 --> 00:06:10,430 We like things to be relatively easy, simple for us. 56 00:06:10,430 --> 00:06:11,770 We don't want to get up. 57 00:06:11,770 --> 00:06:16,850 We want to buy a new device, plug it in into our network and then plug and play. 58 00:06:16,850 --> 00:06:19,450 We can easily communicate with it. 59 00:06:19,550 --> 00:06:27,630 So, that's why the change IP packets were invented, because we're lazy, because we're human beings. 60 00:06:27,630 --> 00:06:31,310 We don't want to configure back-to-back physically the devices. 61 00:06:31,310 --> 00:06:39,630 We just want to take the device, plug it in somewhere in the network and then immediately start to communicate with it. 62 00:06:40,050 --> 00:06:50,850 Change IP packets allow us to do that, because if you're connecting your device in the network, you can send the magic change IP packet to the device. 63 00:06:50,850 --> 00:07:00,050 The device will get the IP address and you could communicate with it further remotely. 64 00:07:00,650 --> 00:07:03,690 But what's so magical about it? 65 00:07:03,990 --> 00:07:09,210 So, first of all, you're gaining a new access via layer three. 66 00:07:09,210 --> 00:07:13,430 So, you're gaining new access to device which you did not have before. 67 00:07:15,350 --> 00:07:23,930 Secondly, those devices are acting in some way like a backdoor, because they're constantly sniffing the network. 68 00:07:23,930 --> 00:07:34,810 They're searching for magic sequences of bytes or magic sequences of attributes, and suddenly they are doing something that you told them to do. 69 00:07:35,330 --> 00:07:44,070 And third, most of the protocols that we'll see soon are not being used constantly. 70 00:07:44,070 --> 00:07:49,130 They're not common, because they're being used only when you need to configure the device. 71 00:07:49,130 --> 00:07:57,950 So, we treat them as very esoteric protocols that we rarely see in our networks. 72 00:07:59,230 --> 00:08:03,870 Okay, what are the types of change IP protocols? 73 00:08:03,870 --> 00:08:07,490 First of all, we have the standardized protocol. 74 00:08:07,770 --> 00:08:13,090 Standardized protocols are protocols which have many different commands. 75 00:08:13,090 --> 00:08:23,470 For example, to start the PLC, stop the PLC, maybe restore the PLC, read or write addresses, all the regular and basic functionality that you know. 76 00:08:23,670 --> 00:08:31,890 But one of those commands is the change IP, or the change network configuration. 77 00:08:32,290 --> 00:08:34,050 And we'll see an example. 78 00:08:34,630 --> 00:08:36,750 First of all, we have PROFINET. 79 00:08:36,890 --> 00:08:45,130 PROFINET is a standardized layer two protocol which is mainly used in seamless environments and is being used to configure PLCs. 80 00:08:45,130 --> 00:08:58,710 For example, the SIMATIC-S7300, which can be found in many nuclear facilities, is configured and maintained by PROFINET. 81 00:08:58,710 --> 00:09:10,310 You probably have heard about SIMATIC-S7300 because that's the famous PLC that Stuxnet attacked a few years ago. 82 00:09:10,310 --> 00:09:12,990 As you can see, PROFINET is a layer two. 83 00:09:12,990 --> 00:09:14,850 It's a very standardized protocol. 84 00:09:14,850 --> 00:09:19,850 It consists of many different commands, but one of them is the change configuration. 85 00:09:20,490 --> 00:09:26,670 As you can see in the picture, we've used this functionality in order to change the IP of our device. 86 00:09:28,370 --> 00:09:32,630 Another example is the GESDI protocol by General Electric. 87 00:09:32,630 --> 00:09:38,730 This protocol is used heavily in the renewable energy industry, such as turbines. 88 00:09:38,910 --> 00:09:45,510 And it is being used to control the Mark 6 family of General Electric. 89 00:09:46,030 --> 00:09:53,630 What's unique about Mark 6 PLCs is that they all run on QNX. 90 00:09:53,630 --> 00:09:58,490 QNX is a UNIX-embedded operation system. 91 00:09:58,490 --> 00:10:05,830 And because of that, it consists of many very commonly used UNIX commands. 92 00:10:05,830 --> 00:10:08,610 For example, the ifconfig. 93 00:10:09,250 --> 00:10:22,430 Another thing that you should know about the Mark 6 family is that they have a very unique command, which is CMD-C, which allows us to run any command that we want. 94 00:10:22,430 --> 00:10:25,370 And it will run on a shell on the device. 95 00:10:25,390 --> 00:10:34,430 So we combined the two, and we created a change IP packet using the C-type command. 96 00:10:34,430 --> 00:10:40,930 And we were able to run a shell command on the device, and we changed the IP of the device. 97 00:10:42,290 --> 00:10:52,250 Another type that we would like to discuss today are protocols that their entire purpose is just for setting and exchanging the network configuration. 98 00:10:52,250 --> 00:10:58,230 For example, we have RCDP, which is RuggedCom Discovery Protocol. 99 00:10:58,990 --> 00:11:08,110 That's a protocol that was properly invented by RuggedCom to maintain and configure RuggedCom devices. 100 00:11:08,110 --> 00:11:15,730 So we're able to maintain and configure RuggedCom switches and routers only via this protocol. 101 00:11:16,370 --> 00:11:34,470 What's unique about this protocol is that it has authentication mechanism, which requires the users to create a unique hash, which consists of the username and password of the device, among other stuff. 102 00:11:34,470 --> 00:11:42,450 And only with this hash, we can change and configure the RuggedCom devices. 103 00:11:42,510 --> 00:11:47,390 So we have been researching this protocol for a long time. 104 00:11:47,830 --> 00:11:53,170 And eventually, we were able to break up all the different fields of the protocol, as you can see. 105 00:11:53,490 --> 00:11:56,710 And in yellow, you can see the authentication hash. 106 00:11:56,730 --> 00:12:01,710 And in red, you can see the IP that we changed the device to. 107 00:12:03,830 --> 00:12:18,990 Another type of protocols, which are protocols which have magic sequences, just like we have seen before with the WakeOnLAN packets, those protocols use a very unique sequence of bytes. 108 00:12:18,990 --> 00:12:26,730 And only when they get those sequence of bytes, only then they will do what they were being told. 109 00:12:28,850 --> 00:12:33,070 A very similar group is the magic attributes. 110 00:12:34,330 --> 00:12:38,110 Some devices are not even implementing a protocol at all. 111 00:12:38,110 --> 00:12:41,790 They're using the attributes of a different layer of the packet. 112 00:12:41,790 --> 00:12:48,170 And when they detect a certain unique attribute, it will trigger the change IP functionality. 113 00:12:48,170 --> 00:13:02,910 For example, the GE General Electric PAC systems is a family of controllers, just like RX3i or RX7i, that have a very unique functionality. 114 00:13:02,930 --> 00:13:09,510 The CPU or the network card will consistently sniff the network, just like a backdoor. 115 00:13:09,510 --> 00:13:28,930 And when it detects a special and unique TCP packet, as you can see here, with a very unique attribute of source port 1 to desk port 1, as you can see in the picture, only then it will understand, just like a backdoor, that we're trying to communicate with it. 116 00:13:28,930 --> 00:13:36,390 And then the device will take the packet, will extract the destination IP address, and it will set it for itself. 117 00:13:37,350 --> 00:13:42,290 This kind of behavior is very similar to what backdoors are doing. 118 00:13:42,450 --> 00:13:55,830 Another thing important to notice here is that those devices, those PLCs, will not take the destination IP if the device is not in stop mode. 119 00:13:55,830 --> 00:14:02,150 So if the PLC is in a production mode, the device will not change the IP. 120 00:14:02,150 --> 00:14:04,490 Obviously, this is a security mechanism. 121 00:14:04,490 --> 00:14:10,810 The General Electric did in order to avoid harming the production. 122 00:14:11,590 --> 00:14:15,670 Another cool type of protocols are encapsulated particles. 123 00:14:15,670 --> 00:14:20,650 For example, BNR didn't want to implement their own protocol. 124 00:14:20,650 --> 00:14:27,590 Instead, they are using SNMP, which is a very commonly used protocol, simple network management protocol. 125 00:14:28,450 --> 00:14:35,010 But they're using the SNMP over Ethernet, which is a very uncommonly SNMP flavor. 126 00:14:35,710 --> 00:14:43,130 SNMP has two main functionalities of get and set attributes. 127 00:14:44,250 --> 00:14:49,290 BNR chose to implement SNMP with value-specific OIDs. 128 00:14:49,290 --> 00:14:51,290 For example, you can see here the OID. 129 00:14:52,050 --> 00:14:56,690 And if you're getting this OID, you will receive the IP address. 130 00:14:56,690 --> 00:15:01,250 And if you're setting via SNMP this OID, you will set the IP address. 131 00:15:01,250 --> 00:15:06,550 So for example, we have constructed a packet over SNMP. 132 00:15:07,190 --> 00:15:14,750 And you can see that when we set the specific OID that I mentioned before, we were able to change the IP of the device. 133 00:15:15,350 --> 00:15:23,310 Now, all those use cases are normal, which means OT admins and IT admins are using them daily. 134 00:15:23,430 --> 00:15:26,450 But what happens when the talkers are using them? 135 00:15:26,450 --> 00:15:29,970 What happens when we're going evil to the dark side? 136 00:15:31,290 --> 00:15:42,650 The basic concept here is that if I, as the IT owner, IT admin, can say the magic word and change the IP of the device, attackers can do the same. 137 00:15:42,650 --> 00:15:45,110 Attackers can say the magic word as well. 138 00:15:45,530 --> 00:15:48,630 So what can they do with it? 139 00:15:48,630 --> 00:15:58,350 First of all, if they're changing the IP addresses of my PLCs in production, obviously they can cause denial of service and do some bad stuff. 140 00:16:00,530 --> 00:16:05,270 Secondly, attackers can achieve active and passive man-in-the-middle. 141 00:16:05,590 --> 00:16:14,890 But before we're diving in into what are passive and active man-in-the-middle, let's see how such an attack can occur. 142 00:16:15,350 --> 00:16:23,350 So first of all, we have a basic setup of HMI communicating and querying a PLC. 143 00:16:23,350 --> 00:16:31,870 The PLC is controlling a motor, and the motor is running at a speed of 212 RPM. 144 00:16:34,490 --> 00:16:39,630 Normally, the HMI will query the PLC and ask for the motor speed. 145 00:16:40,470 --> 00:16:47,350 The PLC will respond with 212 RPM, which is the normal speed, and everything is good. 146 00:16:48,050 --> 00:17:00,330 But then the attacker infiltrates my network and sends the change IP magic packet to my PLC and asks to change the IP to .66. 147 00:17:01,570 --> 00:17:13,910 The PLC changes the IP, and then the attacker changes its own IP to .10, what the PLC had previously, and informs the HMI that it is now .10. 148 00:17:13,910 --> 00:17:22,330 The HMI now thinks that the attacker is the PLC and starts querying the attacker as if it were the PLC. 149 00:17:22,330 --> 00:17:32,110 And the attacker, who wants to stay on stealth mode, sends back to the HMI that he is running at the speed of 212. 150 00:17:32,110 --> 00:17:39,790 But in the background, it sends the PLC a change motor speed to 2,000, from 200 to 2,000. 151 00:17:39,790 --> 00:17:43,330 And then, obviously, bad stuff can happen. 152 00:17:43,430 --> 00:17:46,490 You should know that this scenario is not so imaginary. 153 00:17:46,490 --> 00:17:58,510 A very similar attack was performed by Stuxnet in 2010, which conducted a man-in-the-middle attack and changed the running speed of centrifuges in a uranium nuclear plant. 154 00:17:58,590 --> 00:18:06,590 This is a very likely-to-happen scenario if your network is not secured, and that's why we need a lot of security. 155 00:18:09,860 --> 00:18:18,480 So yeah, we see why we should have concerns about the change IP functionality, but what is the awareness to this issue? 156 00:18:18,480 --> 00:18:21,180 What are the vendors doing about it? 157 00:18:23,020 --> 00:18:25,040 So let's see an example. 158 00:18:25,040 --> 00:18:31,580 Seven years ago, the CV was published regarding the change IP functionality in the C protocol. 159 00:18:31,880 --> 00:18:38,380 The C protocol is a common industrial protocol which is heavily used in the Rockwell ecosystem. 160 00:18:38,680 --> 00:18:47,180 It is a very complex protocol that can be used for a lot of stuff, from data acquisition and configuring the PLC. 161 00:18:48,900 --> 00:18:54,520 So one of the features, it changed the IP of the device. 162 00:18:56,640 --> 00:19:11,080 According to the CV, changing the IP of the device can cause a denial of service, can cause a denial of service and disrupt our process in our facility and break a lot of things. 163 00:19:11,900 --> 00:19:23,220 But the question whether it is a vulnerability or just a feature, it is hard to answer this question because at the end of the day, it is just a feature of the protocol. 164 00:19:24,100 --> 00:19:34,540 Since then, Rockwell added some protection to the protocol, added some authentication to it, and made it much harder to change the IP of the device, but it is still possible today. 165 00:19:34,540 --> 00:19:38,680 Because if the OT admin can do that, an attacker can do it too. 166 00:19:41,240 --> 00:19:45,380 Here is a bad packet with the IP that we set. 167 00:19:46,880 --> 00:19:53,380 Another solution that we already mentioned earlier is requiring that the PLC will be in stop mode. 168 00:19:54,680 --> 00:20:01,240 So an attacker won't be able to disrupt our production environment with that packet. 169 00:20:01,240 --> 00:20:02,880 It just won't work. 170 00:20:03,800 --> 00:20:13,220 Another good solution is requiring authentication in order to make configuration changes to our PLC, which make a lot of sense. 171 00:20:14,160 --> 00:20:17,340 But not everyone is doing that. 172 00:20:17,800 --> 00:20:21,720 Most of the cases, you can just tell it to change its IP. 173 00:20:23,340 --> 00:20:30,780 So let's take a moment to look at a protocol that tried to implement some protections. 174 00:20:30,780 --> 00:20:38,440 The Schneider NetManage protocol, which is used by the Schneider Modicon to change its network configuration. 175 00:20:40,020 --> 00:20:45,420 So we looked on that protocol, and at first it looked encrypted. 176 00:20:45,800 --> 00:20:53,340 But after looking at it for a while , we saw that it just exorbed with a simple static hard-coded key. 177 00:20:53,340 --> 00:20:57,340 We were able to extract this key and look on the protocol itself. 178 00:20:57,520 --> 00:21:16,460 We saw some credentials in the request, but when we crafted our own packet and sent them to the PLC, we noticed that those connections are not being validated at all, which means you can send whatever you want and it will accept it and change the IP of the device. 179 00:21:17,280 --> 00:21:26,520 So we contacted the vendor and they told us that they recommend to disable the service after using it for the initial setup. 180 00:21:26,760 --> 00:21:35,020 They are aware of the problem with this functionality and this is why it is mentioned in the documentation, to disable this feature. 181 00:21:35,260 --> 00:21:43,280 So yeah, that is another solution, giving the user the responsibility to protect himself and disable this feature. 182 00:21:43,280 --> 00:21:46,340 But the question is, can we always do it? 183 00:21:46,340 --> 00:21:48,040 Sadly, the answer is no. 184 00:21:48,040 --> 00:21:52,740 In most of the cases, change IP functionality is part of the protocol. 185 00:21:52,740 --> 00:21:55,420 We cannot just disable and enable it. 186 00:21:55,860 --> 00:21:59,560 Not all the vendors are giving us this option. 187 00:21:59,860 --> 00:22:01,780 So what can we do? 188 00:22:03,280 --> 00:22:08,040 So here are some tips for making your network more secure. 189 00:22:08,600 --> 00:22:11,180 First of all, configure a secure password. 190 00:22:11,180 --> 00:22:18,380 In some protocols, as I mentioned, changing device configuration is locked behind authentication. 191 00:22:18,680 --> 00:22:27,620 But if we don't set up a password or don't change the default one or set a simple password like 123456, we are not protected. 192 00:22:27,920 --> 00:22:31,860 So don't forget to set a secure password to your devices. 193 00:22:34,000 --> 00:22:41,100 Another option in some PLCs, there is a physical switch in the PLC itself that can be changed between active mode and configure mode. 194 00:22:41,100 --> 00:22:48,160 And in some of those, the PLC can't be configured if the key is in the configuration state. 195 00:22:48,600 --> 00:22:52,700 So don't forget the key in that state. 196 00:22:59,840 --> 00:23:15,580 Another thing that is important to do is separate your network, separate the users from the PLCs, and make sure that a user that is not supposed to talk to a PLC won't do it with strict firewall rules. 197 00:23:16,600 --> 00:23:21,980 Because it will make your network much more secure. 198 00:23:23,520 --> 00:23:26,060 Another thing is monitor your network. 199 00:23:26,060 --> 00:23:28,200 Don't let an attacker stay undetected. 200 00:23:28,200 --> 00:23:35,380 There are some powerful IDS and IPA tools out there that can monitor and secure your network. 201 00:23:36,560 --> 00:23:44,480 Preferably use a solution that knows how to do deep inspection to auto protocols and detects the attacks that we talked about. 202 00:23:44,480 --> 00:23:46,580 Because not all the tools can do that. 203 00:23:48,580 --> 00:24:01,460 So yes, as Ron mentioned earlier, after our research we wrote some SNOT rules that will detect some of those potential attacks that we mentioned and detect some of those strange IP packets. 204 00:24:02,860 --> 00:24:06,580 You will be able to see it later in our presentation. 205 00:24:08,480 --> 00:24:18,940 We are giving a powerful tool by the vendors to set the IP of our PLC remotely. 206 00:24:19,700 --> 00:24:27,800 But this gives us some responsibility to protect our network, because if we can use it, an attacker can use it too. 207 00:24:32,630 --> 00:24:38,510 So yeah, we've seen today a couple of different protocols that we've been researching. 208 00:24:38,910 --> 00:24:45,750 So those protocols allow us to change the IP of the devices in various ways. 209 00:24:45,750 --> 00:24:54,690 Most of those protocols behave just like backdoors, because they have some sequence-unique bytes or sequence-unique attributes. 210 00:24:54,690 --> 00:25:03,270 And the devices are constantly sniffing them for detecting changes and understanding that someone is trying to communicate with them. 211 00:25:03,630 --> 00:25:08,570 Then we discussed some of the security aspects of what it means in our network. 212 00:25:08,570 --> 00:25:15,090 And finally, we gave some security tips of how to be secured. 213 00:25:15,090 --> 00:25:20,810 And we're going to also release some of our custom rules that we've developed according to our research. 214 00:25:21,450 --> 00:25:22,290 And that's it. 215 00:25:22,290 --> 00:25:30,650 That's a table that summarizes all the different protocols that we have been researching, and the security, and layers. 216 00:25:30,650 --> 00:25:31,930 Thank you.