WEBVTT

00:00.000 --> 00:01.520
So we will get started.

00:01.520 --> 00:03.260
I think now is as good a time as any.

00:03.440 --> 00:08.900
Again, thank you for coming, spending your time, your DEF CON precious time with me.

00:08.900 --> 00:11.240
This is the car hackers version.

00:11.400 --> 00:15.240
So the main stage talk had a lot of background information.

00:16.040 --> 00:22.040
Today's information, I just assume that you know a little bit about hacking cars and we're just going to go.

00:22.440 --> 00:31.960
So first up, and definitely not least, is almost everything that we've done here is only possible by standing on the shoulders of giants.

00:31.960 --> 00:33.580
That's how we see so far.

00:33.580 --> 00:35.720
We have lots of people that help us.

00:35.720 --> 00:37.140
Many are named on screen.

00:37.140 --> 00:42.720
There's many that are not named that write open-source software and contribute to open-source software and fix bugs, etc.

00:42.820 --> 00:51.000
All of this is only really possible because we all work together in that regard and we can stand so tall.

00:51.000 --> 00:53.360
So thank you to everybody on the slide and not.

00:54.660 --> 00:58.640
So we found some SeedKeyExchange and this is a car hacking talk.

00:58.640 --> 01:01.360
So if you know a little bit of car hacking, you're probably thinking, so what?

01:01.360 --> 01:02.360
You found SeedKeyExchange.

01:02.360 --> 01:06.100
I see that every day and we all know what SeedKeyExchange is, right?

01:06.100 --> 01:11.440
This is the authorization mechanism that protects diagnostic functions on cars.

01:11.580 --> 01:18.480
You find it in UDS, which is in CAN, but UDS is also now an automotive Ethernet in the form of DOIP.

01:18.480 --> 01:25.820
You also find SeedKeyExchange in the precursor to UDS known as KWP-2000, Keyword Protocol 2000.

01:25.880 --> 01:33.540
And SeedKeyExchange even existed in J1587, which was on J1708, which was a very old serial bus on trucks.

01:33.560 --> 01:36.900
So SeedKeyExchange in some form has been around for a long ass time.

01:36.900 --> 01:39.040
This is what it looks like on CAN.

01:40.280 --> 01:45.460
So because this is on CAN, the first layer is ISOTP, the ISO transport layer.

01:45.460 --> 01:46.660
That's what these first bytes are.

01:46.660 --> 01:50.980
It's telling you there's a 2-byte message here, 4-byte message, 4-byte message, 2-byte message.

01:50.980 --> 01:52.680
Then we have the service identifier.

01:53.140 --> 01:56.200
The security service for SeedKeyExchange is 27.

01:56.200 --> 01:57.460
So here's your 27.

01:57.620 --> 02:01.520
The next one, because we're dealing with UDS, is saying positive confirmation.

02:01.520 --> 02:04.940
That's plus 40 hex, 67, 27.

02:04.940 --> 02:05.720
This is an error.

02:05.720 --> 02:06.980
That should say 67.

02:07.560 --> 02:09.480
And then we have the subservice.

02:09.480 --> 02:11.760
This is give me a seed right here.

02:11.760 --> 02:14.340
And in the request, it gives you back the seed.

02:14.340 --> 02:20.220
Then the diagnostic software, or potentially the attacker, says here's the matching key.

02:20.900 --> 02:25.920
And then if those match, if the ECU sees a match, you're good, you unlock.

02:25.920 --> 02:27.400
There's no session control here, right?

02:27.400 --> 02:33.380
When the ECU is unlocked for this diagnostic software, it's unlocked for everything else on that CAN bus.

02:33.380 --> 02:40.580
And because this is a CAN bus, there is no integrity or confidentiality protection here on this bus.

02:40.580 --> 02:43.820
So an attacker that has access to the bus can actually see these messages as well.

02:44.340 --> 02:50.720
Which is what we all do when we're assessing our security, our diagnostic software security, right?

02:50.720 --> 02:51.820
I had this log.

02:51.820 --> 02:58.220
So here's a traffic capture of some data on J1708, or at least that's what the log says.

02:58.420 --> 03:05.880
And we were running the diagnostic session, the diagnostic tool, pushing buttons in the diagnostic tool and capturing this traffic.

03:05.880 --> 03:08.300
And we said, well, what's going on right here?

03:08.360 --> 03:11.660
27, 67, 27, 67.

03:11.660 --> 03:14.780
Is that seed key exchange on J1708?

03:15.360 --> 03:17.760
Because that really looks like service 27.

03:18.120 --> 03:25.140
And that means it's probably UDS in J1708, which UDS is very new and J1708 is very old.

03:25.140 --> 03:27.640
This wasn't J1708 though.

03:27.640 --> 03:29.160
This was Powerline.

03:29.160 --> 03:36.100
We were doing diagnostic tools for a trailer brake unit on the Powerline network, which I'll talk about a little bit.

03:36.100 --> 03:38.000
It turned out it wasn't UDS.

03:38.000 --> 03:47.080
It was an older form of a diagnostic system called KWP2000, which is very similar, but some of the service numbers don't line up.

03:47.200 --> 03:49.200
And then, yeah, there's ISOTP there.

03:49.200 --> 03:58.940
And then these things here, ACFE89, 89FEAC, these are what are called data link escapes in J1708.

03:58.940 --> 04:02.600
And they are the proprietary space on that bus.

04:02.600 --> 04:12.060
So what we found here was seed key exchange in UDS on a bus that is really much newer, much older than that.

04:12.060 --> 04:15.260
We had a really new technology on a really old bus, and it's really weird.

04:15.260 --> 04:18.780
And of course, we found it in a trailer brake controller.

04:18.780 --> 04:23.500
The same one that you see hidden behind mud right here.

04:24.640 --> 04:30.840
And Powerline networks are what connect trailers, these things in the picture, to the tractors that tow them.

04:30.840 --> 04:34.520
For everything in North America since 2001.

04:35.580 --> 04:46.520
So we were looking at the diagnostic logs, and one of the things that you should do when you're analyzing diagnostic traffic logs is categorize all the different services that you see.

04:46.640 --> 04:52.240
So initially, we had categorized these as UDS services, but UDS services don't line up perfectly to KWP.

04:52.240 --> 05:01.600
So if you find yourself in a situation where there's a lot of 18, for example, then you should convert your service tables to KWP 2000, which we did here.

05:01.680 --> 05:10.140
And it's useful to count how many times you see the thing and also to count separately service requests that have different parameter lengths.

05:10.220 --> 05:16.320
We all know that when you're looking at diagnostic software, it relies very heavily on routine control, right?

05:16.320 --> 05:17.420
Hex 31.

05:17.760 --> 05:20.180
But the routine controls are always kind of proprietary.

05:20.180 --> 05:23.320
You send some data into routine control and something happens.

05:23.320 --> 05:27.340
It's not like it's documented what the extra data is in routine control.

05:27.340 --> 05:30.460
Very useful to say, okay, that was a three-byte routine control.

05:30.460 --> 05:31.920
That was a five-byte routine control.

05:31.920 --> 05:34.480
These are obviously somehow different.

05:34.940 --> 05:39.380
You can see that there is a heavy reliance on routine control, which shouldn't surprise you.

05:39.400 --> 05:48.000
We only really repeated the operation a few times, a handful of times, and yet there's like 20 security access calls.

05:48.200 --> 05:52.640
So this software is doing a whole bunch of spurious C key exchanges.

05:53.040 --> 06:05.280
And right off the bat, that has an impact because an attacker, as we're going to talk about in a little bit, an attacker with a whole bunch of collection of C key pairs can sometimes start to reverse engineer what that C key routine is.

06:05.440 --> 06:12.620
And it's not a great idea to like just spuriously send C key requests when you don't need to because you're giving more information about that routine.

06:12.660 --> 06:18.580
But yeah, this is the kind of first step that we would take when we're looking at assessing diagnostic software logs.

06:18.720 --> 06:20.160
Yeah, I can do questions in the middle.

