WEBVTT

00:01.180 --> 00:03.000
Hello DEF CON!

00:03.000 --> 00:04.200
Hi!

00:10.500 --> 00:14.140
I hope you enjoy your time here, we definitely do.

00:14.140 --> 00:26.670
It's actually our first time here at DEF CON and thus we are very proud and excited to present to you our talk Redefining V2G, how to use your vehicle as a game controller.

00:27.760 --> 00:32.240
So, why do we need to redefine the acronym V2G?

00:37.370 --> 00:39.870
Well, let me tell you a story.

00:39.870 --> 00:45.430
Once upon a time, our professor told us we should do some research about V2G.

00:46.010 --> 01:01.750
And what he means by that is that we look at vehicle-to-grid communication, the communication between the car and the charge point, and also the back-end and even the power grid for bi-directional charging, for example.

01:02.250 --> 01:08.250
Well, that's actually a pretty cool research topic, but do you know what's even cooler?

01:09.570 --> 01:12.090
Using your car as a game controller.

01:12.090 --> 01:17.690
So, that's why we developed this little project called Vehicle-to-Game.

01:18.270 --> 01:22.870
But before we get started with that, a short introduction of ourselves.

01:22.870 --> 01:34.650
My name is Tim, I'm a PhD student at Darmstadt University of Applied Sciences in Germany, and I mainly do automotive security, so also a lot of theoretical stuff.

01:34.650 --> 01:45.610
I look at protocols and standards and do a formal analysis of these standards to see if they meet certain security goals.

01:45.730 --> 01:48.050
Yeah, hello from my side too.

01:48.050 --> 01:58.550
I'm Janis, I'm also a PhD student at our small automotive research group called ACSD, Automotive Cyber Security Darmstadt.

01:58.550 --> 02:00.810
It's located in Germany.

02:00.810 --> 02:12.630
I finished my master's at the end of the last year, and now I'm a PhD student about resilience in the automotive topic, but also for IoT systems.

02:12.630 --> 02:27.850
It means what happens if an ECU in a car breaks or is going to be compromised, how you can migrate functionality to another ECU and strengthen the safety inside the car by such a resilient concept.

02:28.830 --> 02:33.350
Our research group is also very focused on teaching.

02:33.350 --> 02:54.910
We have a lecture called Automotive Security, and therefore we have to motivate students, of course, and that's why we have created this motivating and beginner-friendly talk and our project V2G to get students excited and motivated about the topic of automotive research.

02:55.730 --> 03:00.290
Maybe the most important member of our research group is our research car.

03:00.290 --> 03:02.190
It's a Volkswagen ID.3.

03:02.190 --> 03:04.010
It's an electric vehicle.

03:04.290 --> 03:08.210
And since, of course, we are Germans, we have to do research on the Volkswagen.

03:13.740 --> 03:23.300
Usually, the initial step of the automotive research, but also other security research, is considering attack vectors.

03:23.300 --> 03:26.620
And that's what we have to do also for the automotive context.

03:26.620 --> 03:32.320
You can see there are various attack... it's a huge attack surface.

03:32.320 --> 03:38.700
First of all, you have long-range attacks, you have short-range attacks, but you have also physical attack possibilities.

03:38.720 --> 03:49.220
For the long-range attacks, for example, the cellular communication between the car and the back-end of the OEM, for example, for over-the-air updates.

03:49.560 --> 03:59.400
In newly upcoming cars, you have also the V2X communication, cars communicating to each other about their location, about their speed.

03:59.400 --> 04:09.900
You have cars communicating with road signs to get a status about allowed speed, for example, of this street section.

04:10.420 --> 04:27.180
You have short-range attacks, that's more or less classical cyber security, considering Bluetooth, Wi-Fi connection for your infotainment system between the smartphone, for example, for playing via Apple CarPlay, for example, the music on your car.

04:27.860 --> 04:49.760
And the maybe most interesting and car-specific attack vectors are these physical attacks, that's the bus systems inside the car, there are several of them, but we want to focus on two, and we go into them a little bit later in detail, because we need them for our V2G project,

04:49.760 --> 04:54.640
for getting all information required for our game controller out of this car.

04:57.960 --> 05:02.180
So, here you can see our two main research cars.

05:02.180 --> 05:09.900
We are focused on electric vehicles, so on the left side you can see our Volkswagen ID.3, on the right side you can see the Tesla Model 3.

05:11.000 --> 05:26.740
We use them for practical research, Tim also introduced them as theoretical research, I'm also more theoretical part, but you cannot do the whole time theoretical research, so you have to do tinkering around with the car, it's also good for the motivation.

