WEBVTT

00:00.000 --> 00:01.160
Hello.

00:01.380 --> 00:02.740
Hello, everyone.

00:02.740 --> 00:05.620
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:20.780
First of all, let me introduce us.

00:20.780 --> 00:23.440
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:32.660
Yeah, hello from myself too.

00:32.660 --> 00:33.720
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:50.860
Our main goal today is to analyze the state of cyber security in the automotive industry 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 --> 01:03.900
And introduce you to our security tool, V2G Evil, 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:49.060
The constant need for connectivity and technological aspects of it push those companies to make a real, like, restructuring and start implementing technologies 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:25.920
Isolating the part we will focus in this talk, 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:50.720
While early models used basic charging, the last decade charging standards are applied and enforced in many ways.

02:50.720 --> 03:00.940
Which led to the standardization of the ports, protocols and underlying data 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 --> 04:01.480
And what we see, though, is that while this vehicle till now was reasonably isolated 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:23.940
And while architecture and vehicle design of interconnected vehicles might not seem as important, there are numerous instances that they play a big part of how severe our findings are during a pen test.

04:23.940 --> 04:30.160
And how, in the end, can or cannot affect the safety of the driver, passengers, or even pedestrians.

04:30.620 --> 04:38.140
And as we keep digging deeper, let's discuss a bit about charging in terms of vehicles and the automotive industry.

04:38.140 --> 04:50.540
First of all, there are several charging methods, including conductive, wireless, and some exotic ones that we only see in some manufacturers, like battery swaps and bidirectional charging.

04:50.540 --> 05:00.940
And on top of that, there are different types, depending on the needs of the user and the 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:14.800
And finally, during charging, there are also different modes of charging, where basically the first three modes are focused to AC, and the fourth one in DC charging.

05:16.280 --> 05:27.220
Talking about some boring stuff here, there are a lot of different available standards, and as our main focus is the combined charging standard, or CCS.

05:27.380 --> 05:43.100
Basically for Europe, and we just have this undeniably big list of standards for different levels of this full implementation, ranging from the connector itself to the high-level communication needed between the EV and the charger.

05:43.100 --> 05:53.720
And this CCS standard is basically an effort towards a single unified for electric vehicle charging, which considering where we are today, you might disagree.

05:55.360 --> 06:02.340
And yeah, the reason I said this is because there are a number of different standards out there in the wild.

06:02.340 --> 06:19.060
Mostly divided to the different continents, but lately several manufacturers decided to move into the Tesla standard, the supercharger standard, mainly in the USA and mainly because of the heavily invested charging network in the US roads.

06:19.080 --> 06:27.840
And of course, that does not affect Europe, at least for now, but the opportunity for a unified standard, in my opinion, is kind of lost at this point.

06:28.900 --> 06:36.360
And yeah, as we look at this circle of this CCSAC type 2 connector, we can distinguish several pins.

06:36.360 --> 06:48.020
Some of them is the CP pin, which is crucial for communication between the car and the 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 --> 07:04.560
Then the PP pin ensures that the correct connector is used and provides information on the current carrying capacity of the cable that we're using.

07:04.720 --> 07:13.720
The AC type 2 connector supports charging at various power levels from household outlets to high power public chargers.

07:14.780 --> 07:24.100
And here we have the DC CCS type 2 connector, an extension of the AC type 2 connector designed to support direct current fast charging.

07:24.200 --> 07:36.380
And this connector, also known as combo 2, basically incorporates the same pins as the AC type 2 connector for AC charging, but adds two additional pins specifically for DC charging.

07:36.380 --> 07:42.200
And the combination of these pins in a single connector is what gives this combined charging name.

07:42.200 --> 07:49.600
And it provides the flexibility of using either AC or DC, depending on the charging station and the vehicle capabilities.

07:50.440 --> 07:58.680
Here we can basically get an understanding of how this works internally in the different implementations of DC or AC charging.

07:58.680 --> 08:06.920
And on the other hand, we have the DC charging where the power electronics for the conversion of the current exists in the EVSC side.

08:06.920 --> 08:16.880
So the charger, while when you want to use the slower solution of AC charging, the conversion is still happening inside the vehicle itself by the onboard charger.

08:16.880 --> 08:22.700
Additionally, we can get an understanding of the communication channel that exists in those scenarios.

08:22.700 --> 08:30.720
Really important, as we will see later, especially in safety critical cases where the current needs to be negotiated.

08:31.640 --> 08:39.860
From this, we clearly understand that charging is not only simple power transfer and data exchange is also happening under the hood.

08:39.860 --> 08:48.120
Many times with important information like payment details, voltage, current requirements, time of charging, and others.

08:48.120 --> 08:53.260
And to get a better understanding of how this communication is structured, I will pass it 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:19.620
If the EV is in the state B and the signal has the five-person duty cycle, it can change to the high-level communication.

09:19.620 --> 09:25.220
And during the high-level communication, they are exchanged to digital information about 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:40.200
Depending on the given state resulting from the measured voltage value, the EVSE generates a pulsed modulation signal with a specific duty cycle.

10:40.840 --> 10:51.700
This value of the duty cycle value is controlled by the charging station and measured in the vehicle.

10:52.400 --> 11:02.540
And the simplified outcome from the low-level communication is that the state B means that 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:25.140
As you could see, the low-level communication is not so interesting from the cybersecurity perspective because it only involves physical signaling.