06:20.160 --> 06:20.800
What's up?

06:24.440 --> 06:25.320
Yeah.

06:27.240 --> 06:35.640
Well, so at this point, we only really had this J1708 log and we knew that there was the stack.

06:35.640 --> 06:38.880
So we knew there was like UDS data in here.

06:38.880 --> 06:46.080
To get to this point, we made a fake CAN driver that I'll tell you about in a little bit.

06:47.480 --> 06:52.900
So of course, what I love to do when I'm messing with trailers is a chuff test.

06:53.560 --> 06:55.300
Hopefully you can hear that.

06:55.300 --> 06:56.680
No, the audio did not work.

06:56.680 --> 06:57.420
I apologize.

06:57.420 --> 06:59.040
It is chuffing right now.

06:59.400 --> 07:02.740
I swear I have my volume up and they said it would work, but you'll hear...

07:04.600 --> 07:08.740
And this is actually a wireless test that we did on this tanker.

07:08.740 --> 07:14.660
So we are sending a request to reset the ECU and it is chuffing its brakes in response.

07:14.660 --> 07:23.180
Every time I get on a brake controller for trucks, I always start with the chuff test because chuff tests are demonstrable air control.

07:23.180 --> 07:27.060
So you're able to remove or control the air pressure in the pneumatic brake system.

07:27.060 --> 07:29.320
So there's an obvious cyber-physical impact.

07:29.320 --> 07:31.580
It's also really audible, right?

07:31.660 --> 07:42.880
So I can tell immediately when I'm spamming things, if I'm wireless or if I'm connected, I can tell if the command was received because I can hear that it was received and I don't need to worry about parsing response messages.

07:42.880 --> 07:45.520
So it's a very great stand-in.

07:45.580 --> 07:48.640
It is only abuse of commands, right?

07:48.640 --> 07:54.460
And abuse being taking the software and making it do what they wrote the software to do.

07:54.580 --> 08:07.480
Not exploiting the microprocessor, not doing buffer overflows and putting in a payload, just taking the software that they wrote, asking it to kindly do what the software was intended to do, but I'm an attacker and I'm using it for a purpose they didn't intend,

08:07.480 --> 08:07.960
right?

08:07.960 --> 08:10.800
No one intended me to wirelessly chuff the brakes.

08:11.000 --> 08:12.940
So it is just abuse.

08:13.100 --> 08:24.380
None of this research talks about exploitation, but we are talking about software code bases that are very old and were possibly not written with any kind of adversarial inputs in mind.

08:24.480 --> 08:28.360
That entire space is unexplored somewhat intentionally.

08:28.360 --> 08:40.320
We're not interested in dropping ODE for RCE on trailers, but we hope that suppliers are interested in that and are being very careful about the software that they're developing and deploying.

08:40.320 --> 08:41.560
That's our hope.

08:41.580 --> 08:44.360
So yeah, just to underscore, this is abuse and not exploitation.

08:46.320 --> 08:48.260
So back to SeedKey Exchange.

08:48.820 --> 08:50.720
We're all car hackers here, right?

08:51.260 --> 08:56.000
Whenever we're getting to a diagnostic system, we want to assess the security of our SeedKey Exchange.

08:56.000 --> 08:57.960
There's a whole bunch of different ways to break it.

08:57.980 --> 09:00.920
I'm a big fan of attack trees as well as flags.

09:01.000 --> 09:04.660
This is an attack tree that I created a while ago for a training at Cybertruck.

09:04.660 --> 09:06.700
I see a few Cybertruck students in the audience.

09:06.700 --> 09:07.580
Thank you for coming.

09:08.960 --> 09:12.040
There's a lot of different ways to break this depending on what you have access to.

09:12.040 --> 09:19.360
If you have diagnostic software, you can actually extract a lookup table just by repeating requests through the diagnostic software.

09:19.360 --> 09:24.820
You can obviously go into the diagnostic software and reverse engineer the routine that has to be in there if it's not protected.

09:24.820 --> 09:28.420
If you have ECU firmware, reverse engineering is also possible.

09:28.680 --> 09:36.840
If you have a capture of the SeedKey Exchanges, which remember, this particular diagnostic software does about, you know, three or four per operation.

09:36.840 --> 09:38.400
So we get a lot of captures.

09:38.540 --> 09:42.020
You can either figure out the formula.

09:42.020 --> 09:43.520
That's this green one.

09:43.520 --> 09:49.860
Or you can just retry until the seed that you've recorded shows up again.

09:50.400 --> 09:56.060
So let's just go back quickly to SeedKey Exchange so I can drive that home.

09:56.060 --> 09:57.880
This is a challenge response protocol.

09:59.100 --> 10:11.120
These seeds that come out should be, if this was a cryptographically secure challenge response protocol, the seeds would be nonces, which is a cryptographic term for a number used once.

10:11.660 --> 10:19.600
If I have a whole bunch of captures of these things and the same seed comes out, that means the exact same key will be calculated.

10:19.800 --> 10:26.900
So if I record a seed and a key, anytime I see that seed again, I can just reuse that key and I win as an attacker.

10:26.960 --> 10:27.320
Right?

10:27.480 --> 10:35.780
So when we're trying to break this thing, if we have a whole bunch of captures of pairs, when we see a repeated seed, we can stop.

10:35.780 --> 10:37.340
That's what this retry is about.

10:37.340 --> 10:41.900
Just keep retrying until you see the seed you already know and then send the key that matches.

10:42.200 --> 10:46.680
So there's a whole bunch of different ways to do retry until you win.

10:46.680 --> 10:49.220
One of them is known as the reset attack.

10:49.540 --> 10:58.660
And Sekhar Kulandvel and his other authors put together a great paper called Candid about two years ago, specifically about how to do this on CAN bus.

10:59.280 --> 11:01.900
Okay, and we'll talk about a tool that does it as well.

11:02.580 --> 11:05.520
But of course, there's other ways to do the retry.

11:05.600 --> 11:16.560
And if you're facing a diagnostic system that you want to assess the security of, there's other things you should try, too, to make sure that this seed key routine is actually secure.

11:16.860 --> 11:19.660
To begin with, try to get multiple seeds.

11:19.660 --> 11:25.100
Can I just keep requesting seeds without changing diagnostic session, without sending a key?

11:25.100 --> 11:28.820
Will it just let me brute force until I get the seed I want?

11:29.240 --> 11:35.660
Sometimes ECUs aren't written correctly, and they let you get one seed and try a key, try different keys multiple times.

11:35.660 --> 11:37.380
That is a weakness that has happened.

11:37.440 --> 11:44.120
There's also been a very specific weakness, where you could ask for a seed, send a key.

11:44.120 --> 11:49.020
If it said no, you could just change diagnostic session control level, and then try a different key.

11:49.020 --> 11:54.460
So there was a side effect in the DSC processor, where it would reset the try count.

11:54.680 --> 11:58.100
So it's these kind of things where we're trying to test these systems.

11:58.300 --> 12:01.040
And as testers, we should always assume, how could this go wrong?

12:01.300 --> 12:05.060
And then cook up a test based on that assumption of how it could go wrong.

12:05.060 --> 12:08.220
And one of them here is this time dependence.

12:08.820 --> 12:12.840
So many of you in the audience have probably used Caring Caribou, right?

12:12.840 --> 12:17.360
It's a pretty powerful tool that will run on any socket can system.

12:17.940 --> 12:25.840
Caring Caribou actually has modules for assessing the time dependence of seeds that are emitted.

12:25.840 --> 12:30.840
So it'll send a reset request, it'll wait for a delay, and then it'll send a seed request.

12:30.840 --> 12:32.260
And it does this repeatedly.

12:32.420 --> 12:36.340
And if it sees a repeated seed, it says, all right, you won.

12:36.340 --> 12:36.860
You're good.

12:36.860 --> 12:37.900
There's a vulnerability here.

12:38.220 --> 12:43.740
But if it doesn't say anything, then obviously we've tested the ECU and everything is fine, right?

