start	end	text
0	5620	Hello. Hello, everyone. First of all, thank you for joining us today.
5660	9260	And our topic is V2G will go through the wires.
9600	16280	Where will we talk about the V2G and the cyber security issues that come with it.
18140	23440	First of all, let me introduce us. I am Pavel Kuhn, cyber security researcher.
23440	29260	And I'm currently working at Auxilium Pentest Lab with Tom.
30280	33720	Yeah, hello from myself too. I'm Tomas Rampinis.
33720	36200	I'm the technical director of Auxilium Pentest Labs.
36940	39520	And yeah, like, let's start.
39680	44040	Our main goal today is to analyze the state of cyber security in the automotive industry
44680	50860	and get an in-depth look on the EV architecture and this undeniably emerging attack vector.
50860	56520	We want to explore and understand the communication protocols used in EV charging today.
56540	59980	And introduce you to our security tool, V2G Evil,
59980	63900	that we built with Pavel during his university thesis.
63900	69040	And finally, create a reference point for EV security research and evaluation.
69040	73020	Something that we feel our industry is lacking, basically.
73020	77120	Alongside other vectors in the automotive security landscape.
77740	82380	So let's start with the introduction to vehicle cyber security.
82380	87160	And basically, it goes without question that the automotive industry cannot be considered something new.
87160	91740	We are basically talking about 100 plus year old mechanical engineering industries.
91740	93340	And nothing is new about this.
93340	97080	The constant need for connectivity and technological aspects of it
97680	104340	push those companies to make a real, like, restructuring and start implementing technologies
104900	109060	that didn't have the know-how or the capacity to do so before.
109320	113100	Which is good for us, that's why we are here in the end.
113100	117360	But really bad for the security and safety of the affected vehicles that we're testing.
117360	122880	On the other hand, you have all these startups that started as technology companies first.
122880	128400	Which have a way better security posture and culture.
128400	131780	But the industry as a whole struggles for the last decade.
131780	135700	To be honest, I cannot see a clear light in this path.
138120	141840	Isolating the part we will focus in this talk,
141840	145920	we have the emerging industry of electric and hybrid vehicles.
145920	151320	Mainly developed to decentralize pollution and make better use of clean energy solutions.
151320	158500	And additionally, you have several advantages in comparison to internal combustion engine vehicles.
158500	161460	For example, heavy gains in speed and efficiency.
161460	164740	While early models used basic charging,
164740	170720	the last decade charging standards are applied and enforced in many ways.
170720	175960	Which led to the standardization of the ports, protocols and underlying data
175960	180940	in a wide range of applicability for different continents and standards.
180940	186040	This is, of course, in addition to the digital communication needed during charging.
186380	191440	Which expanded the attack surface of the vehicles as we knew from them before.
191460	195260	And created new attack vectors that we can start playing with.
197140	202800	What I'm saying here is that it's not something new or groundbreaking.
203400	204300	By any means.
204300	208160	But the state of EV charging security is a barely touched topic by researchers.
213920	218860	And here we have a really simple representation of a modern vehicle.
218860	221820	Which normally includes a bunch of interconnected ECUs.
221820	224940	Responsible for different functionality in the vehicle.
224940	230720	This can be from single headlight ECUs to huge DC-DC converters.
230720	236120	And what we see, though, is that while this vehicle till now was reasonably isolated
236760	241480	by the outside world, now we have a new externally accessible port.
241480	243700	Which connects to a charging station.
243700	245620	And this leaves a big room for error.
245620	250660	And if not properly implemented and designed, several unexpected instances can occur.
250660	256140	And while architecture and vehicle design of interconnected vehicles might not seem as
256140	262460	important, there are numerous instances that they play a big part of how severe our findings
262460	263940	are during a pen test.
263940	269160	And how, in the end, can or cannot affect the safety of the driver, passengers, or even
269160	270160	pedestrians.
270620	275860	And as we keep digging deeper, let's discuss a bit about charging in terms of vehicles
276380	278140	and the automotive industry.
278140	283880	First of all, there are several charging methods, including conductive, wireless, and
283880	288780	some exotic ones that we only see in some manufacturers, like battery swaps and
288780	290540	bidirectional charging.
290540	296580	And on top of that, there are different types, depending on the needs of the user and the
296580	300940	capabilities of the vehicle, including AC and DC charging.
300940	305120	Supplying different advantages and disadvantages, as we will see later.
305120	309960	And finally, during charging, there are also different modes of charging, where basically
309960	314800	the first three modes are focused to AC, and the fourth one in DC charging.
316280	321180	Talking about some boring stuff here, there are a lot of different available standards,
321180	327220	and as our main focus is the combined charging standard, or CCS.
327380	332880	Basically for Europe, and we just have this undeniably big list of standards for different
332880	339500	levels of this full implementation, ranging from the connector itself to the high-level
339500	343100	communication needed between the EV and the charger.
343100	348300	And this CCS standard is basically an effort towards a single unified for electric vehicle
349300	353720	charging, which considering where we are today, you might disagree.
355360	361060	And yeah, the reason I said this is because there are a number of different standards out
361060	362340	there in the wild.
362340	369440	Mostly divided to the different continents, but lately several manufacturers decided to
369440	375380	move into the Tesla standard, the supercharger standard, mainly in the USA and mainly because
375380	379060	of the heavily invested charging network in the US roads.
379080	384540	And of course, that does not affect Europe, at least for now, but the opportunity for
384660	387840	a unified standard, in my opinion, is kind of lost at this point.
388900	395280	And yeah, as we look at this circle of this CCSAC type 2 connector, we can distinguish
395280	396360	several pins.
396360	402040	Some of them is the CP pin, which is crucial for communication between the car and the
402040	408020	charging station, and the pin with the highest interest for us as cybersecurity researchers.
408020	413580	It basically allows the station to check the vehicle status and ensure it's safe to charge.
413580	419260	Then the PP pin ensures that the correct connector is used and provides information
419260	424560	on the current carrying capacity of the cable that we're using.
424720	430260	The AC type 2 connector supports charging at various power levels from household outlets
430260	433720	to high power public chargers.
434780	440700	And here we have the DC CCS type 2 connector, an extension of the AC type 2 connector designed
440700	444100	to support direct current fast charging.
444200	449420	And this connector, also known as combo 2, basically incorporates the same pins as the
449420	456380	AC type 2 connector for AC charging, but adds two additional pins specifically for DC charging.
456380	461200	And the combination of these pins in a single connector is what gives this combined charging
461200	462200	name.
462200	467740	And it provides the flexibility of using either AC or DC, depending on the charging station
467740	469600	and the vehicle capabilities.
470440	475540	Here we can basically get an understanding of how this works internally in the different
475540	478680	implementations of DC or AC charging.
478680	483880	And on the other hand, we have the DC charging where the power electronics for the conversion
483880	486920	of the current exists in the EVSC side.
486920	492300	So the charger, while when you want to use the slower solution of AC charging, the conversion
492300	496880	is still happening inside the vehicle itself by the onboard charger.
496880	501920	Additionally, we can get an understanding of the communication channel that exists in
501920	502700	those scenarios.
502700	507700	Really important, as we will see later, especially in safety critical cases where the current
507700	510720	needs to be negotiated.
511640	517700	From this, we clearly understand that charging is not only simple power transfer and data
517700	519860	exchange is also happening under the hood.
519860	525560	Many times with important information like payment details, voltage, current requirements,
525560	528120	time of charging, and others.
528120	532460	And to get a better understanding of how this communication is structured, I will pass it
532460	533260	to Pavel.
536640	539860	So let's have a look at the charging flow.
539860	542340	It's a high-level overview.
542340	546520	So first, the user plugs the CCS connector to his car.
546720	550540	And then the low-level communication starts.
551060	557600	If the EV is in the state B and the signal has the five-person duty cycle, it can change
557600	559620	to the high-level communication.
559620	564260	And during the high-level communication, they are exchanged to digital information about
564260	565220	the charging.
567920	572060	And that's how my journey and master thesis started.
572060	574680	So it's just a meme.
577020	580860	So let's have a look at the low-level communication at first.
583400	588600	Low-level communication in the charging process is also called basic signaling.
588600	604500	It offers basic control of the charging process between the EV and EVSE.
605640	612980	The EV controls the voltage value by adding or removing the resistors in the pilot signal.
612980	619040	And based on the measured voltage, the EVSE can recognize the EV's state.
619960	626280	The most important is the state B and state C, as you can see in the table.
628500	635200	Depending on the given state resulting from the measured voltage value, the EVSE generates
636240	640200	a pulsed modulation signal with a specific duty cycle.
640840	651060	This value of the duty cycle value is controlled by the charging station and measured in the
651060	651700	vehicle.
652400	659000	And the simplified outcome from the low-level communication is that the state B means that
659000	662540	EV is connected but not charging.
662540	666900	And the state C is EV is connected and ready for charge.
667620	671980	As I said, 5% duty cycle affords the high-level communication.
674640	679560	As you could see, the low-level communication is not so interesting from the cybersecurity
679560	685140	perspective because it only involves physical signaling.
685480	691040	However, low-level communication is important in the sense that it enforces high-level
691040	694960	communication for the specific state and the duty cycle.
694960	698380	So let's explore the high-level communication.
699680	702580	First of all, why do we need a high-level communication?
702580	706000	Why do low-level communication is not sufficient enough?
706040	712680	In the beginning, EV charging relied on the basic signaling methods only, which are sufficient
712680	716380	for simple on-off commands to start or stop.
716740	722920	But after some time, with the growing number of the electric vehicles and the complexity
723340	731200	of our energy ecosystem, this basic form of the communication is no longer sufficient.
731820	735800	High-level communication provides the optimized charging process.
739360	744280	As we already described before, the precondition for high-level communication is the low-level
744280	747600	communication with specific state and the duty cycle.
747680	753980	And the high-level communication is only applicable for charging modes 3 and 4.
753980	759460	And the high-level communication is mandatory for the mode 4, which is the DC charging,
759960	766960	because there is a need to exchange some additional information to avoid the damage to the battery.
770010	778090	The ISO 15118 defined all the high-level communication and the full name is
778090	781030	Vehicle-to-Grid Communication Interface.
781030	784690	And the part Vehicle-to-Grid has an acronym V2G.
784690	788390	That's the reason why we named our tool V2GEvil,
788390	792570	because it stands for the evaluation of the V2G communication.
794570	801550	There is the comparison of the ISO and the IEC.
801810	807010	As you can see, the ISO implements all of the OSI layers.
807450	814670	And the new protocol is V2G Transfer Protocol, which I will explain in the following slides.
816150	825250	We are aiming from the third network layer and above, up to the application layer.
828670	831770	So the high-level communication is more complex,
831770	836030	so there is bigger space for mistakes, and we are aiming for this.
837210	840890	Here you can see the V2G communication flow,
840890	844510	which is basically changing from one state to another.
844510	848750	There is also exchange of the V2G messages.
850890	856390	And after this is done, the charging is completed.
857070	863730	Here you can see the V2G message, the header, the structure of the V2G message.
863990	868410	I have to be now really fast, because we have only a few minutes.
868410	872350	So this is the structure of the header.
873070	876850	We have a different payload type, as you can see on the slide.
877490	882370	Then the first of the V2G messages is the SDP request.
882410	887490	There is some exchange for the security and transfer protocol for this.
887530	890530	You have also the structure of the SDP request.
890830	895790	Then the station will respond with the SDP response,
895790	902030	with the information of IP address and the port for the communication over TCP protocol.
902930	906910	And then the V2G communication can start.
908190	912230	Here you can see the V2G message structure.
913930	917470	It's divided into two different types.
918170	925750	And the concept that we are aiming to cause some issues in this part,
925750	928830	which is the decoding from EXI to XML,
928830	936950	and also to this part, which is from this content and structure to the data structures.
941060	947240	Here you can see just a simple representation of the message in XML format,
947240	950600	which is later encoded to EXI.
952880	957120	And I think we have to skip this.
959860	964100	Yeah, so some words about the testing environment,
964100	967360	because we need some specified testing environment
967360	972840	where we use the DLAN Green PHY eval board and the DLAN Green PHY module.
972840	976300	Basically, it has PLC support and PLC-to-Ethernet bridging support,
976300	980320	which helps us with everything that was described in theory before.
980520	985000	And we use this QCA 7000 Green PHY firmware,
985000	987100	which allows us to configure, to configure,
987100	990680	module as an EMOB charger or EMOB vehicle.
990680	996000	So we potentially have the ability to act both as a charger and a vehicle.
996000	1001220	And it has implicit support for the Slack EVSC and the ACCC side,
1001220	1003780	so the charger and the vehicle in this case.
1003960	1006980	Here we have a sort of our complete development setup,
1006980	1012900	where one board acts as the vehicle and one as the charger or the EVSC.
1012900	1016300	And there are several ways that we can perform the PLC communication,
1016300	1019680	as you see, but we chose to use a coax cable,
1019680	1023380	as it will also be more appropriate for using the real world scenario
1023380	1026520	to avoid interferences from other cables.
1026900	1029820	And to conclude, you will be surprised if I tell you that
1029820	1033660	many of the cheap Chinese controllers for Ethernet over power line
1033660	1036980	use the same exact Qualcomm chip that we are also using.
1036980	1040580	And if you are in one tight budget, let's say in most cases,
1040580	1044200	you can reflush this chip with the appropriate firmware
1044200	1047360	and run our tool with a budget of around 20 euros,
1047360	1051420	comparing to a couple of hundred euros on the boards that I showed you before.
1052380	1056040	And as always, we're referring to the first two layers.
1056040	1058240	For the rest of the layers, we used as a reference
1058240	1062220	the joint operating system for EV chargers,
1062220	1067040	which in the start, we used both for the EVSC and the ACCC parts
1067040	1070600	in order to properly implement all the parts of the communication.
1070600	1074260	Later on, we developed our own malicious ACCC part
1074260	1079720	to test against the Joseph EVCC reference implementation.
1080880	1084120	And yeah, now let's go to our tool.
1084920	1090620	So here you can see the architecture of our tool and its modules.
1090620	1094380	So you have different modules and we will explain
1094380	1097260	the most important modules in the next slides.
1097820	1103980	So first of all, we have the implementation of V2G transfer protocol,
1103980	1107760	which is basically the module V2GTP
1107760	1111360	is basically the implementation of that transfer protocol.
1111360	1116620	So this module is responsible for the V2G packet parsing,
1116620	1119820	decoding and creating V2GTP packets.
1120000	1123580	And the next module is the sniffer.
1123580	1126680	The initial reason for developing the sniffer was
1126680	1133880	to capture the V2G communication between the EV and EVSC
1133880	1140950	and verify the correctness of our implementation of the V2G transfer protocol.
1142040	1145410	So let's take a look at the demo.
1146030	1147250	Thanks.
1148930	1155890	So first of all, we start the station reference implementation,
1158430	1160310	which is waiting for connection.
1160310	1165090	Then we start our sniffer module with option V2GTP,
1165670	1173570	which decodes the TCP raw data to V2G transfer protocol packet.
1174470	1177690	Then we start the EVCC module,
1177690	1180770	which is connecting like the car is connecting to the station,
1180770	1184530	and then you can see the message exchange.
1186030	1190830	And this is the output of the sniffer module that you can see
1190830	1194470	that there's the V2GTP header and V2GTP payload.
1194470	1197290	These are the SDP requests and the response.
1198150	1201390	The next slide, you can also see that
1203570	1207270	our sniffer module can also decode the EXI data,
1207270	1214730	which are this payload that it's decoded to the XML document.
1215170	1218910	The next two modules are the messages and the station.
1219190	1221570	Messages are responsible to creating the messages
1221570	1225210	and the conversion between the EXI and XML.
1225690	1231150	And the station module is our implementation of the SECC,
1231150	1236010	which is the Supply Equipment Communication Controller.
1236150	1240470	And the station module is the core for the security modules.
1242690	1247430	Let's start with the modules that are dedicated to the security testing.
1247430	1250710	First of all, we have the enumerator module,
1250710	1253290	which can help to enumerate the EV.
1254130	1257250	For example, if the TLS is required or not,
1257250	1258890	what is the TLS version?
1258890	1261730	What are the supported cipher suites?
1261730	1267270	And what is the application protocol required by the EV?
1268210	1275230	So here you can see the demo that we start our station in enumerate mode.
1275230	1277850	We enumerate all of the possible information.
1277850	1281490	Then we start the EVCC to connect to our station.
1281490	1287230	And then you can see the outcome of the enumerator.
1287250	1289270	Here you can see the result.
1289270	1296830	As I said, you can see the supported protocols, the TLS version and ciphers.
1298510	1300750	And the last module is the fuzzer module,
1300750	1304670	which is the most important module for the security testing.
1304670	1308890	And using the fuzzer module, we can test the resilience of the EV
1309490	1316130	to the invalid or malformed parameter values in the V2G response messages.
1316990	1322230	So basically the fuzzer is sending malicious and invalid values for the parameters
1322230	1329210	and it aims to the process of decoding the EXI to XML.
1329210	1330990	So let's have a look at the demo.
1335190	1341410	We start the fuzzer and waiting again for the EVCC to connect.
1343810	1347970	And after the EVCC connects, there is some message exchange
1347970	1352830	and in some of the messages we supply the invalid data.
1353110	1356010	Here you can see the invalid data of some parameters
1356010	1361370	and the result is that we can cause some errors on the EVCC side.
1362230	1364890	The fuzzer module also can fuzz only one message
1364890	1374750	and the result is that we can cause some decoding error in the unmarshall binary,
1375470	1380350	which has some handful unmarshall method that reads a source of the XML data
1380350	1385450	and binds its values to a new instance of Java object.
1385570	1387270	And as we know from some articles,
1387270	1393170	the unmarshall can be vulnerable to XML external entity injection attacks.
1393490	1402990	So there is the space to implement the exploitation modules and exploit this further.
1407810	1409070	So let's finish.
1409070	1412970	Basically, there are a lot of enhancements that we can do on the tool.
1412970	1414210	We will not go through them.
1414210	1415130	We don't have time.
1415130	1421250	But to conclude, communication electric vehicle says it has some potential from our point of view
1421250	1425830	with bigger needs in the future, more sensitive data will start to flow
1425830	1429010	and subsequently passed by EVs and EVSCs.
1429050	1433750	And there are no open source tools available to cover these emerging attack vectors.
1433750	1436950	That's why we build this and we hope that you will start using it
1436950	1442250	and you will start getting to research vehicles in this way that it's uncovered till now.
1442730	1445830	We want our tool to act as an easy way for people to get introduced
1445830	1451270	and start researching both EVs and chargers in an efficient and modular way.
1451910	1455110	Thank you and our tool will be released after DEF CON 32.