11:25.480 --> 11:34.960
However, low-level communication is important in the sense that it enforces high-level 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:56.380
In the beginning, EV charging relied on the basic signaling methods only, which are sufficient for simple on-off commands to start or stop.

11:56.740 --> 12:11.200
But after some time, with the growing number of the electric vehicles and the complexity 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:27.600
As we already described before, the precondition for high-level communication is the low-level 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:46.960
And the high-level communication is mandatory for the mode 4, which is the DC charging, because there is a need to exchange some additional information to avoid the damage to the battery.

12:50.010 --> 13:01.030
The ISO 15118 defined all the high-level communication and the full name is 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:12.570
That's the reason why we named our tool V2GEvil, 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:56.030
So the high-level communication is more complex, so there is bigger space for mistakes, and we are aiming for this.

13:57.210 --> 14:04.510
Here you can see the V2G communication flow, 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 --> 15:02.030
Then the station will respond with the SDP response, 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:36.950
And the concept that we are aiming to cause some issues in this part, which is the decoding from EXI to XML, and also to this part, which is from this content and structure to the data structures.

15:41.060 --> 15:50.600
Here you can see just a simple representation of the message in XML format, which is later encoded to EXI.

15:52.880 --> 15:57.120
And I think we have to skip this.

15:59.860 --> 16:12.840
Yeah, so some words about the testing environment, because we need some specified testing environment where we use the DLAN Green PHY eval board and the DLAN Green PHY module.

16:12.840 --> 16:20.320
Basically, it has PLC support and PLC-to-Ethernet bridging support, which helps us with everything that was described in theory before.

16:20.520 --> 16:30.680
And we use this QCA 7000 Green PHY firmware, which allows us to configure, to configure, 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:43.780
And it has implicit support for the Slack EVSC and the ACCC side, so the charger and the vehicle in this case.

16:43.960 --> 16:52.900
Here we have a sort of our complete development setup, where one board acts as the vehicle and one as the charger or the EVSC.

16:52.900 --> 17:06.520
And there are several ways that we can perform the PLC communication, as you see, but we chose to use a coax cable, as it will also be more appropriate for using the real world scenario to avoid interferences from other cables.

17:06.900 --> 17:16.980
And to conclude, you will be surprised if I tell you that many of the cheap Chinese controllers for Ethernet over power line use the same exact Qualcomm chip that we are also using.

17:16.980 --> 17:31.420
And if you are in one tight budget, let's say in most cases, you can reflush this chip with the appropriate firmware and run our tool with a budget of around 20 euros, 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:50.600
For the rest of the layers, we used as a reference the joint operating system for EV chargers, which in the start, we used both for the EVSC and the ACCC parts in order to properly implement all the parts of the communication.

17:50.600 --> 17:59.720
Later on, we developed our own malicious ACCC part 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:17.260
So you have different modules and we will explain the most important modules in the next slides.

18:17.820 --> 18:31.360
So first of all, we have the implementation of V2G transfer protocol, which is basically the module V2GTP is basically the implementation of that transfer protocol.

18:31.360 --> 18:39.820
So this module is responsible for the V2G packet parsing, decoding and creating V2GTP packets.

18:40.000 --> 18:43.580
And the next module is the sniffer.

18:43.580 --> 19:00.950
The initial reason for developing the sniffer was to capture the V2G communication between the EV and EVSC 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:20.310
So first of all, we start the station reference implementation, which is waiting for connection.

19:20.310 --> 19:33.570
Then we start our sniffer module with option V2GTP, which decodes the TCP raw data to V2G transfer protocol packet.

19:34.470 --> 19:44.530
Then we start the EVCC module, which is connecting like the car is connecting to the station, and then you can see the message exchange.

19:46.030 --> 19:54.470
And this is the output of the sniffer module that you can see 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:14.730
The next slide, you can also see that our sniffer module can also decode the EXI data, 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:25.210
Messages are responsible to creating the messages and the conversion between the EXI and XML.

20:25.690 --> 20:36.010
And the station module is our implementation of the SECC, 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:53.290
First of all, we have the enumerator module, which can help to enumerate the EV.

20:54.130 --> 20:58.890
For example, if the TLS is required or not, 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:44.670
And the last module is the fuzzer module, which is the most important module for the security testing.

21:44.670 --> 21:56.130
And using the fuzzer module, we can test the resilience of the EV to the invalid or malformed parameter values in the V2G response messages.

21:56.990 --> 22:09.210
So basically the fuzzer is sending malicious and invalid values for the parameters 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:32.830
And after the EVCC connects, there is some message exchange and in some of the messages we supply the invalid data.

22:33.110 --> 22:41.370
Here you can see the invalid data of some parameters and the result is that we can cause some errors on the EVCC side.

22:42.230 --> 23:05.450
The fuzzer module also can fuzz only one message and the result is that we can cause some decoding error in the unmarshall binary, which has some handful unmarshall method that reads a source of the XML data and binds its values to a new instance of Java object.

23:05.570 --> 23:13.170
And as we know from some articles, 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:49.010
But to conclude, communication electric vehicle says it has some potential from our point of view with bigger needs in the future, more sensitive data will start to flow 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 --> 24:02.250
That's why we build this and we hope that you will start using it and you will start getting to research vehicles in this way that it's uncovered till now.

24:02.730 --> 24:11.270
We want our tool to act as an easy way for people to get introduced 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.