12:43.740 --> 12:48.660
We ran Caring Caribou, we asked, hey, are there any time dependent seeds?

12:48.660 --> 12:50.300
And Caring Caribou said, no, you're good.

12:50.500 --> 12:52.260
Just move on, right?

12:52.600 --> 12:57.060
The problem is, there's timing slop, right?

12:57.060 --> 13:03.080
Caring Caribou sent a reset, did a little bit of a wait, and then asked for a seed.

13:03.300 --> 13:14.600
And if we're really going to be sure about whether the seeds are time dependent, we need to make sure that the time between the processing of the reset request and the processing of the seed request is very deterministic.

13:14.600 --> 13:15.920
There's no jitter in there.

13:16.000 --> 13:22.080
If there's any slop in there, and it is a time dependent seed, the time dependence will change the value of the seed.

13:22.080 --> 13:24.180
So, of course, you won't see a repeated seed.

13:24.220 --> 13:26.600
And that's why it has this iterations value.

13:26.860 --> 13:34.080
Caring Caribou has a decent default, but that default is obviously tuned for the developer's laptop and whatever they were running and all that kind of thing, right?

13:34.080 --> 13:35.620
Because this is just Python code.

13:35.620 --> 13:41.540
And under the hood, it's just running sleep in between reset and the seed request.

13:41.740 --> 13:47.220
Now, this is how we tested for time dependence the very first time on the trailer break controller.

13:47.220 --> 13:53.660
This is using a bash script and a Python script that we use to send messages and a Python sleep.

13:53.860 --> 14:02.460
And sometimes, really, what Caring Caribou is doing and what this much worse version is doing is good enough for you to look at the seeds and say, yeah, actually, there is some time dependence here.

14:02.460 --> 14:04.900
Like, I can see it in the repeated values.

14:04.900 --> 14:07.980
Do this 100 times, and you'll see some repetition.

14:07.980 --> 14:11.560
So even with Caring Caribou, we'll say yes or no.

14:11.600 --> 14:15.320
This method where you look at the plot will give you a better judgment.

14:15.320 --> 14:16.580
But look at the output.

14:16.580 --> 14:17.680
Let your eyes judge.

14:17.680 --> 14:22.740
When we did this, we almost immediately had the gut feeling that, yes, there was a time-dependent seed here.

14:23.700 --> 14:26.740
Now, I mentioned this to you, and we'll talk about it in some detail.

14:26.740 --> 14:35.680
I made a fake Python can driver, which ultimately actually let me script Scapy Automotive into the trailer brake controller.

14:35.680 --> 14:39.300
So this actually was interfacing with Powerline networks.

14:39.640 --> 14:40.820
And it's Scapy Automotive.

14:40.820 --> 14:43.600
And this was the version that, you know, runs as well.

14:43.600 --> 14:44.500
It's a little bit better.

14:44.500 --> 14:46.700
And this looks very much like Caring Caribou.

14:46.860 --> 14:49.440
But this one here, the sleep is still kind of...

14:49.440 --> 14:50.300
there's too much slop.

14:50.300 --> 14:52.720
There's too much potential jitter here.

14:53.180 --> 15:03.460
And on can, so Sekhar Kulenvel and his other authors did publish ways to take care of the timing, very, very small timings down at the can level.

15:03.460 --> 15:06.760
But you have to remember, there's a lot of slop happening, not just in this sleep.

15:06.800 --> 15:09.020
There's slop happening every time you do ascent.

15:09.020 --> 15:10.420
Because there's buffers.

15:10.420 --> 15:15.480
There's buffers in between your Python code and the actual bus.

15:15.480 --> 15:18.080
There's a FIFO in the can controller.

15:18.080 --> 15:22.880
There's probably another FIFO in the driver for the can controller.

15:22.880 --> 15:27.980
If you're crossing the user space to kernel space boundary, there's another copy that happens there.

15:27.980 --> 15:29.460
There's all kinds of these buffers.

15:29.460 --> 15:32.120
Each one of them can introduce timing slop.

15:32.440 --> 15:36.920
So there are ways with can bit banging, in particular, to bypass a lot of that.

15:36.920 --> 15:43.660
And you just put the data you want down in a very small microcontroller, like a Pi, and then you let the can bit banging routine take care of that.

15:43.880 --> 15:51.580
And Sekhar Kulenvel in the Candid paper also has some great ways that should take care of the lower level issues, but not all of the buffers.

15:51.580 --> 15:55.760
For us, we were using J2497, which is the powerline bus.

15:56.040 --> 16:00.500
The powerline bus communicates in radio frequency range.

16:00.920 --> 16:03.020
So we were using SDRs.

16:03.280 --> 16:23.260
And the really interesting kind of thing that happened here is because we were testing J2497 and we already had a way to do transmit with SDRs, we could just fill a DAC, which is all this transmit SDR is, with all the samples we wanted and just stream the samples out in a giant buffer with a very reliable clock source on it.

16:23.260 --> 16:26.760
And we just eliminated all of these sources of jitter.

16:26.760 --> 16:33.580
So normally when you're testing powerline, you have a vehicle diagnostic adapter, which is like an embedded system that has a buffer in it.

16:33.580 --> 16:38.760
And it connects over USB and there's a USB driver and that USB driver has buffers in it.

16:38.760 --> 16:42.840
And then your software in Windows has buffers and it's buffers all the way down introducing jitter.

16:43.840 --> 16:50.180
But our transmit method was just straight out through an SDR and we just cut all of that jitter out.

16:50.180 --> 16:58.240
So we were able to upgrade that Python-based test to a SDR-based test, and we were confirming ultimately that, yeah, these seeds are very predictable.

16:58.240 --> 16:59.580
And we'll talk about that too.

17:00.240 --> 17:02.860
But, you know, we'll step back a little bit.

17:03.620 --> 17:05.460
We've all tested some ECUs.

17:05.800 --> 17:08.060
You have a seed, so what, right?

17:08.060 --> 17:09.980
Like a seed is not a key.

17:10.900 --> 17:13.720
That's the limitation of the reset attack, right?

17:13.720 --> 17:20.280
The reset attack lets you control the seed, but you still ultimately do need a key to match it to unlock the ECU.

17:20.280 --> 17:21.820
So how are you going to do that?

17:23.660 --> 17:29.340
I mean, one of the ways is if you're lucky, you see a seed you know, right?

17:29.340 --> 17:30.680
We have all these captures.

17:31.140 --> 17:35.880
And once we see a repeated seed, like I mentioned, it'll be the same key and then you're good.

17:36.260 --> 17:40.760
Now, reverse engineering is also possible, as I mentioned in that attack tree, et cetera, et cetera.

17:41.360 --> 17:47.220
What we wanted to do was demonstrate that, you know, reverse engineering wouldn't be necessary here.

17:47.220 --> 17:51.380
Although ultimately, yes, reverse engineering of the software was also possible.

17:52.680 --> 17:59.220
And we made an auto hotkey script, which is like this thing you do to automate UI interactions.

18:00.320 --> 18:04.040
And it just kind of goes click, click, click, click, click.

18:04.040 --> 18:08.440
And I would love to show you a video, but the video is of the actual supplier's software.

18:08.440 --> 18:12.440
We're not really interested in, you know, supplier shaming here.

18:12.460 --> 18:15.340
So I just did this thing in a loop, in a loop, in a loop.

18:15.340 --> 18:18.080
And I was chatting with my friend Haystack.

18:19.060 --> 18:27.400
And he did this years ago, and he said, there is something very comforting about the fact that that technique still works, which I thought was funny.

18:27.400 --> 18:28.500
We had a chuckle about that.

18:28.500 --> 18:32.160
So we extracted about 200 of these seed key pairs.

18:34.400 --> 18:38.240
And that means that if we see the repetition, then we're good.

18:38.240 --> 18:39.920
We just kind of move on.

18:41.680 --> 18:44.520
Now that's useful in bench setups.

18:44.520 --> 18:48.820
And even if you look at Karen Caribou's documentation, they kind of discuss, like, there's a whole bunch of different ways to do it.