05:27.260 --> 05:39.480
There's a lot of information you just get when you look at the actual car, because the manufacturers won't tell you, and also for students it's quite cool to do research on the actual cars and projects.

05:40.880 --> 05:51.560
So, we have equipped our cars with lots of techniques to get information about them, and we show you in the following how we have done this.

05:51.860 --> 06:09.740
That's the back of the Volkswagen ID.3, we've equipped this with lots of measurement techniques, on the right you can see so-called vector boxes, they're from a German company called Vector, that's why we call them vector boxes, they're for capturing different buses inside the car,

06:09.740 --> 06:18.200
and we have equipped the car in a way that we can get a holistic view of all relevant buses in this car.

06:18.380 --> 06:38.220
On the left side you can also see some interesting parts, more for the electrical engineers, we have equipped the car with so-called LEM sensors, they are current measuring sensors via induction, you can clip them on the high voltage system wires to measure the current.

06:38.220 --> 07:00.120
The idea behind this holistic view between physical and messages inside the car is that we can compare those data and get correlations between the actual physical measurements and the recorded, for example, canvas data.

07:02.260 --> 07:09.120
As I've already introduced, from a theoretical way, there's also a practical attack surface, of course.

07:09.120 --> 07:32.200
On the left side you can see classical key fob attacks using an SDR, maybe all of you have heard about the roll jam attack, you jam the signal of the key fob because it's using a rolling code, and the owner of the car will press a second time, and you have recorded both signals,

07:32.200 --> 07:43.500
and you re-send the older one because the car hasn't heard this already, and so you have a newer one for the car, unlocking this in the future without the owner getting any notice about this.

07:44.340 --> 07:56.400
In the middle you can see, for automotive and classical attack surfaces also, unsoldering the chips where the firmware is located on, because you have physical access to your car.

07:56.400 --> 08:00.400
If you own the car, you can do anything you like with it, more or less.

08:01.080 --> 08:08.760
So that's why we have unsoldered the EMMC chip, to get in contact with the firmware.

08:09.220 --> 08:16.080
That's the same we've done with the key fob, you can see here there was the memory chip.

08:16.920 --> 08:27.840
And maybe another interesting part is that you can directly connect, here you can see such a vector box, to the internal buses of the car.

08:27.840 --> 08:38.980
Here you can see one such an ECU, and we have connected this box with the CAN bus of the ECU, controlling messages.

08:39.680 --> 08:53.150
But before we go there for a little bit in detail, how these messages look like, first we have to understand what this CAN bus actually is, how can we talk to those cars.

08:53.150 --> 09:06.230
For a game controller, we require, as I've already mentioned, information about specific actuators of the car, for example the steering wheel.

09:06.230 --> 09:11.610
We later want to transfer the angle of the steering wheel, to our virtual game controller.

09:11.610 --> 09:14.810
So we have to get this information out of the car.

09:14.830 --> 09:18.210
And this information is transferred via the CAN bus.

09:22.050 --> 09:39.350
The topology of such a car looks like follows, it's a very condensed view, it's a very simplified view of our Volkswagen ID.3, where you can see there's a main gateway ECU, and several domains.

09:39.450 --> 09:51.270
Each domain consists of several other ECUs, and each of those domains is separated in a way, based on criticality of those functionality and the ECUs.

09:51.270 --> 10:03.490
For example, in the middle domain you can see, in the drive domain you can see, there's located the engine ECU, but also the brake ECU, they're all safety relevant, so they're very critical for the safety behavior of the car.

10:03.490 --> 10:12.490
On the left side you can see a separated domain, with less criticality for, for example, the light controlling inside the car.

10:13.990 --> 10:23.490
The special thing in this topology is, that those domains are separated, based on this gateway ECU.

10:23.490 --> 10:41.330
The gateway ECU is responsible for, for shielding the inside of the car against the outside, because, you know, maybe you know this from combustion engine, the outside of the car is connected with so-called OBD2 port.

10:41.330 --> 10:46.890
It's for diagnosis, if you bring your car to a garage, they will plug there in.

10:46.890 --> 10:52.710
And you want to prevent that via the OBD2 port, everyone can read everything of the car.

10:52.710 --> 10:57.770
So that's why such a gateway ECU is introduced into this topology.

10:57.970 --> 11:01.630
But this strongly depends on the actual car you want to consider.

11:01.630 --> 11:07.410
That's just for the Volkswagen ID.3 and the group of vehicles from Volkswagen.

