1 00:00:00,000 --> 00:00:01,160 Hello. 2 00:00:01,380 --> 00:00:02,740 Hello, everyone. 3 00:00:02,740 --> 00:00:05,620 First of all, thank you for joining us today. 4 00:00:05,660 --> 00:00:09,260 And our topic is V2G will go through the wires. 5 00:00:09,600 --> 00:00:16,280 Where will we talk about the V2G and the cyber security issues that come with it. 6 00:00:18,140 --> 00:00:20,780 First of all, let me introduce us. 7 00:00:20,780 --> 00:00:23,440 I am Pavel Kuhn, cyber security researcher. 8 00:00:23,440 --> 00:00:29,260 And I'm currently working at Auxilium Pentest Lab with Tom. 9 00:00:30,280 --> 00:00:32,660 Yeah, hello from myself too. 10 00:00:32,660 --> 00:00:33,720 I'm Tomas Rampinis. 11 00:00:33,720 --> 00:00:36,200 I'm the technical director of Auxilium Pentest Labs. 12 00:00:36,940 --> 00:00:39,520 And yeah, like, let's start. 13 00:00:39,680 --> 00: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. 14 00:00:50,860 --> 00:00:56,520 We want to explore and understand the communication protocols used in EV charging today. 15 00:00:56,540 --> 00:01:03,900 And introduce you to our security tool, V2G Evil, that we built with Pavel during his university thesis. 16 00:01:03,900 --> 00:01:09,040 And finally, create a reference point for EV security research and evaluation. 17 00:01:09,040 --> 00:01:13,020 Something that we feel our industry is lacking, basically. 18 00:01:13,020 --> 00:01:17,120 Alongside other vectors in the automotive security landscape. 19 00:01:17,740 --> 00:01:22,380 So let's start with the introduction to vehicle cyber security. 20 00:01:22,380 --> 00:01:27,160 And basically, it goes without question that the automotive industry cannot be considered something new. 21 00:01:27,160 --> 00:01:31,740 We are basically talking about 100 plus year old mechanical engineering industries. 22 00:01:31,740 --> 00:01:33,340 And nothing is new about this. 23 00:01:33,340 --> 00: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. 24 00:01:49,320 --> 00:01:53,100 Which is good for us, that's why we are here in the end. 25 00:01:53,100 --> 00:01:57,360 But really bad for the security and safety of the affected vehicles that we're testing. 26 00:01:57,360 --> 00:02:02,880 On the other hand, you have all these startups that started as technology companies first. 27 00:02:02,880 --> 00:02:08,400 Which have a way better security posture and culture. 28 00:02:08,400 --> 00:02:11,780 But the industry as a whole struggles for the last decade. 29 00:02:11,780 --> 00:02:15,700 To be honest, I cannot see a clear light in this path. 30 00:02:18,120 --> 00:02:25,920 Isolating the part we will focus in this talk, we have the emerging industry of electric and hybrid vehicles. 31 00:02:25,920 --> 00:02:31,320 Mainly developed to decentralize pollution and make better use of clean energy solutions. 32 00:02:31,320 --> 00:02:38,500 And additionally, you have several advantages in comparison to internal combustion engine vehicles. 33 00:02:38,500 --> 00:02:41,460 For example, heavy gains in speed and efficiency. 34 00:02:41,460 --> 00:02:50,720 While early models used basic charging, the last decade charging standards are applied and enforced in many ways. 35 00:02:50,720 --> 00: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. 36 00:03:00,940 --> 00:03:06,040 This is, of course, in addition to the digital communication needed during charging. 37 00:03:06,380 --> 00:03:11,440 Which expanded the attack surface of the vehicles as we knew from them before. 38 00:03:11,460 --> 00:03:15,260 And created new attack vectors that we can start playing with. 39 00:03:17,140 --> 00:03:22,800 What I'm saying here is that it's not something new or groundbreaking. 40 00:03:23,400 --> 00:03:24,300 By any means. 41 00:03:24,300 --> 00:03:28,160 But the state of EV charging security is a barely touched topic by researchers. 42 00:03:33,920 --> 00:03:38,860 And here we have a really simple representation of a modern vehicle. 43 00:03:38,860 --> 00:03:41,820 Which normally includes a bunch of interconnected ECUs. 44 00:03:41,820 --> 00:03:44,940 Responsible for different functionality in the vehicle. 45 00:03:44,940 --> 00:03:50,720 This can be from single headlight ECUs to huge DC-DC converters. 46 00:03:50,720 --> 00: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. 47 00:04:01,480 --> 00:04:03,700 Which connects to a charging station. 48 00:04:03,700 --> 00:04:05,620 And this leaves a big room for error. 49 00:04:05,620 --> 00:04:10,660 And if not properly implemented and designed, several unexpected instances can occur. 50 00:04:10,660 --> 00: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. 51 00:04:23,940 --> 00:04:30,160 And how, in the end, can or cannot affect the safety of the driver, passengers, or even pedestrians. 52 00:04:30,620 --> 00:04:38,140 And as we keep digging deeper, let's discuss a bit about charging in terms of vehicles and the automotive industry. 53 00:04:38,140 --> 00: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. 54 00:04:50,540 --> 00: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. 55 00:05:00,940 --> 00:05:05,120 Supplying different advantages and disadvantages, as we will see later. 56 00:05:05,120 --> 00: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. 57 00:05:16,280 --> 00: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. 58 00:05:27,380 --> 00: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. 59 00:05:43,100 --> 00: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. 60 00:05:55,360 --> 00:06:02,340 And yeah, the reason I said this is because there are a number of different standards out there in the wild. 61 00:06:02,340 --> 00: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. 62 00:06:19,080 --> 00: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. 63 00:06:28,900 --> 00:06:36,360 And yeah, as we look at this circle of this CCSAC type 2 connector, we can distinguish several pins. 64 00:06:36,360 --> 00: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. 65 00:06:48,020 --> 00:06:53,580 It basically allows the station to check the vehicle status and ensure it's safe to charge. 66 00:06:53,580 --> 00: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. 67 00:07:04,720 --> 00:07:13,720 The AC type 2 connector supports charging at various power levels from household outlets to high power public chargers. 68 00:07:14,780 --> 00: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. 69 00:07:24,200 --> 00: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. 70 00:07:36,380 --> 00:07:42,200 And the combination of these pins in a single connector is what gives this combined charging name. 71 00:07:42,200 --> 00:07:49,600 And it provides the flexibility of using either AC or DC, depending on the charging station and the vehicle capabilities. 72 00:07:50,440 --> 00:07:58,680 Here we can basically get an understanding of how this works internally in the different implementations of DC or AC charging. 73 00:07:58,680 --> 00: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. 74 00:08:06,920 --> 00: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. 75 00:08:16,880 --> 00:08:22,700 Additionally, we can get an understanding of the communication channel that exists in those scenarios. 76 00:08:22,700 --> 00:08:30,720 Really important, as we will see later, especially in safety critical cases where the current needs to be negotiated. 77 00:08:31,640 --> 00: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. 78 00:08:39,860 --> 00:08:48,120 Many times with important information like payment details, voltage, current requirements, time of charging, and others. 79 00:08:48,120 --> 00:08:53,260 And to get a better understanding of how this communication is structured, I will pass it to Pavel. 80 00:08:56,640 --> 00:08:59,860 So let's have a look at the charging flow. 81 00:08:59,860 --> 00:09:02,340 It's a high-level overview. 82 00:09:02,340 --> 00:09:06,520 So first, the user plugs the CCS connector to his car. 83 00:09:06,720 --> 00:09:10,540 And then the low-level communication starts. 84 00:09:11,060 --> 00: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. 85 00:09:19,620 --> 00:09:25,220 And during the high-level communication, they are exchanged to digital information about the charging. 86 00:09:27,920 --> 00:09:32,060 And that's how my journey and master thesis started. 87 00:09:32,060 --> 00:09:34,680 So it's just a meme. 88 00:09:37,020 --> 00:09:40,860 So let's have a look at the low-level communication at first. 89 00:09:43,400 --> 00:09:48,600 Low-level communication in the charging process is also called basic signaling. 90 00:09:48,600 --> 00:10:04,500 It offers basic control of the charging process between the EV and EVSE. 91 00:10:05,640 --> 00:10:12,980 The EV controls the voltage value by adding or removing the resistors in the pilot signal. 92 00:10:12,980 --> 00:10:19,040 And based on the measured voltage, the EVSE can recognize the EV's state. 93 00:10:19,960 --> 00:10:26,280 The most important is the state B and state C, as you can see in the table. 94 00:10:28,500 --> 00: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. 95 00:10:40,840 --> 00:10:51,700 This value of the duty cycle value is controlled by the charging station and measured in the vehicle. 96 00:10:52,400 --> 00: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. 97 00:11:02,540 --> 00:11:06,900 And the state C is EV is connected and ready for charge. 98 00:11:07,620 --> 00:11:11,980 As I said, 5% duty cycle affords the high-level communication. 99 00:11:14,640 --> 00: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. 100 00:11:25,480 --> 00: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. 101 00:11:34,960 --> 00:11:38,380 So let's explore the high-level communication. 102 00:11:39,680 --> 00:11:42,580 First of all, why do we need a high-level communication? 103 00:11:42,580 --> 00:11:46,000 Why do low-level communication is not sufficient enough? 104 00:11:46,040 --> 00: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. 105 00:11:56,740 --> 00: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. 106 00:12:11,820 --> 00:12:15,800 High-level communication provides the optimized charging process. 107 00:12:19,360 --> 00: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. 108 00:12:27,680 --> 00:12:33,980 And the high-level communication is only applicable for charging modes 3 and 4. 109 00:12:33,980 --> 00: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. 110 00:12:50,010 --> 00:13:01,030 The ISO 15118 defined all the high-level communication and the full name is Vehicle-to-Grid Communication Interface. 111 00:13:01,030 --> 00:13:04,690 And the part Vehicle-to-Grid has an acronym V2G. 112 00:13:04,690 --> 00:13:12,570 That's the reason why we named our tool V2GEvil, because it stands for the evaluation of the V2G communication. 113 00:13:14,570 --> 00:13:21,550 There is the comparison of the ISO and the IEC. 114 00:13:21,810 --> 00:13:27,010 As you can see, the ISO implements all of the OSI layers. 115 00:13:27,450 --> 00:13:34,670 And the new protocol is V2G Transfer Protocol, which I will explain in the following slides. 116 00:13:36,150 --> 00:13:45,250 We are aiming from the third network layer and above, up to the application layer. 117 00:13:48,670 --> 00:13:56,030 So the high-level communication is more complex, so there is bigger space for mistakes, and we are aiming for this. 118 00:13:57,210 --> 00:14:04,510 Here you can see the V2G communication flow, which is basically changing from one state to another. 119 00:14:04,510 --> 00:14:08,750 There is also exchange of the V2G messages. 120 00:14:10,890 --> 00:14:16,390 And after this is done, the charging is completed. 121 00:14:17,070 --> 00:14:23,730 Here you can see the V2G message, the header, the structure of the V2G message. 122 00:14:23,990 --> 00:14:28,410 I have to be now really fast, because we have only a few minutes. 123 00:14:28,410 --> 00:14:32,350 So this is the structure of the header. 124 00:14:33,070 --> 00:14:36,850 We have a different payload type, as you can see on the slide. 125 00:14:37,490 --> 00:14:42,370 Then the first of the V2G messages is the SDP request. 126 00:14:42,410 --> 00:14:47,490 There is some exchange for the security and transfer protocol for this. 127 00:14:47,530 --> 00:14:50,530 You have also the structure of the SDP request. 128 00:14:50,830 --> 00: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. 129 00:15:02,930 --> 00:15:06,910 And then the V2G communication can start. 130 00:15:08,190 --> 00:15:12,230 Here you can see the V2G message structure. 131 00:15:13,930 --> 00:15:17,470 It's divided into two different types. 132 00:15:18,170 --> 00: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. 133 00:15:41,060 --> 00:15:50,600 Here you can see just a simple representation of the message in XML format, which is later encoded to EXI. 134 00:15:52,880 --> 00:15:57,120 And I think we have to skip this. 135 00:15:59,860 --> 00: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. 136 00:16:12,840 --> 00: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. 137 00:16:20,520 --> 00: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. 138 00:16:30,680 --> 00:16:36,000 So we potentially have the ability to act both as a charger and a vehicle. 139 00:16:36,000 --> 00: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. 140 00:16:43,960 --> 00: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. 141 00:16:52,900 --> 00: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. 142 00:17:06,900 --> 00: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. 143 00:17:16,980 --> 00: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. 144 00:17:32,380 --> 00:17:36,040 And as always, we're referring to the first two layers. 145 00:17:36,040 --> 00: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. 146 00:17:50,600 --> 00:17:59,720 Later on, we developed our own malicious ACCC part to test against the Joseph EVCC reference implementation. 147 00:18:00,880 --> 00:18:04,120 And yeah, now let's go to our tool. 148 00:18:04,920 --> 00:18:10,620 So here you can see the architecture of our tool and its modules. 149 00:18:10,620 --> 00:18:17,260 So you have different modules and we will explain the most important modules in the next slides. 150 00:18:17,820 --> 00: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. 151 00:18:31,360 --> 00:18:39,820 So this module is responsible for the V2G packet parsing, decoding and creating V2GTP packets. 152 00:18:40,000 --> 00:18:43,580 And the next module is the sniffer. 153 00:18:43,580 --> 00: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. 154 00:19:02,040 --> 00:19:05,410 So let's take a look at the demo. 155 00:19:06,030 --> 00:19:07,250 Thanks. 156 00:19:08,930 --> 00:19:20,310 So first of all, we start the station reference implementation, which is waiting for connection. 157 00:19:20,310 --> 00:19:33,570 Then we start our sniffer module with option V2GTP, which decodes the TCP raw data to V2G transfer protocol packet. 158 00:19:34,470 --> 00: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. 159 00:19:46,030 --> 00: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. 160 00:19:54,470 --> 00:19:57,290 These are the SDP requests and the response. 161 00:19:58,150 --> 00: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. 162 00:20:15,170 --> 00:20:18,910 The next two modules are the messages and the station. 163 00:20:19,190 --> 00:20:25,210 Messages are responsible to creating the messages and the conversion between the EXI and XML. 164 00:20:25,690 --> 00:20:36,010 And the station module is our implementation of the SECC, which is the Supply Equipment Communication Controller. 165 00:20:36,150 --> 00:20:40,470 And the station module is the core for the security modules. 166 00:20:42,690 --> 00:20:47,430 Let's start with the modules that are dedicated to the security testing. 167 00:20:47,430 --> 00:20:53,290 First of all, we have the enumerator module, which can help to enumerate the EV. 168 00:20:54,130 --> 00:20:58,890 For example, if the TLS is required or not, what is the TLS version? 169 00:20:58,890 --> 00:21:01,730 What are the supported cipher suites? 170 00:21:01,730 --> 00:21:07,270 And what is the application protocol required by the EV? 171 00:21:08,210 --> 00:21:15,230 So here you can see the demo that we start our station in enumerate mode. 172 00:21:15,230 --> 00:21:17,850 We enumerate all of the possible information. 173 00:21:17,850 --> 00:21:21,490 Then we start the EVCC to connect to our station. 174 00:21:21,490 --> 00:21:27,230 And then you can see the outcome of the enumerator. 175 00:21:27,250 --> 00:21:29,270 Here you can see the result. 176 00:21:29,270 --> 00:21:36,830 As I said, you can see the supported protocols, the TLS version and ciphers. 177 00:21:38,510 --> 00:21:44,670 And the last module is the fuzzer module, which is the most important module for the security testing. 178 00:21:44,670 --> 00: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. 179 00:21:56,990 --> 00: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. 180 00:22:09,210 --> 00:22:10,990 So let's have a look at the demo. 181 00:22:15,190 --> 00:22:21,410 We start the fuzzer and waiting again for the EVCC to connect. 182 00:22:23,810 --> 00:22:32,830 And after the EVCC connects, there is some message exchange and in some of the messages we supply the invalid data. 183 00:22:33,110 --> 00: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. 184 00:22:42,230 --> 00: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. 185 00:23:05,570 --> 00:23:13,170 And as we know from some articles, the unmarshall can be vulnerable to XML external entity injection attacks. 186 00:23:13,490 --> 00:23:22,990 So there is the space to implement the exploitation modules and exploit this further. 187 00:23:27,810 --> 00:23:29,070 So let's finish. 188 00:23:29,070 --> 00:23:32,970 Basically, there are a lot of enhancements that we can do on the tool. 189 00:23:32,970 --> 00:23:34,210 We will not go through them. 190 00:23:34,210 --> 00:23:35,130 We don't have time. 191 00:23:35,130 --> 00: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. 192 00:23:49,050 --> 00:23:53,750 And there are no open source tools available to cover these emerging attack vectors. 193 00:23:53,750 --> 00: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. 194 00:24:02,730 --> 00: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. 195 00:24:11,910 --> 00:24:15,110 Thank you and our tool will be released after DEF CON 32.