18:48.820 --> 18:52.180
Obviously, you can get a matching key some way.

18:52.320 --> 18:54.020
And if we're on a bench, yeah, this is fine.

18:54.020 --> 18:55.540
We'll just retry until we see a seed.

18:55.540 --> 19:01.900
It isn't a useful method for, like, a malicious actor that's going to do a remote payload, for example, right?

19:01.900 --> 19:08.800
If you're going to put a remote payload on a vehicle, you actually need to be able to fully calculate for any seed what the key is.

19:08.800 --> 19:15.400
You need to understand, like, what is this f of x here, right?

19:15.800 --> 19:18.180
And to do that, reverse engineering is possible.

19:18.180 --> 19:26.540
In this particular case, yeah, if you went to the supplier's diagnostic software and you looked at the DLLs, there'd be something roughly saying password, and then the function was right there.

19:26.540 --> 19:28.660
So it was easy to do that.

19:28.820 --> 19:40.160
But in the model where maybe the attacker doesn't even know what the target is or doesn't have access to the diagnostic software, what if they just saw these seed key pairs on the bus?

19:40.200 --> 19:51.720
Would they ever get enough information from just the seed key exchange, which is this is the 200 that we captured, from, like, this plot to tell themselves, oh, I know how to predict every key for that seed.

19:51.740 --> 19:56.760
So, like, as humans, we look at this and we might think it's uncorrelated, right?

19:56.760 --> 19:59.020
It doesn't look like anything in particular.

19:59.160 --> 20:05.800
But what you can do and what attackers could do is make an assumption that it is perhaps linear, right?

20:05.800 --> 20:11.620
And then set up a satisfiability solver and then test if it's linear, and then the computer will tell you if it isn't.

20:11.620 --> 20:15.940
In this particular case, yeah, this doesn't look linear, but it is linear.

20:15.940 --> 20:21.180
It's y equals mx plus b wrapped around by 16 bits, unfortunately.

20:21.620 --> 20:24.260
So attackers don't need many of these points to get the answer.

20:24.620 --> 20:26.520
You don't even have to stop at linear.

20:26.520 --> 20:29.800
You can always say, is it XOR and solve for XOR dragging.

20:29.800 --> 20:40.840
You can also do with something like Z3, is it right shift plus left shift plus, you know, XOR and put weighted coefficients on it and then ask Z3 what coefficients satisfy it.

20:40.840 --> 20:44.960
You can create an, like, arbitrary equation and just let the computer do the work for you.

20:44.960 --> 20:46.320
All of this is possible, right?

20:46.320 --> 20:56.300
So there isn't a whole lot of security given to you, particularly in the 16-bit space, when you're giving out these repeated, or you're giving out seeds and keys, unfortunately.

20:57.760 --> 20:59.540
Right, so where do we end up?

20:59.580 --> 21:01.400
We had the diagnostic software.

21:01.700 --> 21:02.460
Good.

21:02.640 --> 21:04.680
We were able to reverse engineer it.

21:04.680 --> 21:06.240
Yep, that was one of the things.

21:06.340 --> 21:12.380
We also had captures, and the captures were enough that we could solve for the constants.

21:12.620 --> 21:14.920
In a known equation, ultimately linear.

21:16.060 --> 21:19.020
And we could then retry until we saw the repeated one.

21:19.020 --> 21:21.000
We could have just stopped with the repeated one as well.

21:21.000 --> 21:22.660
All of this was possible.

21:23.020 --> 21:28.960
And attackers with more, you know, more resources could do other ways that you could think of it in this tree as well.

21:28.960 --> 21:31.480
So anyways, we unlocked this thing.

21:31.480 --> 21:32.440
That's great.

21:32.740 --> 21:38.420
Unlocking the controller means that you can do diagnostic actions, right?

21:38.420 --> 21:40.220
That's what we did.

21:40.220 --> 21:45.620
Um, we should test what services are available after we unlock.

21:45.620 --> 21:49.120
We should test the sub functions of those services.

21:49.120 --> 21:54.160
We should also see like that diagnostic seed key routine that we know now.

21:54.680 --> 21:57.900
Is it the same one for all the other levels in the ECU?

21:57.900 --> 22:01.300
Like ECUs have multiple diagnostic levels, multiple seed key routines.

22:01.300 --> 22:04.860
How powerful is this thing that they gave us in the diagnostic control?

22:04.920 --> 22:07.140
So we went through all of this.

22:07.140 --> 22:14.700
We cooked up this automotive SCAPI script that you see here, which tests whether keys can be retried.

22:14.700 --> 22:17.900
So you can test retry without knowing the seed.

22:17.900 --> 22:20.340
If you just assume that like the return codes are different.

22:20.380 --> 22:25.900
When you know the actual right seed, you can be 100% sure whether the return codes are not different or not.

22:25.900 --> 22:26.880
And here's an example.

22:26.880 --> 22:28.420
And of course, this will be on the media server.

22:28.420 --> 22:29.700
So you're welcome to use it.

22:29.800 --> 22:31.500
I'm a big fan of automotive SCAPI.

22:31.500 --> 22:32.640
It's very powerful.

22:33.180 --> 22:38.820
And there are some bugs, but I'm sure the bugs are going to get ironed out very rapidly because it's getting a lot of uptake.

22:39.440 --> 22:40.740
So yeah, SR1.

22:40.980 --> 22:41.940
This is SCAPI.

22:41.940 --> 22:49.840
I think one of the benefits of using automotive SCAPI today is automotive Ethernet is coming at us like very rapidly.

22:49.940 --> 22:54.980
And really all the tooling that we're going to spin up, like our own custom tooling, we don't publish everything, right?

22:54.980 --> 23:03.260
All of our custom tooling that we're going to write will immediately be portable to like DOIP and other automotive Ethernet based systems in the near future.

23:03.260 --> 23:06.320
So it'll save us that ramp up time as we change technologies.

23:06.320 --> 23:08.330
It'll just still be SCAPI.

23:09.920 --> 23:11.380
Yeah, so how we did this?

23:11.380 --> 23:13.920
Sorry, it took me a while to get to your question.

23:13.920 --> 23:16.350
We actually faked PythonCAN.

23:16.740 --> 23:30.560
So if we go all the way back to that log at the beginning, ACFE89 and 89FEAC are the J1708 data link escape bytes.

23:30.560 --> 23:32.500
And they're saying it's a unicast message.

23:32.500 --> 23:34.120
It's a point-to-point message.

23:34.120 --> 23:37.280
And because it's FE, it's like escaped from 1708.

23:37.280 --> 23:38.420
It's not processed.

23:38.420 --> 23:39.460
It's opaque.

23:39.640 --> 23:42.860
And then right after that, you can see it's isotp.

23:42.860 --> 23:46.460
O2, there's a transport marker, 10.

23:46.460 --> 23:48.400
There's a flow control, 30.

23:48.400 --> 23:50.440
So it's isotp right on the next layer.

23:50.440 --> 23:53.100
And then UDS after that.

23:53.300 --> 23:55.600
So we just lied that this was CAN.

23:55.600 --> 23:59.940
And one of the interesting things is that every single one of these was 7 bytes.

23:59.940 --> 24:04.480
Now, Powerline and J1708 can actually take 211 bytes.

24:04.480 --> 24:12.540
They had no reason to chunk this up this way, except possibly that they wanted to reuse, like they probably had some reuse of existing code.

24:12.540 --> 24:20.280
And inside the ECU, they're probably doing some version of the faking of the CAN bus that we did.

24:20.340 --> 24:30.900
So we have a fake CAN bus on my laptop communicating over Powerline into some kind of fake CAN adapter inside the ECU software, I like really weird software stacks, so that makes me happy.

24:30.900 --> 24:32.300
I hope it makes you happy, too.

24:32.660 --> 24:37.560
We have Python CAN connecting to RP1210, which is a very trucking-specific DLL.