11:11.230 --> 11:14.570
Now we get a little bit into detail about this CAN bus.

11:14.570 --> 11:17.770
The CAN bus was developed by Bosch in 1986.

11:18.070 --> 11:23.870
It's a dual wire twisted pair cable, and as I said before, it's a bus topology.

11:23.870 --> 11:26.210
What does it mean?

11:26.210 --> 11:39.010
A bus topology means that the ECUs are connected to the same wire, or wire pair, and all ECUs get the same state of information in the respective time frame.

11:39.010 --> 11:51.310
We have a frequency in this CAN bus, and all this information is distributed in this time frame to all ECUs connected to this CAN bus.

11:51.310 --> 11:53.690
It's also a multi-master protocol.

11:53.690 --> 12:02.710
It means that all ECUs can send and receive on demand, and there's no master required to control them.

12:06.570 --> 12:10.590
Now we have the foundations how this CAN bus works.

12:10.590 --> 12:15.790
Now we get to gain access to this physical CAN bus inside the car.

12:16.510 --> 12:22.090
Maybe the most convenient way is to find just a repair manual or a wiring diagram of the car.

12:22.090 --> 12:24.830
They're usually available for garages.

12:24.850 --> 12:27.310
For Volkswagen, you can get them online.

12:27.310 --> 12:31.370
If you claim you have a garage, then you can buy it.

12:32.790 --> 12:37.370
Otherwise, you have to find it out by yourself, but this can become very, very hard.

12:37.370 --> 12:40.810
So we recommend having such a wiring diagram.

12:41.270 --> 12:51.190
Based on this wiring diagram, you can find a good exposed position of an interesting CAN bus where you can connect to.

12:51.190 --> 12:57.270
For example, here you can see the Tesla Model 3, which is in the mid console of the car.

12:57.530 --> 13:06.330
There's one of three CAN buses, which you can easily open and connect to ready-to-buy adapter.

13:06.330 --> 13:09.590
You can buy those adapters easily on eBay, for example.

13:09.810 --> 13:13.650
And then you can gain access to this CAN bus.

13:14.270 --> 13:21.170
If you don't want to destroy your car or altering this, there are also less intrusive techniques.

13:21.170 --> 13:24.050
These are called contactless CAN readers.

13:24.050 --> 13:28.390
They read CAN messages based on induction of the signal.

13:28.850 --> 13:31.290
And that's more or less... it looks like a crocodile.

13:31.290 --> 13:34.170
That's why some products are called CAN crocodile.

13:34.170 --> 13:46.690
You clamp the CAN wires high and low, those dual wires, between the clamp of the contactless CAN reader, and you can read those messages.

13:47.430 --> 13:55.790
So, you have gained access to the physical layer, you have read those physical signals of the CAN bus.

13:55.790 --> 14:01.170
Now you have to transfer them into software, and therefore you need such...

14:01.690 --> 14:11.970
for the Raspberry Pi, for example, a CAN head, where those physical CAN signals are interpreted and transferred to the kernel of the Raspberry Pi.

14:12.190 --> 14:22.630
There are also other options available, which can conveniently be used, where you can connect your CAN bus directly via USB to your PC.

14:22.630 --> 14:26.850
This also works for Windows, so maybe it's for part of you interesting.

14:27.330 --> 14:35.290
So, now we have transferred the message to the software part of our project, and that's where Tim continues.

14:35.290 --> 14:41.350
Alright, so very conveniently in the Linux kernel, there's already a CAN driver built in.

14:41.350 --> 14:48.690
And if you want to work with that, there's CANutils, which has all the basic tools to use that.

14:48.890 --> 14:55.590
Also, if you want to do more advanced stuff for scripting, you can use, for example, PythonCAN as a really good library.

14:55.590 --> 14:57.350
That's what we use for our project.

14:57.830 --> 15:01.050
There's also CANtools for more advanced command-line tools.

15:01.350 --> 15:06.670
If you're into GUIs, there's SavvyCAN, which is a really good open-source GUI tool.

15:07.110 --> 15:09.430
And, of course, there are a lot of commercial tools.

15:09.430 --> 15:11.790
We talked about all this vector stuff before.

15:12.750 --> 15:14.830
But let's stick with the very basics.

15:14.830 --> 15:23.710
So you install CANutils, and then there's this CANdump command, which will just print out all of the CAN messages on the bus.

15:23.710 --> 15:28.170
It looks somehow like this, but probably a lot faster if you're on a real car.

15:28.810 --> 15:36.430
For Tesla, for example, it might be on one bus, I think, like 3,000 messages a second, so it can be quite a lot.

