[00:00.000 --> 00:05.620] Hello. Hello, everyone. First of all, thank you for joining us today. [00:05.660 --> 00:09.260] And our topic is V2G will go through the wires. [00:09.600 --> 00:16.280] Where will we talk about the V2G and the cyber security issues that come with it. [00:18.140 --> 00:23.440] First of all, let me introduce us. I am Pavel Kuhn, cyber security researcher. [00:23.440 --> 00:29.260] And I'm currently working at Auxilium Pentest Lab with Tom. [00:30.280 --> 00:33.720] Yeah, hello from myself too. I'm Tomas Rampinis. [00:33.720 --> 00:36.200] I'm the technical director of Auxilium Pentest Labs. [00:36.940 --> 00:39.520] And yeah, like, let's start. [00:39.680 --> 00:44.040] Our main goal today is to analyze the state of cyber security in the automotive industry [00:44.680 --> 00:50.860] and get an in-depth look on the EV architecture and this undeniably emerging attack vector. [00:50.860 --> 00:56.520] We want to explore and understand the communication protocols used in EV charging today. [00:56.540 --> 00:59.980] And introduce you to our security tool, V2G Evil, [00:59.980 --> 01:03.900] that we built with Pavel during his university thesis. [01:03.900 --> 01:09.040] And finally, create a reference point for EV security research and evaluation. [01:09.040 --> 01:13.020] Something that we feel our industry is lacking, basically. [01:13.020 --> 01:17.120] Alongside other vectors in the automotive security landscape. [01:17.740 --> 01:22.380] So let's start with the introduction to vehicle cyber security. [01:22.380 --> 01:27.160] And basically, it goes without question that the automotive industry cannot be considered something new. [01:27.160 --> 01:31.740] We are basically talking about 100 plus year old mechanical engineering industries. [01:31.740 --> 01:33.340] And nothing is new about this. [01:33.340 --> 01:37.080] The constant need for connectivity and technological aspects of it [01:37.680 --> 01:44.340] push those companies to make a real, like, restructuring and start implementing technologies [01:44.900 --> 01:49.060] that didn't have the know-how or the capacity to do so before. [01:49.320 --> 01:53.100] Which is good for us, that's why we are here in the end. [01:53.100 --> 01:57.360] But really bad for the security and safety of the affected vehicles that we're testing. [01:57.360 --> 02:02.880] On the other hand, you have all these startups that started as technology companies first. [02:02.880 --> 02:08.400] Which have a way better security posture and culture. [02:08.400 --> 02:11.780] But the industry as a whole struggles for the last decade. [02:11.780 --> 02:15.700] To be honest, I cannot see a clear light in this path. [02:18.120 --> 02:21.840] Isolating the part we will focus in this talk, [02:21.840 --> 02:25.920] we have the emerging industry of electric and hybrid vehicles. [02:25.920 --> 02:31.320] Mainly developed to decentralize pollution and make better use of clean energy solutions. [02:31.320 --> 02:38.500] And additionally, you have several advantages in comparison to internal combustion engine vehicles. [02:38.500 --> 02:41.460] For example, heavy gains in speed and efficiency. [02:41.460 --> 02:44.740] While early models used basic charging, [02:44.740 --> 02:50.720] the last decade charging standards are applied and enforced in many ways. [02:50.720 --> 02:55.960] Which led to the standardization of the ports, protocols and underlying data [02:55.960 --> 03:00.940] in a wide range of applicability for different continents and standards. [03:00.940 --> 03:06.040] This is, of course, in addition to the digital communication needed during charging. [03:06.380 --> 03:11.440] Which expanded the attack surface of the vehicles as we knew from them before. [03:11.460 --> 03:15.260] And created new attack vectors that we can start playing with. [03:17.140 --> 03:22.800] What I'm saying here is that it's not something new or groundbreaking. [03:23.400 --> 03:24.300] By any means. [03:24.300 --> 03:28.160] But the state of EV charging security is a barely touched topic by researchers. [03:33.920 --> 03:38.860] And here we have a really simple representation of a modern vehicle. [03:38.860 --> 03:41.820] Which normally includes a bunch of interconnected ECUs. [03:41.820 --> 03:44.940] Responsible for different functionality in the vehicle. [03:44.940 --> 03:50.720] This can be from single headlight ECUs to huge DC-DC converters. [03:50.720 --> 03:56.120] And what we see, though, is that while this vehicle till now was reasonably isolated [03:56.760 --> 04:01.480] by the outside world, now we have a new externally accessible port. [04:01.480 --> 04:03.700] Which connects to a charging station. [04:03.700 --> 04:05.620] And this leaves a big room for error. [04:05.620 --> 04:10.660] And if not properly implemented and designed, several unexpected instances can occur. [04:10.660 --> 04:16.140] And while architecture and vehicle design of interconnected vehicles might not seem as [04:16.140 --> 04:22.460] important, there are numerous instances that they play a big part of how severe our findings [04:22.460 --> 04:23.940] are during a pen test. [04:23.940 --> 04:29.160] And how, in the end, can or cannot affect the safety of the driver, passengers, or even [04:29.160 --> 04:30.160] pedestrians. [04:30.620 --> 04:35.860] And as we keep digging deeper, let's discuss a bit about charging in terms of vehicles [04:36.380 --> 04:38.140] and the automotive industry. [04:38.140 --> 04:43.880] First of all, there are several charging methods, including conductive, wireless, and [04:43.880 --> 04:48.780] some exotic ones that we only see in some manufacturers, like battery swaps and [04:48.780 --> 04:50.540] bidirectional charging. [04:50.540 --> 04:56.580] And on top of that, there are different types, depending on the needs of the user and the [04:56.580 --> 05:00.940] capabilities of the vehicle, including AC and DC charging. [05:00.940 --> 05:05.120] Supplying different advantages and disadvantages, as we will see later. [05:05.120 --> 05:09.960] And finally, during charging, there are also different modes of charging, where basically [05:09.960 --> 05:14.800] the first three modes are focused to AC, and the fourth one in DC charging. [05:16.280 --> 05:21.180] Talking about some boring stuff here, there are a lot of different available standards, [05:21.180 --> 05:27.220] and as our main focus is the combined charging standard, or CCS. [05:27.380 --> 05:32.880] Basically for Europe, and we just have this undeniably big list of standards for different [05:32.880 --> 05:39.500] levels of this full implementation, ranging from the connector itself to the high-level [05:39.500 --> 05:43.100] communication needed between the EV and the charger. [05:43.100 --> 05:48.300] And this CCS standard is basically an effort towards a single unified for electric vehicle [05:49.300 --> 05:53.720] charging, which considering where we are today, you might disagree. [05:55.360 --> 06:01.060] And yeah, the reason I said this is because there are a number of different standards out [06:01.060 --> 06:02.340] there in the wild. [06:02.340 --> 06:09.440] Mostly divided to the different continents, but lately several manufacturers decided to [06:09.440 --> 06:15.380] move into the Tesla standard, the supercharger standard, mainly in the USA and mainly because [06:15.380 --> 06:19.060] of the heavily invested charging network in the US roads. [06:19.080 --> 06:24.540] And of course, that does not affect Europe, at least for now, but the opportunity for [06:24.660 --> 06:27.840] a unified standard, in my opinion, is kind of lost at this point. [06:28.900 --> 06:35.280] And yeah, as we look at this circle of this CCSAC type 2 connector, we can distinguish [06:35.280 --> 06:36.360] several pins. [06:36.360 --> 06:42.040] Some of them is the CP pin, which is crucial for communication between the car and the [06:42.040 --> 06:48.020] charging station, and the pin with the highest interest for us as cybersecurity researchers. [06:48.020 --> 06:53.580] It basically allows the station to check the vehicle status and ensure it's safe to charge. [06:53.580 --> 06:59.260] Then the PP pin ensures that the correct connector is used and provides information [06:59.260 --> 07:04.560] on the current carrying capacity of the cable that we're using. [07:04.720 --> 07:10.260] The AC type 2 connector supports charging at various power levels from household outlets [07:10.260 --> 07:13.720] to high power public chargers. [07:14.780 --> 07:20.700] And here we have the DC CCS type 2 connector, an extension of the AC type 2 connector designed [07:20.700 --> 07:24.100] to support direct current fast charging. [07:24.200 --> 07:29.420] And this connector, also known as combo 2, basically incorporates the same pins as the [07:29.420 --> 07:36.380] AC type 2 connector for AC charging, but adds two additional pins specifically for DC charging. [07:36.380 --> 07:41.200] And the combination of these pins in a single connector is what gives this combined charging [07:41.200 --> 07:42.200] name. [07:42.200 --> 07:47.740] And it provides the flexibility of using either AC or DC, depending on the charging station [07:47.740 --> 07:49.600] and the vehicle capabilities. [07:50.440 --> 07:55.540] Here we can basically get an understanding of how this works internally in the different [07:55.540 --> 07:58.680] implementations of DC or AC charging. [07:58.680 --> 08:03.880] And on the other hand, we have the DC charging where the power electronics for the conversion [08:03.880 --> 08:06.920] of the current exists in the EVSC side. [08:06.920 --> 08:12.300] So the charger, while when you want to use the slower solution of AC charging, the conversion [08:12.300 --> 08:16.880] is still happening inside the vehicle itself by the onboard charger. [08:16.880 --> 08:21.920] Additionally, we can get an understanding of the communication channel that exists in [08:21.920 --> 08:22.700] those scenarios. [08:22.700 --> 08:27.700] Really important, as we will see later, especially in safety critical cases where the current [08:27.700 --> 08:30.720] needs to be negotiated. [08:31.640 --> 08:37.700] From this, we clearly understand that charging is not only simple power transfer and data [08:37.700 --> 08:39.860] exchange is also happening under the hood. [08:39.860 --> 08:45.560] Many times with important information like payment details, voltage, current requirements, [08:45.560 --> 08:48.120] time of charging, and others. [08:48.120 --> 08:52.460] And to get a better understanding of how this communication is structured, I will pass it [08:52.460 --> 08:53.260] to Pavel. [08:56.640 --> 08:59.860] So let's have a look at the charging flow. [08:59.860 --> 09:02.340] It's a high-level overview. [09:02.340 --> 09:06.520] So first, the user plugs the CCS connector to his car. [09:06.720 --> 09:10.540] And then the low-level communication starts. [09:11.060 --> 09:17.600] If the EV is in the state B and the signal has the five-person duty cycle, it can change [09:17.600 --> 09:19.620] to the high-level communication. [09:19.620 --> 09:24.260] And during the high-level communication, they are exchanged to digital information about [09:24.260 --> 09:25.220] the charging. [09:27.920 --> 09:32.060] And that's how my journey and master thesis started. [09:32.060 --> 09:34.680] So it's just a meme. [09:37.020 --> 09:40.860] So let's have a look at the low-level communication at first. [09:43.400 --> 09:48.600] Low-level communication in the charging process is also called basic signaling. [09:48.600 --> 10:04.500] It offers basic control of the charging process between the EV and EVSE. [10:05.640 --> 10:12.980] The EV controls the voltage value by adding or removing the resistors in the pilot signal. [10:12.980 --> 10:19.040] And based on the measured voltage, the EVSE can recognize the EV's state. [10:19.960 --> 10:26.280] The most important is the state B and state C, as you can see in the table. [10:28.500 --> 10:35.200] Depending on the given state resulting from the measured voltage value, the EVSE generates [10:36.240 --> 10:40.200] a pulsed modulation signal with a specific duty cycle. [10:40.840 --> 10:51.060] This value of the duty cycle value is controlled by the charging station and measured in the [10:51.060 --> 10:51.700] vehicle. [10:52.400 --> 10:59.000] And the simplified outcome from the low-level communication is that the state B means that [10:59.000 --> 11:02.540] EV is connected but not charging. [11:02.540 --> 11:06.900] And the state C is EV is connected and ready for charge. [11:07.620 --> 11:11.980] As I said, 5% duty cycle affords the high-level communication. [11:14.640 --> 11:19.560] As you could see, the low-level communication is not so interesting from the cybersecurity [11:19.560 --> 11:25.140] perspective because it only involves physical signaling. [11:25.480 --> 11:31.040] However, low-level communication is important in the sense that it enforces high-level [11:31.040 --> 11:34.960] communication for the specific state and the duty cycle. [11:34.960 --> 11:38.380] So let's explore the high-level communication. [11:39.680 --> 11:42.580] First of all, why do we need a high-level communication? [11:42.580 --> 11:46.000] Why do low-level communication is not sufficient enough? [11:46.040 --> 11:52.680] In the beginning, EV charging relied on the basic signaling methods only, which are sufficient [11:52.680 --> 11:56.380] for simple on-off commands to start or stop. [11:56.740 --> 12:02.920] But after some time, with the growing number of the electric vehicles and the complexity [12:03.340 --> 12:11.200] of our energy ecosystem, this basic form of the communication is no longer sufficient. [12:11.820 --> 12:15.800] High-level communication provides the optimized charging process. [12:19.360 --> 12:24.280] As we already described before, the precondition for high-level communication is the low-level [12:24.280 --> 12:27.600] communication with specific state and the duty cycle. [12:27.680 --> 12:33.980] And the high-level communication is only applicable for charging modes 3 and 4. [12:33.980 --> 12:39.460] And the high-level communication is mandatory for the mode 4, which is the DC charging, [12:39.960 --> 12:46.960] because there is a need to exchange some additional information to avoid the damage to the battery. [12:50.010 --> 12:58.090] The ISO 15118 defined all the high-level communication and the full name is [12:58.090 --> 13:01.030] Vehicle-to-Grid Communication Interface. [13:01.030 --> 13:04.690] And the part Vehicle-to-Grid has an acronym V2G. [13:04.690 --> 13:08.390] That's the reason why we named our tool V2GEvil, [13:08.390 --> 13:12.570] because it stands for the evaluation of the V2G communication. [13:14.570 --> 13:21.550] There is the comparison of the ISO and the IEC. [13:21.810 --> 13:27.010] As you can see, the ISO implements all of the OSI layers. [13:27.450 --> 13:34.670] And the new protocol is V2G Transfer Protocol, which I will explain in the following slides. [13:36.150 --> 13:45.250] We are aiming from the third network layer and above, up to the application layer. [13:48.670 --> 13:51.770] So the high-level communication is more complex, [13:51.770 --> 13:56.030] so there is bigger space for mistakes, and we are aiming for this. [13:57.210 --> 14:00.890] Here you can see the V2G communication flow, [14:00.890 --> 14:04.510] which is basically changing from one state to another. [14:04.510 --> 14:08.750] There is also exchange of the V2G messages. [14:10.890 --> 14:16.390] And after this is done, the charging is completed. [14:17.070 --> 14:23.730] Here you can see the V2G message, the header, the structure of the V2G message. [14:23.990 --> 14:28.410] I have to be now really fast, because we have only a few minutes. [14:28.410 --> 14:32.350] So this is the structure of the header. [14:33.070 --> 14:36.850] We have a different payload type, as you can see on the slide. [14:37.490 --> 14:42.370] Then the first of the V2G messages is the SDP request. [14:42.410 --> 14:47.490] There is some exchange for the security and transfer protocol for this. [14:47.530 --> 14:50.530] You have also the structure of the SDP request. [14:50.830 --> 14:55.790] Then the station will respond with the SDP response, [14:55.790 --> 15:02.030] with the information of IP address and the port for the communication over TCP protocol. [15:02.930 --> 15:06.910] And then the V2G communication can start. [15:08.190 --> 15:12.230] Here you can see the V2G message structure. [15:13.930 --> 15:17.470] It's divided into two different types. [15:18.170 --> 15:25.750] And the concept that we are aiming to cause some issues in this part, [15:25.750 --> 15:28.830] which is the decoding from EXI to XML, [15:28.830 --> 15:36.950] and also to this part, which is from this content and structure to the data structures. [15:41.060 --> 15:47.240] Here you can see just a simple representation of the message in XML format, [15:47.240 --> 15:50.600] which is later encoded to EXI. [15:52.880 --> 15:57.120] And I think we have to skip this. [15:59.860 --> 16:04.100] Yeah, so some words about the testing environment, [16:04.100 --> 16:07.360] because we need some specified testing environment [16:07.360 --> 16:12.840] where we use the DLAN Green PHY eval board and the DLAN Green PHY module. [16:12.840 --> 16:16.300] Basically, it has PLC support and PLC-to-Ethernet bridging support, [16:16.300 --> 16:20.320] which helps us with everything that was described in theory before. [16:20.520 --> 16:25.000] And we use this QCA 7000 Green PHY firmware, [16:25.000 --> 16:27.100] which allows us to configure, to configure, [16:27.100 --> 16:30.680] module as an EMOB charger or EMOB vehicle. [16:30.680 --> 16:36.000] So we potentially have the ability to act both as a charger and a vehicle. [16:36.000 --> 16:41.220] And it has implicit support for the Slack EVSC and the ACCC side, [16:41.220 --> 16:43.780] so the charger and the vehicle in this case. [16:43.960 --> 16:46.980] Here we have a sort of our complete development setup, [16:46.980 --> 16:52.900] where one board acts as the vehicle and one as the charger or the EVSC. [16:52.900 --> 16:56.300] And there are several ways that we can perform the PLC communication, [16:56.300 --> 16:59.680] as you see, but we chose to use a coax cable, [16:59.680 --> 17:03.380] as it will also be more appropriate for using the real world scenario [17:03.380 --> 17:06.520] to avoid interferences from other cables. [17:06.900 --> 17:09.820] And to conclude, you will be surprised if I tell you that [17:09.820 --> 17:13.660] many of the cheap Chinese controllers for Ethernet over power line [17:13.660 --> 17:16.980] use the same exact Qualcomm chip that we are also using. [17:16.980 --> 17:20.580] And if you are in one tight budget, let's say in most cases, [17:20.580 --> 17:24.200] you can reflush this chip with the appropriate firmware [17:24.200 --> 17:27.360] and run our tool with a budget of around 20 euros, [17:27.360 --> 17:31.420] comparing to a couple of hundred euros on the boards that I showed you before. [17:32.380 --> 17:36.040] And as always, we're referring to the first two layers. [17:36.040 --> 17:38.240] For the rest of the layers, we used as a reference [17:38.240 --> 17:42.220] the joint operating system for EV chargers, [17:42.220 --> 17:47.040] which in the start, we used both for the EVSC and the ACCC parts [17:47.040 --> 17:50.600] in order to properly implement all the parts of the communication. [17:50.600 --> 17:54.260] Later on, we developed our own malicious ACCC part [17:54.260 --> 17:59.720] to test against the Joseph EVCC reference implementation. [18:00.880 --> 18:04.120] And yeah, now let's go to our tool. [18:04.920 --> 18:10.620] So here you can see the architecture of our tool and its modules. [18:10.620 --> 18:14.380] So you have different modules and we will explain [18:14.380 --> 18:17.260] the most important modules in the next slides. [18:17.820 --> 18:23.980] So first of all, we have the implementation of V2G transfer protocol, [18:23.980 --> 18:27.760] which is basically the module V2GTP [18:27.760 --> 18:31.360] is basically the implementation of that transfer protocol. [18:31.360 --> 18:36.620] So this module is responsible for the V2G packet parsing, [18:36.620 --> 18:39.820] decoding and creating V2GTP packets. [18:40.000 --> 18:43.580] And the next module is the sniffer. [18:43.580 --> 18:46.680] The initial reason for developing the sniffer was [18:46.680 --> 18:53.880] to capture the V2G communication between the EV and EVSC [18:53.880 --> 19:00.950] and verify the correctness of our implementation of the V2G transfer protocol. [19:02.040 --> 19:05.410] So let's take a look at the demo. [19:06.030 --> 19:07.250] Thanks. [19:08.930 --> 19:15.890] So first of all, we start the station reference implementation, [19:18.430 --> 19:20.310] which is waiting for connection. [19:20.310 --> 19:25.090] Then we start our sniffer module with option V2GTP, [19:25.670 --> 19:33.570] which decodes the TCP raw data to V2G transfer protocol packet. [19:34.470 --> 19:37.690] Then we start the EVCC module, [19:37.690 --> 19:40.770] which is connecting like the car is connecting to the station, [19:40.770 --> 19:44.530] and then you can see the message exchange. [19:46.030 --> 19:50.830] And this is the output of the sniffer module that you can see [19:50.830 --> 19:54.470] that there's the V2GTP header and V2GTP payload. [19:54.470 --> 19:57.290] These are the SDP requests and the response. [19:58.150 --> 20:01.390] The next slide, you can also see that [20:03.570 --> 20:07.270] our sniffer module can also decode the EXI data, [20:07.270 --> 20:14.730] which are this payload that it's decoded to the XML document. [20:15.170 --> 20:18.910] The next two modules are the messages and the station. [20:19.190 --> 20:21.570] Messages are responsible to creating the messages [20:21.570 --> 20:25.210] and the conversion between the EXI and XML. [20:25.690 --> 20:31.150] And the station module is our implementation of the SECC, [20:31.150 --> 20:36.010] which is the Supply Equipment Communication Controller. [20:36.150 --> 20:40.470] And the station module is the core for the security modules. [20:42.690 --> 20:47.430] Let's start with the modules that are dedicated to the security testing. [20:47.430 --> 20:50.710] First of all, we have the enumerator module, [20:50.710 --> 20:53.290] which can help to enumerate the EV. [20:54.130 --> 20:57.250] For example, if the TLS is required or not, [20:57.250 --> 20:58.890] what is the TLS version? [20:58.890 --> 21:01.730] What are the supported cipher suites? [21:01.730 --> 21:07.270] And what is the application protocol required by the EV? [21:08.210 --> 21:15.230] So here you can see the demo that we start our station in enumerate mode. [21:15.230 --> 21:17.850] We enumerate all of the possible information. [21:17.850 --> 21:21.490] Then we start the EVCC to connect to our station. [21:21.490 --> 21:27.230] And then you can see the outcome of the enumerator. [21:27.250 --> 21:29.270] Here you can see the result. [21:29.270 --> 21:36.830] As I said, you can see the supported protocols, the TLS version and ciphers. [21:38.510 --> 21:40.750] And the last module is the fuzzer module, [21:40.750 --> 21:44.670] which is the most important module for the security testing. [21:44.670 --> 21:48.890] And using the fuzzer module, we can test the resilience of the EV [21:49.490 --> 21:56.130] to the invalid or malformed parameter values in the V2G response messages. [21:56.990 --> 22:02.230] So basically the fuzzer is sending malicious and invalid values for the parameters [22:02.230 --> 22:09.210] and it aims to the process of decoding the EXI to XML. [22:09.210 --> 22:10.990] So let's have a look at the demo. [22:15.190 --> 22:21.410] We start the fuzzer and waiting again for the EVCC to connect. [22:23.810 --> 22:27.970] And after the EVCC connects, there is some message exchange [22:27.970 --> 22:32.830] and in some of the messages we supply the invalid data. [22:33.110 --> 22:36.010] Here you can see the invalid data of some parameters [22:36.010 --> 22:41.370] and the result is that we can cause some errors on the EVCC side. [22:42.230 --> 22:44.890] The fuzzer module also can fuzz only one message [22:44.890 --> 22:54.750] and the result is that we can cause some decoding error in the unmarshall binary, [22:55.470 --> 23:00.350] which has some handful unmarshall method that reads a source of the XML data [23:00.350 --> 23:05.450] and binds its values to a new instance of Java object. [23:05.570 --> 23:07.270] And as we know from some articles, [23:07.270 --> 23:13.170] the unmarshall can be vulnerable to XML external entity injection attacks. [23:13.490 --> 23:22.990] So there is the space to implement the exploitation modules and exploit this further. [23:27.810 --> 23:29.070] So let's finish. [23:29.070 --> 23:32.970] Basically, there are a lot of enhancements that we can do on the tool. [23:32.970 --> 23:34.210] We will not go through them. [23:34.210 --> 23:35.130] We don't have time. [23:35.130 --> 23:41.250] But to conclude, communication electric vehicle says it has some potential from our point of view [23:41.250 --> 23:45.830] with bigger needs in the future, more sensitive data will start to flow [23:45.830 --> 23:49.010] and subsequently passed by EVs and EVSCs. [23:49.050 --> 23:53.750] And there are no open source tools available to cover these emerging attack vectors. [23:53.750 --> 23:56.950] That's why we build this and we hope that you will start using it [23:56.950 --> 24:02.250] and you will start getting to research vehicles in this way that it's uncovered till now. [24:02.730 --> 24:05.830] We want our tool to act as an easy way for people to get introduced [24:05.830 --> 24:11.270] and start researching both EVs and chargers in an efficient and modular way. [24:11.910 --> 24:15.110] Thank you and our tool will be released after DEF CON 32.