24:38.460 --> 24:43.940
And then that RP1210 is opening J1587, which is a trucking-specific protocol.

24:43.940 --> 24:47.220
And then that's being converted in the adapter on J2487.

24:47.220 --> 24:51.840
So the stack just goes down and gets weirder and weirder, which I really like.

24:54.440 --> 24:57.320
And here's the driver code, roughly, for that fake Python CAN.

24:57.320 --> 24:58.160
It's actually pretty simple.

24:59.220 --> 25:02.940
It is very easy to write a fake or any Python CAN driver.

25:02.940 --> 25:18.120
So if you ever find yourself in a situation where, like, oh, I really wish I could connect SCAPI to this thing, or, you know, I wish I could put Karin Karibu on this particular diagnostic IP interface, or even as we start using, like, time-sensitive networking on automotive Ethernet,

25:18.120 --> 25:20.640
it's actually really easy to write a Python CAN driver.

25:20.640 --> 25:22.820
I did not delete much of the code here.

25:22.960 --> 25:26.440
And the entire code of this Python CAN driver is available in the white paper.

25:26.440 --> 25:33.120
If you ever find yourself in a situation where you want to fake some CAN, which I think is going to happen more and more in the future, I hope this is useful to you.

25:33.120 --> 25:42.040
But it's not really doing anything else other than receiving some bytes, putting something around it, and then when it's going to send some bytes, it strips some things off of it.

25:42.060 --> 25:42.860
And that's it.

25:42.860 --> 25:44.060
That's how we faked CAN.

25:44.940 --> 25:49.980
And it lets us do stuff like this, because SCAPI Automotive has a UDS scanner.

25:50.460 --> 25:56.120
And the UDS scanner code is capable of emulating the state space of the target ECU.

25:56.120 --> 26:04.440
It knows that certain UDS commands change the state of the ECU, and it models that state change of the ECU.

26:04.440 --> 26:08.040
And what we're looking at here is an adjacency matrix.

26:08.040 --> 26:11.780
It's like a directed graph of all the ways that the states can change.

26:11.780 --> 26:14.100
It's kind of like what you would look at for a finite state machine.

26:14.340 --> 26:22.240
So it's marked it up saying, hey, this is session 134, and the P1 means that it was sending test or present message at the same time.

26:22.540 --> 26:32.120
And then these edges are saying, I actually used DSC 135 to get there, but I could use DSC 134 for this edge.

26:32.260 --> 26:35.940
Now, this diagram, unfortunately, is unnecessarily complicated.

26:35.940 --> 26:40.060
If you look at the adjacency matrix version of this, it's just all connected.

26:40.060 --> 26:47.460
So this diagram looks very interesting, but it's ultimately telling you that every diagnostic session is reachable from every other diagnostic session.

26:47.460 --> 26:50.040
Sometimes when you look at ECUs, it's not fully connected.

26:50.040 --> 26:55.020
It's more like, oh, to get to this diagnostic session, you have to authenticate here first and then go to there.

26:55.020 --> 27:04.020
But ultimately, this was the first thing we generated out of it, which told us that actually, there are no limits to what diagnostic sessions you can navigate to, which is a useful test.

27:05.240 --> 27:07.700
And the code to do that is fairly straightforward.

27:07.700 --> 27:18.680
We're reusing a lot of amazing open source software, in this case by Nils Weiss and Enrico Pozzomone, who added automotive support into Scapi.

27:18.680 --> 27:24.080
And of course, the Scapi authors that are probably too many to name for the last 20 years, right?

27:24.080 --> 27:25.920
So it's a lot of reuse.

27:26.100 --> 27:29.300
And this code is nice and tight, and we get good outputs.

27:30.300 --> 27:34.480
You can also ask Scapi to enumerate security access levels.

27:34.480 --> 27:36.660
That's the SA enumerator here.

27:36.880 --> 27:40.040
And for those of you taking pictures, slides will be available.

27:40.040 --> 27:46.920
And also, the white paper, which there'll be a link to at the end, has all of this in copy and paste Python code.

27:46.920 --> 27:48.400
So you're welcome to copy and paste it.

27:48.400 --> 27:50.080
It's all MIT-licensed.

27:50.080 --> 27:52.020
So please, free to reuse.

27:52.360 --> 28:05.400
This security access enumerator not only tests what DSCs are available, when it enters a diagnostic session level and it knows it's changed state, it then asks, well, what SA levels are now available in that state as well?

28:05.400 --> 28:07.180
So now we have a two-dimensional map.

28:07.180 --> 28:11.920
And you can see in this table that 131, 130...

28:11.920 --> 28:13.560
I have to look at the screen, actually.

28:13.560 --> 28:21.240
134 and 135 were all diagnostic levels that had different security access levels.

28:21.240 --> 28:26.100
So these security access levels were relevant for this DSC, these levels for that DSC.

28:26.100 --> 28:35.680
And the NRs are because when I set this up in the scan range, I should have skipped the subservice IDs that are odd, that are reserved for sending back.

28:35.920 --> 28:39.080
I was asking for an invalid security level when I was doing this setup.

28:39.080 --> 28:42.440
So I should have actually done a skip in the scan range, and that's why you get NRs.

28:42.440 --> 28:48.400
But it tells us now, if we want to go to this security level, we have to first go to this DSC.

28:48.400 --> 28:50.860
And in this ECU, getting to the DSC is easy.

28:50.860 --> 28:54.480
We can get to any DSC from anywhere, but that's not always true in all ECUs.

28:55.880 --> 29:12.380
And then ultimately, code not shown, we took the fact that we knew the SeedKeyRoutine and we enumerated through all of these essays and confirmed that the SeedKeyRoutine we knew that was in the diagnostic software was only useful for diagnostic software.

29:12.380 --> 29:19.220
These other SA levels and DSC levels are probably bootloaders, or other field service, or maybe engineering functions.

29:19.260 --> 29:22.060
And all of those use a different routine.

29:22.060 --> 29:31.660
So the good news here is that whereas you're giving attackers access to cyber-physical impacts, you may not be giving them access to firmware upload and things like that.

29:31.660 --> 29:39.100
Although the vendor did confirm that this CVE did have a potential corruption of firmware impact later.

29:39.100 --> 29:42.040
So there is enough in the diagnostics still to be bad.

29:42.040 --> 29:46.860
A little bit of a segue before we go back to the actual CVE.

29:46.860 --> 29:48.140
I'll talk about that at the end.

29:48.640 --> 29:49.660
We're all car hackers here.

29:49.660 --> 29:53.520
I want to share with you something I'm passionate about, which is all the bench setups.

29:53.520 --> 29:55.020
So I love my bench.

29:55.020 --> 29:58.040
This is a picture of my bench on a clean bench day.

29:58.480 --> 30:04.300
The RS, the target, the roll stability system that we looked at is right here underneath this monkey.

30:05.160 --> 30:07.680
And this is my favorite desk mat, etc, etc.

30:08.060 --> 30:09.960
So you all have bench setups too.

30:09.960 --> 30:12.160
At the back here, there's a power line network.

30:12.160 --> 30:14.920
You can actually see a lamp connected there.

30:14.920 --> 30:17.320
And I have a battery underneath here.

30:17.340 --> 30:20.300
And you can see some power line messages happening on the oscilloscope.

30:20.300 --> 30:22.860
This is where I usually stand and do stuff.

30:22.860 --> 30:24.760
I'm sure you have a cool bench like that too.

30:25.240 --> 30:32.800
One of the things you're going to need to do if you want to get into power line hacking is you're going to have to set up a trailer ECU.

30:33.240 --> 30:34.940
Now these things need power.

30:35.460 --> 30:39.020
The absolute easiest way to power one of these things is a 12-volt battery.

30:39.020 --> 30:46.100
It's really not hard to get a 12-volt battery, get a trickle charger, put it next to your desk, and then you can power every ECU you want.

30:46.440 --> 30:48.540
Note that we call them 12-volt batteries.

30:48.540 --> 30:51.240
12-volt is actually not a great voltage reading on one of these things.