15:37.070 --> 15:51.410
One step back, even, if you connect to this, for Linux, the CAN interface is like any other network interface if your adapter is compatible with SocketCAN.

15:52.410 --> 16:03.510
The only difference is that you don't have a network manager to directly get your interface up and running, and you also need a bitrate.

16:03.890 --> 16:09.740
So you have to tell the computer how fast the bus operates.

16:09.740 --> 16:14.260
You can measure that by using an oscilloscope, of course.

16:14.800 --> 16:20.780
Luckily for automotive, it's usually 500 kilobits per second, so you can also try that.

16:20.900 --> 16:37.680
And just as a disclaimer, there are also more modern standards, like improvements on the CAN standards, for example, CAN FD, and there you will also need to have the data rate, for example.

16:38.280 --> 16:41.320
But let's assume standard CAN for now.

16:41.880 --> 16:44.540
And then we've already seen the candab command.

16:44.660 --> 16:49.040
I just want to walk very quickly through what you can see here.

16:49.040 --> 16:51.900
That's one single message picked out.

16:51.900 --> 16:59.860
You see the interface in the front, if you have multiple CAN interfaces connected, that's important.

16:59.860 --> 17:04.620
Then the CAN ID, and the data length, and the data.

17:04.620 --> 17:14.560
The thing is, this CAN ID, if you're used to IP, you're usually used to having a source and a destination address.

17:14.640 --> 17:17.300
The CAN ID is actually neither.

17:17.300 --> 17:20.040
Think of it more like a publish-subscribe topic.

17:20.040 --> 17:28.500
So it will tell you how to define or how to interpret the bits in the data part.

17:29.040 --> 17:31.180
Also, it's the priority of the message.

17:31.180 --> 17:33.560
So the lower the ID, the higher the priority.

17:35.240 --> 17:40.940
And this data, it can be really arbitrarily defined.

17:40.980 --> 17:49.160
The information in there is called signals, and it can be like 1-bit, it can be 5-bit, it can be all 8-bytes.

17:49.820 --> 17:59.700
So that's up to the manufacturer to define that, and that's why we usually need some reverse engineering to make sense of this information.

18:00.680 --> 18:09.920
Okay, so you might want to get started, but maybe you do not want to remove all the plating of your car.

18:10.100 --> 18:16.520
It sounds like a lot of work to figure out all the wiring and stuff.

18:17.480 --> 18:24.600
So that's actually how we started, but if you don't want to do that, there's also the way the garages do that.

18:24.600 --> 18:33.080
So Janice already spoilered it, that you have this OBD2 connector, and for vehicle diagnostics.

18:33.720 --> 18:45.540
And this connector is usually very conveniently located somewhere in the driver area of your vehicle in front, and you can just plug in a diagnostic connector there.

18:45.540 --> 18:54.640
It's usually an OBD2 dongle, which connects via Bluetooth to a diagnostic device, and will read out data like that.

18:54.740 --> 19:02.540
And the protocol to do this is called UDS, Unified Diagnostic Services, and it's basically a request-response protocol.

19:02.760 --> 19:10.680
The diagnostic tester will, for example, in our case, we want the steering wheel angle, so it will ask, is you responsible for that?

19:10.680 --> 19:12.320
Can you give me the steering wheel angle?

19:12.320 --> 19:14.620
And it will respond with the correct value.

19:15.000 --> 19:19.300
So that's on top of the CAN protocol.

19:19.300 --> 19:23.680
It can also be IP, but usually CAN, or both.

19:23.700 --> 19:31.460
And in between, there's actually another protocol, which is called ISOTP, and which allows to basically combine multiple CAN measures.

19:31.460 --> 19:39.700
They are limited to 8-byte, to one message in UDS, so you can send longer data.

19:41.040 --> 19:46.520
But that comes with the difference that now we also...

19:46.520 --> 19:54.980
I told you before that this is not like source and destination address to CAN ID, but for UDS, it's actually the destination address now.

19:55.100 --> 20:01.780
So there's also, if you want to read data, there's also a data identifier, which identifies which data it is.

20:01.780 --> 20:10.620
So you can have now multiple different interpretations for data with the same CAN ID, and data can be split over multiple CAN frames.

20:10.620 --> 20:11.980
Just watch out for that.

20:11.980 --> 20:16.860
All right, and with that, I think we should have everything ready to go.

20:16.960 --> 20:17.940
Yeah, I think so.

