[00:00.000 --> 00:05.760] Okay, so hi everybody. Welcome to a talk regarding the medical word of IP buckets. [00:05.760 --> 00:14.420] We're going to explain the topic soon. This is Tal and myself, Sharon. We work for Clarity for [00:14.420 --> 00:21.920] the past few years. We mainly do reverse engineering in the OT domain. So we break up PLCs, [00:21.920 --> 00:29.880] HMIs, engineering stations, etc. And we research OT protocols. And today we're going to talk about [00:29.880 --> 00:38.240] the research that we have conducted regarding some ICS vendors. But before that, we want to [00:38.240 --> 00:45.960] show you our cool lab. This is our setup. We have different vendors, different PLCs from all over [00:45.960 --> 00:53.400] the world. Rockwell, Schneider, Siemens, you name it. We have everything from everything. And this [00:53.400 --> 01:03.400] is where the research mainly was conducted. So today we're going to talk about what are change [01:03.400 --> 01:12.480] IP packets. We're going to explain why they're being used and who uses them. We're going to show [01:12.480 --> 01:20.100] some protocol examples of how different vendors implemented the change IP packets. We're going to [01:20.100 --> 01:28.600] discuss the security implications and security aspects of what it means that you have change IP [01:28.600 --> 01:34.740] packets in your network. And finally, we're going to sum everything up and we're going to release [01:34.740 --> 01:44.400] some of our custom SNOT rules that we have developed according to our research. So, change IP [01:44.400 --> 01:52.280] packet. Think of the situation that you're buying a new device and you want to plug it into a network. [01:52.280 --> 02:00.220] The device has no network settings, but still you plug it into a network and somehow you're able to [02:00.220 --> 02:10.440] communicate with it. So, how it is done? When you plug in your device inside your network, you send [02:12.040 --> 02:19.740] a change IP packet, a magical change IP packet to the device, and suddenly the device gets a new IP [02:19.740 --> 02:27.540] address and you're able to communicate via layer three, which is the IP layer. Yes, it's true that you [02:27.540 --> 02:33.380] need to know some basic element about the device. For example, in modern Ethernet networks, you need [02:33.380 --> 02:40.220] to know at least the MAC address of the device. But since MAC address is relatively easy element [02:40.220 --> 02:45.780] to achieve in a network, if you're sniffing the network, you can see ARP responses or goticious [02:45.780 --> 02:52.820] ARPs. So, it's relatively easy to get the MAC address, so we assume it's a no problem. [02:55.300 --> 03:01.340] Before diving deeply into the magic change IP packets, we want to give you some examples from [03:01.340 --> 03:11.430] the IT world regarding what a change IP packet is. So, let's talk about what are magic packets. [03:12.000 --> 03:22.600] Think of the IT domain. Back then, it's the late 90s where computers was in the rise and the power [03:22.600 --> 03:30.180] consumption of the entire computer industry was in the rise as well. Many vendors and governments [03:30.180 --> 03:36.860] wanted to reduce the power consumption, so they recommended people to shut down the [03:37.700 --> 03:45.380] network devices or computers when they're not being used. That was fine until the [03:45.380 --> 03:52.300] IT administrators wanted to conduct some maintenance processes, but the computers [03:52.300 --> 03:58.480] were turned off. So, they could not back up the computers, they could not perform any updates. [03:59.170 --> 04:07.500] They got really mad. So, that's why AMD and HP came with a solution. The computer, when it's not [04:07.500 --> 04:15.080] being used, will be turned off, but only the network card will be always connected. So, the [04:15.080 --> 04:21.530] network card will always get electricity power and will constantly sniff the network. [04:22.330 --> 04:30.630] Once it detects a magical sequence of bytes, in our case, the Wacom LAN packets are six times Fs [04:30.630 --> 04:36.930] and then 16 times the MAC address of the network card. Only then, magically, it will turn on the [04:36.930 --> 04:46.470] computer and now the IT admins can perform their maintenance processes. So, the computer was turned [04:46.470 --> 04:53.090] off, only the network card is connected to the electricity power. It detects a magical sequence [04:53.090 --> 05:00.430] of bytes and then it turns on the computer. That's, in general, the concept of magic packets. [05:00.870 --> 05:08.350] Another example we can find in the malicious world, for example, the chaos or the C door back [05:08.350 --> 05:14.690] door. Those back doors are constantly sniffing the network and once they detect a magic sequence, [05:14.690 --> 05:20.270] it can be a magic sequence of bytes or it can be a magic sequence of attributes, for example, [05:20.270 --> 05:27.470] port knocking, and once they detect those magical sequences, they will do something and in the [05:27.470 --> 05:32.490] malicious world, they're probably going to send a reverse shell back to the attacker. [05:32.610 --> 05:37.890] So, that's the concept of magic packets. Now, let's talk about... [05:40.190 --> 05:46.810] this is how the packet looks. You see the six times Fs and then 16 times the make address. [05:46.850 --> 05:53.530] And now that we've covered some classical IT examples of what a magic packet is, [05:53.530 --> 06:01.890] I want to discuss what are change IP packets and why do we use them and what's so magical about them. [06:01.890 --> 06:10.430] So, first of all, we're human beings, right? We like things to be relatively easy, simple for us. [06:10.430 --> 06:15.930] We don't want to get up. We want to buy a new device, plug it in into our network and then [06:15.930 --> 06:24.590] plug and play. We can easily communicate with it. So, that's why the change IP packets were [06:24.590 --> 06:29.750] invented, because we're lazy, because we're human beings. We don't want to configure back-to-back [06:29.750 --> 06:35.510] physically the devices. We just want to take the device, plug it in somewhere in the network and [06:35.510 --> 06:42.770] then immediately start to communicate with it. Change IP packets allow us to do that, because [06:42.770 --> 06:48.990] if you're connecting your device in the network, you can send the magic change IP packet [06:49.750 --> 06:56.970] to the device. The device will get the IP address and you could communicate with it further [06:58.850 --> 07:06.910] remotely. But what's so magical about it? So, first of all, you're gaining a new access [07:07.750 --> 07:13.430] via layer three. So, you're gaining new access to device which you did not have before. [07:15.350 --> 07:22.770] Secondly, those devices are acting in some way like a backdoor, because they're constantly [07:22.770 --> 07:28.390] sniffing the network. They're searching for magic sequences of bytes or magic sequences [07:28.390 --> 07:36.450] of attributes, and suddenly they are doing something that you told them to do. And third, [07:36.450 --> 07:45.130] most of the protocols that we'll see soon are not being used constantly. They're not common, [07:45.130 --> 07:49.130] because they're being used only when you need to configure the device. [07:49.130 --> 07:57.950] So, we treat them as very esoteric protocols that we rarely see in our networks. [07:59.230 --> 08:07.490] Okay, what are the types of change IP protocols? First of all, we have the standardized protocol. [08:07.770 --> 08:13.870] Standardized protocols are protocols which have many different commands. For example, [08:13.870 --> 08:21.170] to start the PLC, stop the PLC, maybe restore the PLC, read or write addresses, all the regular [08:21.170 --> 08:29.690] and basic functionality that you know. But one of those commands is the change IP, or the change [08:29.690 --> 08:36.750] network configuration. And we'll see an example. First of all, we have PROFINET. [08:36.890 --> 08:41.830] PROFINET is a standardized layer two protocol which is mainly used in seamless environments [08:41.830 --> 08:51.170] and is being used to configure PLCs. For example, the SIMATIC-S7300, which can be found in many [08:51.170 --> 09:01.350] nuclear facilities, is configured and maintained by PROFINET. You probably have heard about [09:01.350 --> 09:10.310] SIMATIC-S7300 because that's the famous PLC that Stuxnet attacked a few years ago. [09:10.310 --> 09:14.850] As you can see, PROFINET is a layer two. It's a very standardized protocol. [09:14.850 --> 09:19.850] It consists of many different commands, but one of them is the change configuration. [09:20.490 --> 09:25.630] As you can see in the picture, we've used this functionality in order to change the IP of our [09:25.630 --> 09:34.570] device. Another example is the GESDI protocol by General Electric. This protocol is used heavily [09:34.570 --> 09:41.550] in the renewable energy industry, such as turbines. And it is being used to control [09:41.550 --> 09:51.830] the Mark 6 family of General Electric. What's unique about Mark 6 PLCs is that they all run [09:51.830 --> 10:00.970] on QNX. QNX is a UNIX-embedded operation system. And because of that, it consists of many [10:01.800 --> 10:08.610] very commonly used UNIX commands. For example, the ifconfig. [10:09.250 --> 10:16.930] Another thing that you should know about the Mark 6 family is that they have a very unique [10:16.930 --> 10:23.210] command, which is CMD-C, which allows us to run any command that we want. And it will run [10:23.210 --> 10:32.270] on a shell on the device. So we combined the two, and we created a change IP packet using the [10:32.270 --> 10:38.250] C-type command. And we were able to run a shell command on the device, [10:38.250 --> 10:45.250] and we changed the IP of the device. Another type that we would like to discuss today [10:45.250 --> 10:51.030] are protocols that their entire purpose is just for setting and exchanging the network [10:51.030 --> 10:58.230] configuration. For example, we have RCDP, which is RuggedCom Discovery Protocol. [10:58.990 --> 11:06.850] That's a protocol that was properly invented by RuggedCom to maintain and configure RuggedCom [11:06.850 --> 11:14.710] devices. So we're able to maintain and configure RuggedCom switches and routers only via this [11:14.710 --> 11:23.810] protocol. What's unique about this protocol is that it has authentication mechanism, [11:24.700 --> 11:32.130] which requires the users to create a unique hash, which consists of the username and password of [11:32.130 --> 11:41.430] the device, among other stuff. And only with this hash, we can change and configure the RuggedCom [11:41.430 --> 11:48.770] devices. So we have been researching this protocol for a long time. And eventually, [11:48.770 --> 11:53.170] we were able to break up all the different fields of the protocol, as you can see. [11:53.490 --> 11:59.830] And in yellow, you can see the authentication hash. And in red, you can see the IP that we [11:59.830 --> 12:09.370] changed the device to. Another type of protocols, which are protocols which have magic sequences, [12:09.370 --> 12:13.930] just like we have seen before with the WakeOnLAN packets, those protocols [12:15.150 --> 12:22.270] use a very unique sequence of bytes. And only when they get those sequence of bytes, [12:22.270 --> 12:26.730] only then they will do what they were being told. [12:28.850 --> 12:33.070] A very similar group is the magic attributes. [12:34.330 --> 12:38.110] Some devices are not even implementing a protocol at all. [12:38.110 --> 12:42.870] They're using the attributes of a different layer of the packet. And when they detect [12:43.490 --> 12:49.530] a certain unique attribute, it will trigger the change IP functionality. For example, [12:49.530 --> 13:00.450] the GE General Electric PAC systems is a family of controllers, just like RX3i or RX7i, [13:00.450 --> 13:06.490] that have a very unique functionality. The CPU or the network card will consistently [13:06.490 --> 13:14.090] sniff the network, just like a backdoor. And when it detects a special and unique TCP packet, [13:14.090 --> 13:22.390] as you can see here, with a very unique attribute of source port 1 to desk port 1, [13:22.390 --> 13:26.690] as you can see in the picture, only then it will understand, just like a backdoor, [13:26.690 --> 13:32.010] that we're trying to communicate with it. And then the device will take the packet, [13:32.010 --> 13:36.390] will extract the destination IP address, and it will set it for itself. [13:37.350 --> 13:43.570] This kind of behavior is very similar to what backdoors are doing. Another thing [13:43.570 --> 13:52.410] important to notice here is that those devices, those PLCs, will not take the destination IP [13:52.970 --> 13:59.450] if the device is not in stop mode. So if the PLC is in a production mode, [13:59.450 --> 14:05.410] the device will not change the IP. Obviously, this is a security mechanism. The General Electric [14:06.130 --> 14:14.470] did in order to avoid harming the production. Another cool type of protocols are encapsulated [14:14.470 --> 14:21.470] particles. For example, BNR didn't want to implement their own protocol. Instead, [14:21.470 --> 14:27.590] they are using SNMP, which is a very commonly used protocol, simple network management protocol. [14:28.450 --> 14:35.010] But they're using the SNMP over Ethernet, which is a very uncommonly SNMP flavor. [14:35.710 --> 14:43.130] SNMP has two main functionalities of get and set attributes. [14:44.250 --> 14:51.290] BNR chose to implement SNMP with value-specific OIDs. For example, you can see here the OID. [14:52.050 --> 14:58.530] And if you're getting this OID, you will receive the IP address. And if you're setting via SNMP [14:58.530 --> 15:04.350] this OID, you will set the IP address. So for example, we have constructed a packet [15:05.150 --> 15:12.050] over SNMP. And you can see that when we set the specific OID that I mentioned before, [15:12.050 --> 15:18.930] we were able to change the IP of the device. Now, all those use cases are normal, which means [15:19.710 --> 15:26.450] OT admins and IT admins are using them daily. But what happens when the talkers are using them? [15:26.450 --> 15:29.970] What happens when we're going evil to the dark side? [15:31.290 --> 15:39.630] The basic concept here is that if I, as the IT owner, IT admin, can say the magic word and change [15:39.630 --> 15:45.110] the IP of the device, attackers can do the same. Attackers can say the magic word as well. [15:45.530 --> 15:52.170] So what can they do with it? First of all, if they're changing the IP addresses of my PLCs [15:52.170 --> 15:58.350] in production, obviously they can cause denial of service and do some bad stuff. [16:00.530 --> 16:08.150] Secondly, attackers can achieve active and passive man-in-the-middle. But before we're [16:08.150 --> 16:13.590] diving in into what are passive and active man-in-the-middle, let's see how such an attack [16:13.590 --> 16:23.350] can occur. So first of all, we have a basic setup of HMI communicating and querying a PLC. [16:23.350 --> 16:31.870] The PLC is controlling a motor, and the motor is running at a speed of 212 RPM. [16:34.490 --> 16:39.630] Normally, the HMI will query the PLC and ask for the motor speed. [16:40.470 --> 16:47.350] The PLC will respond with 212 RPM, which is the normal speed, and everything is good. [16:48.050 --> 16:55.790] But then the attacker infiltrates my network and sends the change IP magic packet to my PLC [16:55.790 --> 17:07.530] and asks to change the IP to .66. The PLC changes the IP, and then the attacker changes its own IP [17:07.530 --> 17:15.190] to .10, what the PLC had previously, and informs the HMI that it is now .10. The HMI now thinks [17:15.190 --> 17:22.330] that the attacker is the PLC and starts querying the attacker as if it were the PLC. [17:22.330 --> 17:30.210] And the attacker, who wants to stay on stealth mode, sends back to the HMI that he is running [17:30.210 --> 17:37.870] at the speed of 212. But in the background, it sends the PLC a change motor speed to 2,000, [17:37.870 --> 17:44.370] from 200 to 2,000. And then, obviously, bad stuff can happen. You should know that this [17:44.370 --> 17:50.950] scenario is not so imaginary. A very similar attack was performed by Stuxnet in 2010, which [17:50.950 --> 17:57.390] conducted a man-in-the-middle attack and changed the running speed of centrifuges in a uranium [17:57.390 --> 18:03.390] nuclear plant. This is a very likely-to-happen scenario if your network is not secured, [18:03.390 --> 18:13.220] and that's why we need a lot of security. So yeah, we see why we should have concerns [18:13.220 --> 18:19.120] about the change IP functionality, but what is the awareness to this issue? What are the [18:19.120 --> 18:28.480] vendors doing about it? So let's see an example. Seven years ago, the CV was published regarding [18:28.480 --> 18:34.700] the change IP functionality in the C protocol. The C protocol is a common industrial protocol [18:34.700 --> 18:42.120] which is heavily used in the Rockwell ecosystem. It is a very complex protocol that can be used [18:42.120 --> 18:52.000] for a lot of stuff, from data acquisition and configuring the PLC. So one of the features, [18:52.000 --> 18:59.740] it changed the IP of the device. According to the CV, changing the IP of the device can [18:59.740 --> 19:08.460] cause a denial of service, can cause a denial of service and disrupt our process in our facility [19:09.220 --> 19:16.080] and break a lot of things. But the question whether it is a vulnerability or just a feature, [19:17.220 --> 19:22.100] it is hard to answer this question because at the end of the day, it is just a feature [19:22.100 --> 19:27.420] of the protocol. Since then, Rockwell added some protection to the protocol, added some [19:27.420 --> 19:33.560] authentication to it, and made it much harder to change the IP of the device, but it is still [19:33.560 --> 19:38.680] possible today. Because if the OT admin can do that, an attacker can do it too. [19:41.240 --> 19:45.380] Here is a bad packet with the IP that we set. [19:46.880 --> 19:52.000] Another solution that we already mentioned earlier is requiring that the PLC will be [19:52.000 --> 20:00.400] in stop mode. So an attacker won't be able to disrupt our production environment with that [20:00.400 --> 20:08.560] packet. It just won't work. Another good solution is requiring authentication in order to make [20:08.560 --> 20:17.340] configuration changes to our PLC, which make a lot of sense. But not everyone is doing that. [20:17.800 --> 20:26.480] Most of the cases, you can just tell it to change its IP. So let's take a moment to look [20:26.480 --> 20:33.300] at a protocol that tried to implement some protections. The Schneider NetManage protocol, [20:33.300 --> 20:38.440] which is used by the Schneider Modicon to change its network configuration. [20:40.020 --> 20:47.880] So we looked on that protocol, and at first it looked encrypted. But after looking at it for a [20:47.880 --> 20:54.520] while, we saw that it just exorbed with a simple static hard-coded key. We were able to extract [20:54.520 --> 21:03.300] this key and look on the protocol itself. We saw some credentials in the request, but when we [21:03.300 --> 21:08.780] crafted our own packet and sent them to the PLC, we noticed that those connections are not being [21:08.780 --> 21:15.080] validated at all, which means you can send whatever you want and it will accept it and change the IP [21:15.080 --> 21:23.720] of the device. So we contacted the vendor and they told us that they recommend to disable the service [21:23.720 --> 21:29.940] after using it for the initial setup. They are aware of the problem with this functionality and [21:29.940 --> 21:36.600] this is why it is mentioned in the documentation, to disable this feature. So yeah, that is another [21:36.600 --> 21:43.280] solution, giving the user the responsibility to protect himself and disable this feature. [21:43.280 --> 21:49.460] But the question is, can we always do it? Sadly, the answer is no. In most of the cases, [21:49.460 --> 21:55.420] change IP functionality is part of the protocol. We cannot just disable and enable it. [21:55.860 --> 22:01.780] Not all the vendors are giving us this option. So what can we do? [22:03.280 --> 22:10.240] So here are some tips for making your network more secure. First of all, configure a secure [22:10.240 --> 22:17.380] password. In some protocols, as I mentioned, changing device configuration is locked behind [22:17.380 --> 22:22.920] authentication. But if we don't set up a password or don't change the default one or set a simple [22:22.920 --> 22:30.840] password like 123456, we are not protected. So don't forget to set a secure password to your [22:30.840 --> 22:38.780] devices. Another option in some PLCs, there is a physical switch in the PLC itself that can be [22:38.780 --> 22:43.780] changed between active mode and configure mode. And in some of those, the PLC can't be configured [22:43.780 --> 22:52.700] if the key is in the configuration state. So don't forget the key in that state. [22:59.840 --> 23:08.460] Another thing that is important to do is separate your network, separate the users from the PLCs, [23:08.460 --> 23:13.680] and make sure that a user that is not supposed to talk to a PLC won't do it with [23:13.680 --> 23:21.980] strict firewall rules. Because it will make your network much more secure. [23:23.520 --> 23:28.200] Another thing is monitor your network. Don't let an attacker stay undetected. [23:28.200 --> 23:35.380] There are some powerful IDS and IPA tools out there that can monitor and secure your network. [23:36.560 --> 23:42.520] Preferably use a solution that knows how to do deep inspection to auto protocols and detects [23:42.520 --> 23:46.580] the attacks that we talked about. Because not all the tools can do that. [23:48.580 --> 23:55.320] So yes, as Ron mentioned earlier, after our research we wrote some SNOT rules that will [23:55.320 --> 23:59.920] detect some of those potential attacks that we mentioned and detect some of those strange IP [24:00.460 --> 24:06.580] packets. You will be able to see it later in our presentation. [24:08.480 --> 24:18.940] We are giving a powerful tool by the vendors to set the IP of our PLC remotely. [24:19.700 --> 24:23.820] But this gives us some responsibility to protect our network, [24:23.820 --> 24:27.800] because if we can use it, an attacker can use it too. [24:32.630 --> 24:38.510] So yeah, we've seen today a couple of different protocols that we've been researching. [24:38.910 --> 24:45.750] So those protocols allow us to change the IP of the devices in various ways. [24:45.750 --> 24:52.050] Most of those protocols behave just like backdoors, because they have some sequence-unique [24:52.050 --> 24:57.070] bytes or sequence-unique attributes. And the devices are constantly sniffing them [24:57.070 --> 25:03.270] for detecting changes and understanding that someone is trying to communicate with them. [25:03.630 --> 25:08.570] Then we discussed some of the security aspects of what it means in our network. [25:08.570 --> 25:15.090] And finally, we gave some security tips of how to be secured. [25:15.090 --> 25:18.750] And we're going to also release some of our custom rules that we've developed [25:18.750 --> 25:22.290] according to our research. And that's it. [25:22.290 --> 25:27.390] That's a table that summarizes all the different protocols that we have been researching, [25:27.390 --> 25:31.930] and the security, and layers. Thank you.