30:51.240 --> 30:53.380
You do want a little bit more than that.

30:53.700 --> 30:59.040
And so we call them 12-volt batteries, but they're probably more like 15-volt batteries, ideally, right?

31:00.180 --> 31:06.640
One of the things you can do to make this work, if you don't want to have a 12-volt battery in your lab, is ATX power supply.

31:06.640 --> 31:11.520
The chunky ones that we used to use on desktop computers, at least in my day.

31:11.520 --> 31:13.720
Actually, in my day it wasn't ATX, it was just AT.

31:13.840 --> 31:16.420
And you can get good 12-volt lines out of this.

31:16.800 --> 31:20.500
And it turns out that there's not a sufficient amount of noise to stop the power line.

31:20.500 --> 31:21.900
So this still works power line.

31:21.900 --> 31:27.420
The thing I wanted to share with you that I think is really useful is these USB PD triggers.

31:27.560 --> 31:30.920
So I use USB-C to power everything these days.

31:30.920 --> 31:35.240
And USB-PD is capable of giving you 12 and 15 and 20 and all kinds of voltages.

31:35.240 --> 31:39.700
You can actually power your entire trailer from this.

31:39.700 --> 31:51.180
So at an event, I once had a USB-PD battery and one of these triggers, and I powered the entire trailer equipment with that one thing.

31:51.180 --> 31:52.560
So they're very useful.

31:53.000 --> 32:01.520
The only thing you have to watch out for with all power line stuff, power line operates in the radio frequency range, about 100 kilohertz to 400 kilohertz.

32:02.100 --> 32:09.100
A lot of power supply output impedances, sorry, power supplies input impedance at this frequency looks like ground.

32:09.100 --> 32:12.180
Many power supplies are not well isolated.

32:12.620 --> 32:18.540
So when you try to generate these radio frequency signals, if you have the wrong power supply connected, it actually attenuates the signals.

32:18.540 --> 32:20.220
They just disappear and go to ground.

32:20.220 --> 32:26.280
This was a problem that actually happened during the fielding of J2497, like in 1999 and in 2000.

32:26.360 --> 32:35.900
And ultimately OEMs put like filter equipment on the trucks and people had to update their trucking equipment power supplies to put inductors on the output.

32:36.020 --> 32:44.560
So if you put an inductor on the output of a power supply, the high frequencies see an open circuit and they no longer go down to ground.

32:44.720 --> 32:48.580
Right here, you saw a little video of me reworking one of these triggers.

32:48.760 --> 32:53.480
It's really not hard to buy a surface mount inductor of about 100 microhenries.

32:53.480 --> 32:55.040
Any size will do, really.

32:55.040 --> 32:57.760
100 microhenries was just easy to get.

32:57.760 --> 33:05.120
You just scrape some copper off, solder it down, and then any USB PD supply you use is now going to be Powerline compatible.

33:05.120 --> 33:07.600
And it makes testing things much, much easier.

33:08.260 --> 33:11.620
Another thing I love for testing, who loves lever nuts?

33:12.040 --> 33:13.860
Come on, we must have some lever nut lovers.

33:13.860 --> 33:14.580
Thank you very much.

33:14.580 --> 33:15.680
I appreciate that.

33:16.140 --> 33:18.020
Yes, I know you love lever nuts, actually.

33:18.020 --> 33:18.440
Thank you.

33:18.440 --> 33:19.420
Thank you for piping up.

33:19.420 --> 33:20.820
I love lever nuts.

33:20.820 --> 33:32.060
Um, something you may not know, the OEM Waggo lever nuts, Waggo, Waggo, are exactly the right size to fit banana jacks.

33:33.320 --> 33:34.820
Which is really great.

33:34.820 --> 33:39.400
These AliExpress ones are like, you know, I think $2 for a bag of 50.

33:39.400 --> 33:44.520
These ones are kind of worth it if you're going to use banana jacks because they fit right in there, which is really rad.

33:45.360 --> 33:47.660
Um, and then talking J2047.

33:47.660 --> 33:51.840
So if you're going to want to hack one of these Powerline equipments, you're going to have to have some way to talk to it.

33:51.960 --> 33:54.880
There's a bunch of send only options, right?

33:54.880 --> 34:00.880
So the truck duck, the truck cape, these things have a way to bit bang J2497 and that's send only.

34:01.200 --> 34:08.380
You also can use an FL2K SDR, which are these VGA dongles that you can use for transmitting radio frequencies.

34:08.520 --> 34:18.120
And the mitigation technology that the NMFDA published in 2022 called the keyhole actually has the code in it to send an arbitrary J2497 signal.

34:18.120 --> 34:21.720
You can repurpose that Python code to send anything you like on J2497.

34:21.720 --> 34:23.540
So these are your send only options.

34:23.640 --> 34:32.040
If you want to send and receive traffic, like both, you're going to need to either buy a diagnostic adapter, an RP-1210, VDA.

34:32.640 --> 34:36.940
To me, I think there's a really great one made by DG Tech called the PLC-TESCON.

34:36.940 --> 34:41.720
And then the Noregon Systems PLC adapter is also really good in my experience.

34:41.720 --> 34:47.760
And these things essentially just convert from 1708 to 2497 and you're going to use 1708 in your software.

34:47.760 --> 34:50.260
Your software will just think it's using 1708.

34:50.620 --> 34:52.900
Under the hood, it's going to be using 2497.

34:53.160 --> 35:04.720
You can also use something like a HackRF or any bi-directional SDR and a plugin called GR-J2497 that was authored by Chris Poore at AIS.

35:05.500 --> 35:10.620
I didn't cover it in this talk, but you can actually capacitively couple your SDR to the power line.

35:10.620 --> 35:26.140
Get yourself a one microfarad capacitor and take the pin of your SDR, put the capacitor in between that and the 12-volt line, and you can just couple your traffic right onto the power line with your SDR.

35:27.100 --> 35:29.120
Which is essentially what we did.

35:29.760 --> 35:32.780
Here's how we inspected J2497.

35:32.780 --> 35:35.320
And when we injected it, it was just an SDR plugged in.

35:35.320 --> 35:44.160
This yellow trace that you see here is like an analog view of the power line that we're extracting from this PLC test con by some of the rework that we did inside.

35:44.180 --> 35:59.420
You don't need to do this to your devices, but I recommend that you do tap into that J1708 line somewhere in your VDA so that you can have this UART decoder working so you can see what's going on down on the bus.

35:59.420 --> 36:14.460
For us, ultimately, we created custom CyGrok decoders that I talked about yesterday to be able to inspect all of the testing we're doing and decide did we succeed in getting a seed or not to get the timings really correct.

36:14.580 --> 36:20.060
And the timings are really necessary because we did a blind version of the unlock.

36:20.300 --> 36:24.400
So previously, it's been disclosed that you can read this traffic remotely.

36:24.400 --> 36:29.660
You can also write this traffic remotely from roughly the same distance for a cheap amount.

36:29.660 --> 36:34.820
And it really is dependent on equipment, and it's dependent on configuration, and it's dependent on how much money you want to spend.

36:34.820 --> 36:42.340
But the bad news in all of this is that the most susceptible equipment in both cases was always tankers.

36:42.340 --> 36:46.380
The things that are just big hunks of metal ended up being the things that are the most susceptible.

36:46.840 --> 36:52.100
And the equipment that we're testing now is obviously tankers because they're that most susceptible.

36:52.160 --> 37:05.140
We did a blind attack because we think it's important to do the cheapest thing, to do something for as little cost as possible so it can be demonstrated that attackers don't need nation state capability to make these things happen.

37:05.480 --> 37:13.760
It's also as a counterpoint to arguments that were made in the original disclosure that if there's any replay protection at all, then you're safe.

37:14.160 --> 37:16.160
This was to demonstrate that that's not the case.

37:16.160 --> 37:22.300
You can have some replay protection, and if there's problems in that replay protection, then it ultimately gets reduced to the same thing.

37:22.500 --> 37:30.560
It's entirely possible for people to create a full duplex send and receive wireless J2497 interface.