20:17.940 --> 20:28.920
We have considered the physical layer, we have considered the transfer to the software, we have considered how we can interpret those CAN messages, so we have all together to create our game.

20:29.120 --> 20:34.360
And as a small in-between motivation, that's the actual result.

20:34.360 --> 20:37.920
Here you can see Tim sitting in our Volkswagen ID.3.

20:38.020 --> 20:45.440
In front, we have placed a big monitor, playing Need for Speed Most Wanted from 2008, with the actual car.

20:48.690 --> 20:49.790
Thank you.

20:54.690 --> 20:58.630
Here you can see a little bit more of our V2G experience.

20:58.630 --> 21:03.770
On the left side, you can see our setup, a laptop where the game is actually running.

21:03.770 --> 21:12.210
In front of the car, we have placed a huge monitor for a very immersive experience for the driver, but also for all other people inside the car.

21:12.210 --> 21:16.870
On the right side, you can see me playing, again, Need for Speed Most Wanted.

21:16.930 --> 21:19.930
And you can see I'm very focused on this game.

21:19.930 --> 21:26.210
So, as I said, it's very immersive, and it's a very cool experience sitting in such an equipped car.

21:28.290 --> 21:34.770
But how can we now connect the laptop, the game, with the car?

21:34.770 --> 21:37.410
You can see on the right, the topology again.

21:38.050 --> 21:42.490
Therefore, we have several possibilities to connect the car.

21:42.490 --> 21:44.490
First, we can use wires.

21:44.490 --> 21:55.030
We can use the USB-based P-CAN Pro, for example, connecting, as one possibility, to the internal CAN bus.

21:55.230 --> 22:00.310
Therefore, we have to figure out which CAN bus relevant messages are located on.

22:00.630 --> 22:15.070
We have to find the relevant messages, figuring out the relevant signals of the CAN messages, and there's an overwhelming number of CAN messages on this internal bus.

22:15.070 --> 22:18.330
As Tim said, several thousands per second.

22:18.330 --> 22:22.590
So it's quite difficult to figure this stuff out.

22:22.730 --> 22:43.790
Also, the whole breakout box stuff we've shown to you is required to get access to those internal buses, so the more convenient solution is connecting directly to the OBD2 port and use the diagnostic services for pulling those informations and getting conveniently just the requested information.

22:44.210 --> 22:48.470
But since we live in 2024, wires are a little bit outdated.

22:48.470 --> 23:02.650
We have created a Raspberry Pi head, which allows us to emulate an Xbox 360 controller with a Raspberry Pi Zero, connecting directly to the OBD2 port of the car.

23:02.650 --> 23:12.990
And this Raspberry Pi connects via Bluetooth to the laptop, emulates this controller, and the laptop can stand outside the car and runs the game.

23:13.470 --> 23:16.650
For this setup, we use UDS.

23:18.650 --> 23:23.790
Now, a little bit into detail of the actual hardware we use for it.

23:24.190 --> 23:30.490
The lower layer of this, you can see it's a classical Raspberry Pi Zero with no modifications.

23:30.490 --> 23:43.230
Above that, we have located the Raspberry Pi CAN head, which is responsible for converting those physical CAN signals to a software-readable CAN message.

23:43.370 --> 23:57.370
And the top layer, we have created a self-designed PCB for connecting to this OBD2 port of the car.

23:57.370 --> 24:03.090
From this OBD2 port, we only use four connections.

24:03.090 --> 24:07.670
The 12V, the ground, the CAN high and CAN low connection.

24:07.910 --> 24:18.690
The CAN high and CAN low connection is directly transferred via this PCB to the lower CAN head, which converts this message.

24:19.050 --> 24:24.710
But the more interesting part of this PCB is the 12V, 5V DC-DC conversion.

24:24.710 --> 24:33.970
So we can very conveniently connect this dongle to our car without the requirement for a power bank and power supply of the Raspberry Pi.

24:34.430 --> 24:42.150
As a short disclaimer, we are no electrical engineers, so if you have any recommendation about this, feel free to contact us.

24:42.150 --> 24:45.550
We are quite happy about recommendations.

24:45.570 --> 24:53.510
This circuit for 12V, 5V DC-DC conversion is just taken out of the datasheet of the used IC.

24:54.870 --> 24:58.850
Feel free to come offstage to us and discuss it with me.

25:01.990 --> 25:07.110
We have also added the possibility to add status LEDs, but that's to be done.

25:09.370 --> 25:17.490
They are connected to the GPIO pins of the Raspberry Pi, so if you want to extend the project, you can use them for your own purpose.