37:30.700 --> 37:34.660
If they did that, they don't need to do these blind timing things.

37:34.660 --> 37:39.960
They can just send a request for a seed, look up the key, and send the unlock for the key.

37:39.960 --> 37:41.000
So it becomes simpler.

37:41.000 --> 37:42.520
The range may be reduced.

37:42.520 --> 37:52.000
It's definitely more expensive than this blind setup because blind setups are just transmit only SDRs, which at the time cost like $25 US.

37:54.800 --> 38:06.480
Right, so the blind unlock, because we're just transmitting these things and we don't get to read anything at all, we have to be very particular about where we put our requests, right?

38:06.720 --> 38:09.740
It's even harder than what Karen Caribou does.

38:09.740 --> 38:12.100
Karen Caribou can actually read the thing back.

38:12.420 --> 38:18.320
We want to make sure that we sleep for a very specific amount of time after reset and send our diagnostic session control.

38:18.320 --> 38:23.500
So we need to find a spot here where the bus is quiet and the ECU is ready to receive that command.

38:23.680 --> 38:30.780
Then we need to wait long enough for the ECU to process that command and for the bus to get quiet, and then we can send our security access.

38:30.780 --> 38:35.960
Then again, process, wait for it's quiet, and then send our key to unlock this thing.

38:35.960 --> 38:38.840
This is like the POC of how you would do a wireless unlock.

38:38.860 --> 38:43.660
And every one of these sleeps has to be way more accurate than Python sleep.

38:43.920 --> 38:55.320
But as I alluded to, we were using SDRs, so we had like a nice deep buffer with a very reliable clock so we could just fill this buffer with the bit stream that we wanted to put out and then we're good.

38:55.320 --> 38:56.800
The jitter is removed.

38:57.430 --> 39:06.540
We needed to know, though, what was happening when things came back, which is why we created these decoders.

39:06.540 --> 39:13.500
So down here, you can see a screenshot of a SideRock decoder output, and we set this up like glitch campaigns.

39:13.500 --> 39:25.580
So if you've ever done any glitching, you want to find a particular set of parameters, where to put your pulse, how wide to make your pulse, and then you know if something worked because the bootloader skips or you get a particular error message back.

39:25.580 --> 39:30.220
And it ends up looking at a lot of logs, and maybe you post-process the logs, but you're sweeping parameters, right?

39:30.220 --> 39:32.020
You try here, you try here, you try here.

39:32.020 --> 39:38.120
It's these giant campaigns of parameter sweeps, which is exactly what we were doing for all of those sleeps that we needed to tune.

39:38.980 --> 39:44.900
But I didn't want to look at logs, and the behavior is very stateful as well, right?

39:44.900 --> 39:50.760
Like the ECU has to go into this mode and then it has to go into that mode, and how am I going to know it worked unless I write these custom log processors?

39:50.760 --> 39:52.920
I also really like looking at traces.

39:52.920 --> 39:58.280
So we wrote custom CyGrok tracers that would do the decoding, and then you get these nice colors.

39:58.280 --> 40:08.060
So here's an example of a parameter sweep where I'm changing a parameter slowly, and eventually it crosses the boundary here from not being a good parameter to being a good parameter.

40:08.060 --> 40:09.900
And you can see it goes from purple to green.

40:09.900 --> 40:18.160
So it became interactive and easier to do these sweeps, come back to the bench after a couple hours and see where the parameter changed, which is great.

40:19.300 --> 40:22.900
So this is like what we would do with generating the signal.

40:22.900 --> 40:34.220
Notice that instead of sleeping, we now put silences in place, and these silences are as accurate as the sample clock, which in this case was like 777 megahertz.

40:34.600 --> 40:35.700
So pretty accurate.

40:36.580 --> 40:42.200
And the culmination of all those decoders let us ultimately find all the quiet places.

40:42.200 --> 40:45.460
And if you want details for all the nitty gritty, it's in the white paper.

40:45.460 --> 40:50.920
But here is a screenshot of like the first time that we got kind of the same seed out again and again.

40:50.920 --> 40:59.740
And if you can read the numbers at the bottom, it's not exactly the same seed, but we don't need exactly the same seed all the time to win, right?

40:59.800 --> 41:05.460
Trucks stop at stop signs and stop lights for minutes, right?

41:05.460 --> 41:12.100
We reasoned that if we could really get an attempt out in a two minute period, then we would be good, right?

41:12.320 --> 41:14.040
So how deterministic was this?

41:14.040 --> 41:19.180
We found that if we do a 30 second between retries, we have about a 50% chance of getting the seed right.

41:19.180 --> 41:20.380
And that's just like a hot loop.

41:20.380 --> 41:22.740
30 seconds, try, try, try, try, try.

41:22.740 --> 41:27.660
50% of the time we get the seed we wanted, which is actually still good enough for a stop sign or a stop light.

41:27.660 --> 41:36.520
But worse than that, if you just let things cool down for two and a half minutes and you try in a lower period, you actually get a way higher hit rate.

41:36.520 --> 41:41.720
So the chance of having that first good seed is actually way higher than the repeated seeds.

41:41.720 --> 41:42.920
Yes, please go ahead.

41:46.300 --> 41:48.460
So it's really equipment dependent.

41:49.220 --> 41:51.340
We didn't do any in motion testing.

41:51.340 --> 42:02.460
The equipment that's necessary, and for the details of that, I encourage you to look at the previous disclosure in 2022 of the wireless write vulnerability because it really depends on what are you attacking and how much money did you spend?

42:02.460 --> 42:08.700
But it is possible for, you know, less than 10 grand to set this up in a mobile unit.

42:08.700 --> 42:09.600
It is possible.

42:09.600 --> 42:15.660
It's also possible for like less than a grand to set this up in a ditch from the side of the road.

42:15.660 --> 42:19.060
So these are all tractable situations to be sure.

42:21.600 --> 42:22.760
Thank you for the questions.

42:22.760 --> 42:23.740
I appreciate it.

42:24.360 --> 42:27.520
So we did get a CDE for this one.

42:28.060 --> 42:30.900
First contact was like February 2024.

42:31.580 --> 42:33.920
We claimed the following.

42:34.400 --> 42:37.060
Ultimately assigned a medium, which I think is accurate.

42:37.060 --> 42:38.100
I have no problem with that.

42:38.100 --> 42:42.900
In this case, it's a different CWE because this unit actually did have seed key exchange.

42:42.900 --> 42:44.740
It did have an authentication mechanism.

42:44.820 --> 42:47.760
In the past, the CWE was complete lack of authentication.

42:47.760 --> 42:49.440
In this case, it's broken authentication.

42:50.260 --> 42:56.080
There was also an ICSA advisory that was released right at the top of the year regarding this.

42:56.820 --> 42:59.400
So the impacts are a bit nuanced.

42:59.400 --> 43:08.640
The good news, as I mentioned, is the seed key routine that we have reverse engineered and that an attacker could easily reverse engineer is only capable of doing diagnostic actions.

43:09.080 --> 43:18.620
It isn't capable of entering any of those other security levels, which are probably, and this is just conjecture, no one has told me, probably like a bootloader or field service or engineering functions.

43:18.620 --> 43:23.020
And usually those things are much higher privileged and you're able to do bad things in those levels.

43:23.020 --> 43:23.920
So this is good news.

43:23.920 --> 43:25.760
That seed key routine is limited.

43:25.780 --> 43:26.540
Excellent.

43:27.040 --> 43:30.360
There is some bad news.

43:30.700 --> 43:43.540
In the disclosure process with CISA and with the supplier, the supplier did confirm that the diagnostic software security level is sufficient to cause denial of service of the firmware, even though it's still a safe state.

43:43.540 --> 43:49.140
So this is not terrible news, but still that level is bad enough in some ways.

43:50.920 --> 44:02.440
And of course, because the diagnostic function by itself alone is good enough to do solenoid control, everything we talked about before is still possible.

44:02.440 --> 44:09.680
So the really good news here and why this is like a talk and not a, you know, behind closed doors, never talk about a kind of thing.

44:10.060 --> 44:12.240
This doesn't scale to arbitrary units.

44:12.240 --> 44:23.160
The NMFDA probably would have never talked about this if this was like we could predict the seed on every trailer in the world and unlock them, because that would be a really , really bad thing that would need to be fixed without talking about it.

44:23.260 --> 44:26.620
In this case, we were able to obtain four different units.

44:26.800 --> 44:29.820
These things are expensive and they're deployed pretty heavily.

44:30.260 --> 44:33.860
And four was about as much as the resources that we have could get.

44:33.860 --> 44:37.160
In all four of the cases, they had different build dates.

44:37.880 --> 44:43.280
Two of them had the same firmware on them, but in all four cases, they had a different first seed.

44:43.280 --> 44:45.140
And this is not the real first seeds.

44:46.540 --> 44:48.620
There are some limitations to this good news.

44:48.620 --> 44:57.980
Like, we don't know for sure how uniformly distributed those first seeds are in the 16-bit space.

44:57.980 --> 44:59.440
It's only 16-bit numbers.

44:59.440 --> 45:01.420
There's 65,000 possible numbers.

45:01.420 --> 45:04.900
There's way more than 65,000 of these units on the road.

45:05.580 --> 45:10.000
And even if they had them perfectly uniformly distributed, it's still not a great answer.

45:10.000 --> 45:16.680
We're also not equipped to obtain 1,000 units and test 1,000 units and decide how well-spaced that is.

45:16.680 --> 45:19.200
We feel the vendor has access to the firmware.

45:19.200 --> 45:20.380
They should be able to do that.

45:20.500 --> 45:22.220
Reverse engineering would answer this question.

45:22.220 --> 45:25.840
We're not going to proceed with reverse engineering to answer that question.

45:25.840 --> 45:30.680
We feel that it's the responsibility of the vendor to decide how uniformly distributed that is.

45:33.480 --> 45:35.840
And yeah, this isn't just about a blind attack, right?

45:35.840 --> 45:41.040
Remember, we did the blind attack so it was the minimum possible equipment for wireless access.

45:41.280 --> 45:47.120
We wanted to demonstrate that it's not true that any replay protection saves you from this wireless attack.

45:47.120 --> 45:51.700
It's possible that your replay protection is also broken and can be reduced to this attack.

45:51.700 --> 46:01.920
But remember that these trailer units are connected to a data bus and people are adding things to the data bus all the time, including telematics units.

46:01.920 --> 46:11.020
There's four different suppliers of internet-connected trailer telematics that do active diagnostics of the ECUs.

46:11.020 --> 46:22.240
These telematics units are capable of writing and reading Powerline and they're being connected to this bus that has ECUs whose security access controls are equivalent to y equals mx plus b, right?

46:22.240 --> 46:27.060
So the problem here isn't just the CVE, it's a more systematic one.

46:27.060 --> 46:36.580
And I'm not sure that you could even get a CVE for the security access being linear because we all kind of know there are many linear security access routines out there.

46:36.580 --> 46:45.360
So the point is that people should be careful about the software they're putting into their telematics systems and deploying on these very vulnerable networks.

46:45.360 --> 46:52.060
It's very akin to the early days of automotive and the early days of trucking CAN bus stuff.

46:52.220 --> 46:53.540
So we've been busy.

46:53.760 --> 46:55.580
We did the coordinated disclosure.

46:55.580 --> 46:56.580
These things take time.

46:56.580 --> 46:58.420
I'm sure you're all familiar with that.

46:58.880 --> 47:11.400
We've also been working in ATATMC, which is the Technical Maintenance Council of the American Trucking Association, to make sure that security requirements were captured in all the documents they produced for the next generation interface.

47:11.400 --> 47:15.800
So today we have this Powerline connection in the near future.

47:15.800 --> 47:16.480
I hope.

47:16.480 --> 47:17.720
They've been saying this for years.

47:17.720 --> 47:24.040
In the near future, we're going to have a CAN bus connection and possibly automotive Ethernet between the trucks and the trailers.

47:24.040 --> 47:29.200
And if you look at the ATATMC documentation that's produced, there is security requirements in it.

47:29.200 --> 47:32.200
And we hope that SAE looks at those.

47:33.280 --> 47:46.820
We have gone back to SAE's Truck and Bus Committee and petitioned them to reopen the standard for J2497 and to include mitigations against these wireless attacks in a reissuing of the J2497 standards.

47:46.820 --> 47:57.220
So that when the next interface comes up, the people that actually implement the next interface have to refer to the new version and then they have to, not have to, but they should follow the recommendations that will include defenses.

47:57.220 --> 47:59.680
The Truck and Bus Committee did agree to reopen it.

47:59.680 --> 48:05.360
There has been two different discussions of document changes that we proposed in two different quarterly meetings.

48:05.360 --> 48:07.720
So we feel that's moving forward in a good way.

48:07.720 --> 48:08.940
These things take time.

48:09.480 --> 48:11.840
We have also published proof of concept mitigation.

48:11.840 --> 48:25.260
The J2497 keyhole code is available on GitHub and that's functional Python code that, you know, you're not going to run Python code in your trucks, but it demonstrates that you can generate these signals that deny access to the bus.

48:25.680 --> 48:37.160
And we proved that those signals can be done with bit banging, which means if you're a supplier and you want to protect trailers by deploying something on a truck, you can do that with a microcontroller and a GPIO and a capacitor.

48:37.540 --> 48:40.160
We gave you the software to do that .

48:40.200 --> 48:42.340
It's not going to take a lot to protect a trailer.

48:42.340 --> 48:45.920
It's just a little bit of deployment of some more code.

48:45.920 --> 48:47.420
Blind code, in fact.

48:47.940 --> 49:00.540
And of course, we updated the telematic security requirements, which we published to apply to all trailer telematics because people are putting telematics on trailers and these trailer units are not well protected against these kind of attacks.

49:01.300 --> 49:05.620
So in conclusion, these timing attacks are generally applicable.

49:05.620 --> 49:06.880
It's not just CAN.

49:06.940 --> 49:08.980
You can do this in all kinds of weird places.

49:08.980 --> 49:14.640
If you want to know more about the CAN stuff, I highly recommend reading Sagar's paper, CANDAN.

49:14.820 --> 49:21.320
If you're going to be assessing time dependence of seeds, you have to make sure that you have very jitter-free timing.

49:21.840 --> 49:22.200
Right?

49:22.200 --> 49:27.700
If it is a time-dependent seed and you actually have jitter in your timing, you might not know that it's time-dependent.

49:27.700 --> 49:30.540
You need to have very reliable timing to be sure about that.

49:30.680 --> 49:32.160
Scapi Automotive is awesome.

49:32.260 --> 49:33.500
I think that's the conclusion.

49:33.500 --> 49:34.600
I hope you agree.

49:34.940 --> 49:41.080
And we found some novel ways to use, you know, previous J2497 stuff to make this happen.

49:42.020 --> 49:45.100
Here is the QR code for the white paper.

49:45.620 --> 49:49.500
It should be free to access without, like, a paywall or a login wall or anything.

49:50.000 --> 49:51.920
All the code is copy and pasteable.

49:51.920 --> 49:53.660
My contact information is there.

49:53.660 --> 49:55.120
This is the email of my boss.

49:55.120 --> 49:59.160
If you don't like anything I said, you can tell him that I shouldn't have said it.

49:59.340 --> 50:02.540
And I really do appreciate your attention to this matter.

50:02.560 --> 50:03.720
Thank you for your time today.

50:08.700 --> 50:09.600
Thank you.

50:10.800 --> 50:16.300
If there is a couple questions, but I am going to run to a CTF otherwise.

50:19.500 --> 50:19.940
Okay.

50:20.100 --> 50:20.600
Thank you.

50:20.600 --> 50:21.300
Thank you very much.

50:21.300 --> 50:21.980
Bye, everybody.