25:18.350 --> 25:20.030
So, we have the hardware.

25:20.570 --> 25:22.150
Now, the software.

25:23.110 --> 25:27.970
I'm just going very briefly over the software architecture of our tool.

25:27.970 --> 25:34.310
So, if you want to use it in the Bluetooth mode, as a Bluetooth controller, there's an install script for that.

25:34.310 --> 25:42.010
You just run it on your pre-imaged Raspberry Pi and it will set up everything which is required.

25:42.670 --> 25:45.810
If you don't want to do it, then just run it on your own laptop.

25:45.810 --> 25:48.130
There's a run script for Linux.

25:48.130 --> 25:51.370
For Windows, you just directly run the Python protocol.

25:52.910 --> 26:06.190
The run script actually will also set up some interfaces and stuff, but you can do this beforehand if you do not want to execute it with pseudo-privileges, because that's required for interface management.

26:06.810 --> 26:25.530
Then, for emulating the game controller, for the Bluetooth version, we used the HitPi project to emulate a Bluetooth device, and if you run it on your own laptop, we used the VGamePad library, which is also cross-platform, so it also runs on Windows.

26:27.330 --> 26:29.590
You can also use that.

26:29.830 --> 26:41.110
For the Bluetooth one, it doesn't really work on Windows so far, so if you have any recommendations on that, and are an expert on Hit devices, also pull requests are welcome.

26:42.730 --> 26:49.390
So, now to our actual domain components.

26:49.390 --> 26:50.570
We have a car detector.

26:50.570 --> 27:02.150
If you have multiple vehicles, as we have the ID3 and the Tesla, you can give it basically a list of CAN IDs, and it will figure out which car it is, and then use the according configuration.

27:02.470 --> 27:14.750
The heart of our project is the car connector, which will convert all the CAN signals in the messages to triggers for the Xbox emulation.

27:15.290 --> 27:21.330
And then there is the vehicle configuration, which has all the vehicle-specific stuff in there.

27:21.330 --> 27:25.150
And I'll just have a more detailed look on that.

27:28.490 --> 27:32.110
You can configure a name for your vehicle to reference it.

27:32.510 --> 27:37.590
Then you have to specify which operation mode, if you want to use the internal mode or the UDS mode.

27:37.590 --> 27:47.890
Sometimes, if you have an older car, where there is no gateway in between the internal buses and the OBD2 connector, you can also use the internal mode for that.

27:48.390 --> 27:54.790
Or if you install the OBD2 adapter for the Tesla.

27:56.350 --> 28:05.470
Otherwise, for the UDS mode, you will also have what you can see on the right side, and you will have to send those polling messages I talked about earlier.

28:05.470 --> 28:11.390
Basically, you can just paste them in here, and it will periodically send them to get the data.

28:11.390 --> 28:13.870
There is also an update interval.

28:14.510 --> 28:19.250
Usually, we have a higher interval for the steering angle and brakes.

28:19.250 --> 28:25.430
And for the buttons, we use a lower update interval, because there is a limit how fast the ECUs will respond.

28:26.170 --> 28:27.310
Also, we have some...

28:27.310 --> 28:30.430
You can see the auto-detect IDs I mentioned before.

28:30.430 --> 28:34.730
And also, we have some high-level configuration stuff.

28:34.730 --> 28:45.290
For example, we limit the steering, because if you play a racing game, and you have to two times turn the wheel for the maximum steering, it's just too slow, right?

28:45.630 --> 28:57.490
And also, there is the steering dead zone, which basically, you have a bit more space to set your steering wheel to zero.

28:57.490 --> 29:10.310
Because otherwise, if it's like 0.01 degrees, and it will always go left in the menus, or you just cannot drive straight, it's actually pretty hard to get your steering wheel to exactly zero degrees.

29:10.510 --> 29:12.070
So, that's pretty handy.

29:12.990 --> 29:17.210
I'll go a bit into detail on the signal configuration later.

29:17.870 --> 29:22.550
But for now, let's look at how it works out.

29:22.550 --> 29:24.230
Yeah, we are ready to play.

29:24.230 --> 29:29.930
Unfortunately, we are not allowed to bring our car with us, so we have brought some videos of the gaming experience.

29:29.930 --> 29:35.850
You can see me here driving with first-person view, playing SuperTux Kart.

29:39.740 --> 29:45.700
You can see I control the racing car with the steering wheel, left and right.

29:45.700 --> 29:50.740
And now I've paused, because you can see I put my foot on the brake.

29:50.880 --> 29:52.860
Let's see what happens next.

29:55.290 --> 30:01.270
As expected, the racing car slows down, and I was overtaken.

30:02.450 --> 30:09.690
Now, you can see I've started the indicator.

30:09.710 --> 30:15.590
We've mapped the indicator function for left to throwing items in this game.

30:15.590 --> 30:20.130
You can do this for your own purpose, for your own game, but we've mapped it like this.

30:20.450 --> 30:31.010
So you can see here, I'm throwing this exploding muffin to the racing car in front of me, so it will explode.

30:31.010 --> 30:53.130
Unfortunately, because PowerPoint is a little bit annoying, sometimes, usually you should see that I've turned on the full beam flash, full beam 2, so we've mapped the full beam trigger to the nitro activation in the game.

30:53.590 --> 30:58.710
So it's very cool, driving in the night, igniting, and the car speeds up.

30:59.930 --> 31:01.050
See what happens?

31:01.050 --> 31:04.410
You can see the nitrogen.

31:04.490 --> 31:26.110
Now, you can see it's a little bit difficult to drive, especially with just one hand, but it is possible to race, it is possible to overtake enemies in this game, and it is also possible for you to get the right items, in this example, an acceleration one,

31:26.110 --> 31:28.270
to win racing games.

31:33.120 --> 31:35.300
And it's actually a lot of fun.

31:36.000 --> 31:38.860
You see, we're very excited about this.

31:40.580 --> 31:43.880
So, maybe, over to Tim.

31:43.880 --> 31:52.420
So, the question all of you probably have in your mind, how do you support your own car to use this?

31:52.420 --> 32:00.580
Well, before you get started on that, just make sure you keep in mind the safety.

32:00.640 --> 32:04.180
So, make sure you cannot accidentally drive into a wall.

32:04.180 --> 32:04.580
Why?

32:04.920 --> 32:14.720
Because if you're in your garage, and you're really into your game, and by accident you switch to drive mode, you don't want to do that.

32:15.500 --> 32:18.660
You're probably out on the gas, right?

32:18.660 --> 32:21.320
So, make sure you cannot do that.

32:21.320 --> 32:34.720
Of course, there's less of a problem on combustion engine vehicles, where you do not have to turn on the engine, but then make sure not to drain your 12-volt battery, like playing all night.

32:36.020 --> 32:41.160
It's probably not good if you do not have a charger connected.

32:42.120 --> 32:43.700
So, what do you need?

32:43.700 --> 32:46.060
I think we talked about everything of that.

32:47.040 --> 32:56.820
You can also use just an OBD2 open-ended cable, if you do not want to solder your own OBD2 head.

32:57.220 --> 33:01.100
So, that all should be less than 50 bucks, I think, to get started.

33:01.560 --> 33:10.020
If you use the diagnostic mode, and you have to get a diagnostic tester to reverse-engineer that, that really depends on the car, probably.

33:10.020 --> 33:17.100
There are sometimes some very cheap ones, and if you have to get a garage-level one, it's pretty expensive.

33:17.100 --> 33:20.580
So , yeah, probably too much.

33:21.060 --> 33:24.140
Okay, and then you can start reverse-engineering.

33:24.260 --> 33:27.540
So, here you can see the UDS tester setup, basically.

33:28.540 --> 33:32.080
The actuator, we are looking at a steering wheel angle, as before.

33:32.440 --> 33:38.880
Here we have a tablet with the diagnostic tool, which reads out the steering angle.

33:38.880 --> 33:47.620
And here we have my laptop, which runs CanSniffer, which is a very convenient tool to show you the differences in car messages.

33:48.120 --> 33:54.420
And what we'll do next is turn the steering wheel to see where the information is.

33:55.300 --> 34:07.300
And actually, I turn it one time completely to the left, and one time to the right to get the min and maximum value, which is possible for the signal, but you have seen where it is located.

34:08.720 --> 34:19.520
And, yeah, sometimes you're lucky, and you will find already complete CAN database files, those called DBC files, online for your car.

34:19.520 --> 34:24.680
Then you can also try to get this information out of there and use that.

34:24.680 --> 34:34.040
But otherwise, reverse-engineering of this data is quite good because it's like you can easily turn the steering wheel to see where the data is, right?

34:34.040 --> 34:39.220
It's just if there are 3,000 messages, it might take you some time to find the right one.

34:39.220 --> 34:49.280
Then for configuring it, you basically add all this information, the CAN ID, the position in the signal, and the length of the data.

34:49.460 --> 34:52.080
And then that's why we use Python for the configuration.

34:52.080 --> 34:58.000
You can just use a function to specify the signal mapping.

34:58.220 --> 35:11.180
In this case, we have the first byte turning to the left, the second to the right, and then we specify the min and maximum value and map this to a range of minus 1.0 to 1.0.

35:12.800 --> 35:18.360
All right, that's what you need to configure for your own car.

35:19.420 --> 35:29.760
In conclusion of this talk, if anybody asks you, especially our professor, now you definitely know that V2G stands for Vehicle-to-Game.

35:31.580 --> 35:34.320
Car hacking can be really fun.

35:34.320 --> 35:47.240
And I think our project is a great entry point if you want to get into that or just want to be able to say that you have a very expensive game controller at home.

35:48.240 --> 35:50.680
Always be careful if you do that stuff.

35:50.680 --> 35:52.380
Do not drive into walls.

35:53.520 --> 35:59.420
We actually use it, as Janis said before, as a demonstrator to motivate students to show it to visitors.

35:59.420 --> 36:06.080
It's always a good icebreaker to get started about talking about automotive security.

36:06.620 --> 36:11.680
And so the only question that remains is, what are you going to use it for?

36:18.810 --> 36:20.690
Feel free to contact us.

36:20.690 --> 36:23.190
Do any contributions to our project.

36:23.190 --> 36:24.070
Write us an email.

36:24.070 --> 36:25.770
Here you can see the QR code.

36:25.770 --> 36:32.850
The Git repository is public, so you can make an issue or do a pull request.

36:32.850 --> 36:33.770
Feel free.

36:33.870 --> 36:37.050
We're happy if we can keep in contact with you.

36:38.610 --> 36:42.890
And I think we have eight minutes left for questions, if there are any.

36:42.890 --> 36:46.730
Otherwise, we can also take further questions offstage.

36:50.520 --> 36:55.020
Have you thought about playing with heads-up display?

36:55.020 --> 36:56.700
You know, you can get these things now.

36:56.700 --> 37:05.700
You just put it on the dash and it'll actually just reflect your iPad or anything up onto the windscreen.

37:05.700 --> 37:09.280
And it looks like a heads-up display kind of a thing.

37:09.280 --> 37:10.520
Have you thought about that?

37:10.520 --> 37:15.960
Just for a way to project onto the screen.

37:17.520 --> 37:18.760
Where's the question?

37:18.760 --> 37:27.720
Oh yeah, so the question was if we have thought about projecting the game, basically, onto the screen of the car.

37:27.720 --> 37:29.640
So we've thought about that.

37:29.640 --> 37:30.680
We haven't done it.

37:30.680 --> 37:34.620
We also thought about it because the ID3 actually has a heads-up display.

37:36.540 --> 37:42.860
Yeah, so I think there are adapters to the protocol they use there.

37:42.860 --> 37:48.040
And then you can use it as an HDMI interface, basically, if you plug in there.

37:48.040 --> 37:50.660
So we have some plans, maybe, for the future.

37:50.660 --> 37:54.400
But we actually haven't done that or tested it.

37:54.400 --> 38:01.200
Just putting a projector in the back of the car is probably quite good.

38:01.200 --> 38:03.120
It's not a security-related problem.

38:03.120 --> 38:07.200
It's just throwing money on it via such a converter.

38:07.240 --> 38:11.100
And then you can easily connect your laptop with those internal screens of the car.

38:11.100 --> 38:13.900
That's expensive but easily doable.

38:15.900 --> 38:19.680
Yeah, but come up with your own setup.

38:19.680 --> 38:22.600
I think there's a lot of possibility, right?

38:23.140 --> 38:24.100
Yeah.

38:27.050 --> 38:32.210
The question was how if we build up a flight simulator out of this.

38:32.210 --> 38:35.590
If you have a real airplane, maybe you can transfer this.

38:37.030 --> 38:38.010
I don't know.

38:38.010 --> 38:40.270
Maybe you can use also your car for this.

38:40.270 --> 38:41.330
It should be possible.

38:41.330 --> 38:43.390
It's just an Xbox controller.

38:43.810 --> 38:46.290
You can map it to anything you want.

38:48.250 --> 38:49.990
Okay, any further questions?

38:49.990 --> 38:50.610
No?

38:50.610 --> 38:51.070
No.

38:51.070 --> 38:51.850
Alright.

38:51.950 --> 38:53.730
Okay, thank you.

38:53.730 --> 38:55.750
Thanks for listening and have a nice day.

38:55.750 --> 38:57.070
Enjoy the last day of DEF CON.

