WEBVTT

00:00.860 --> 00:08.260
That was quite the introduction for compromising an electronic logging device and creating a truck-to-truck worm.

00:08.300 --> 00:09.800
But that's what we're going to be talking about.

00:09.800 --> 00:10.680
So, my name is Jake.

00:10.680 --> 00:11.860
This is Rick.

00:11.860 --> 00:14.360
And, Rick, take it away.

00:15.700 --> 00:17.200
Thanks, Jake.

00:18.340 --> 00:26.140
So, we are systems engineering master's students from Colorado State University and we work with Dr.

00:26.140 --> 00:32.360
Jeremy Daly and primarily concentrate our research on cybersecurity of heavy vehicles.

00:34.040 --> 00:38.580
And, here's a video of the work we have done.

00:38.580 --> 00:39.980
Hopefully, it plays.

00:48.130 --> 00:59.590
Alongside the truck, you reflash the electronic device, which is running its software with a malicious firmware that will slow down the truck once it starts executing.

00:59.950 --> 01:01.650
We were successful in this attack.

01:01.650 --> 01:03.770
The car broke up alongside it.

01:03.770 --> 01:08.930
About 30 seconds later, the truck begins to slow down and the car pulls out.

01:09.130 --> 01:10.750
This is a wireless attack.

01:10.750 --> 01:16.050
It gives us the freedom to explore creative attack vectors, including flying a drone.

01:16.050 --> 01:19.570
Critical infrastructure is becoming more and more connected, including trucks.

01:19.570 --> 01:22.290
One of the reasons is due to the ELD mandate.

01:22.290 --> 01:26.510
When the ELD mandate first came out, it did not have much security in it.

01:26.510 --> 01:28.970
They couldn't use many security improvements.

01:28.970 --> 01:39.490
Here at Colorado State University, we are exploring the security of heavy vehicles, as well as the security of the devices attached to the heavy vehicles, such as electronic logging.

01:43.760 --> 01:50.700
Basically, what we did is, as far as we know, the first wireless drive-by attack on a truck.

01:53.940 --> 01:55.940
I was driving the truck.

01:55.940 --> 01:59.460
Ray got to drive the smooth Tesla by it.

02:00.540 --> 02:07.940
What he did was basically flash the ELD that was plugged into the truck while the car was driving by the truck.

02:09.740 --> 02:14.160
After about 30 seconds, after the firmware was loaded, the device rebooted.

02:14.420 --> 02:18.920
Basically, what happened was the car pulled ahead and the truck started to slow down.

02:20.140 --> 02:24.740
What we found and what we did was that the accelerator pedal stopped working.

02:24.820 --> 02:28.760
It was stuck in idle, and that's why we could not move the truck any forward.

02:31.360 --> 02:37.320
So, a bit of background on what happened, why we did, and why we chose to do that.

02:39.080 --> 02:44.560
The first big question that comes up is, why do we do research on commercial vehicles?

02:45.280 --> 02:50.200
Well, one simple answer to that thing is, they are very important to the supply chain.

02:50.480 --> 02:55.060
And I think the pandemic gave us a good lesson on why it's important to the supply chain.

02:55.060 --> 03:00.900
The shortages were pretty obvious, what lack of trucks on the road can do.

03:00.920 --> 03:05.340
And they are considered part of critical infrastructure for that very same reason.

03:07.260 --> 03:09.020
What's under the hood of trucks?

03:09.360 --> 03:13.220
Well, basically, modern trucks are very much electronical.

03:13.220 --> 03:22.360
They have lots of embedded computers inside them, around 150 ECUs, as we call them, electronic controller units, to control functions of modern trucks.

03:23.060 --> 03:31.980
They use a lot of different network protocols, like CAN, CAN FD, LIN, and even the most recent ones have started using automotive Ethernet for some purposes.

03:32.320 --> 03:37.600
In most trucks here in the United States, they say J1939 is the standard of choice.

03:38.280 --> 03:42.980
And most trucks on the road do use that standard for communication between these ECUs.

03:45.580 --> 03:50.140
Now, what are electronic logging devices and how did they come into trucks?

03:50.900 --> 03:59.320
Well, it was started off as a mandate for commercial trucks, and most of them use it ever since the mandate in 2017.

03:59.980 --> 04:06.700
The goal of an ELD is to record hours of service because paper logs are not reliable enough.

04:06.700 --> 04:14.560
Truckers would more often than not be honest in those paper logs and keep driving more than the allotted hours.

04:14.600 --> 04:22.220
And the goal of electronic logging devices was to basically get rid of that and have a device log your hours of service.

04:22.580 --> 04:30.600
The big problem with that was in the entire mandate that was out there, there was no mention of security at all.

04:31.420 --> 04:39.820
The process for getting your own ELD was make one, self-certify it, and you can start selling it out to each of the trucks.

04:40.400 --> 04:49.820
There are about 880 ELDs of this time that are out there, so a lot of different variants from a few different manufacturers.

04:50.140 --> 04:59.380
And the goal of that ELD is, once again, they go into the diagnostic port of a truck, similar to that of a car, and they log data.

05:00.140 --> 05:11.340
One of the fundamental issues with this thing is that, more often than not, they require both read and write access to the internal network of a commercial vehicle to do that.

05:11.420 --> 05:16.840
And that write access may create a problem if exploited.

05:17.460 --> 05:36.120
The other thing is that ELDs don't work as standalone devices, and more often, there are other apps or other devices that are connected over Wi-Fi, Bluetooth, or sometimes even over cellular to get the data of the ELDs that the ELDs record from a modern truck.

05:37.420 --> 05:54.000
Now, when we start looking at ELDs from an attacker's perspective, the main goal is to somehow go in there, compromise the ELD, and write bad messages so that you can do something bad with the truck.

05:54.420 --> 06:05.820
The initial landscape looks very difficult because there are around 880, and launching a successful attack on 880 different variants is extremely difficult.

06:05.900 --> 06:13.580
The other big problem is most trucks have started incorporating gateways, which basically act as firewalls.

06:13.580 --> 06:20.720
They sit between your diagnostic port and the internal components which need to be shielded from attacks.

06:21.660 --> 06:27.560
The other thing is that it's a device that plugs in, so plugging it out would stop the attack.

06:28.780 --> 06:39.380
So a typical threat scenario would involve two things, either short-range access over Bluetooth or Wi-Fi, or long-range access via cellular networks.

06:39.840 --> 06:45.720
But doing a deeper dive into the world of ELDs reveals something entirely different.

06:46.420 --> 07:00.280
Actually, there are only a few distinct ELDs, let's say about 10 of them, and most of them are basically rebranded clones of one another, and there is significant code reuse among all the ELDs.

07:01.440 --> 07:05.740
Okay, that takes out 880 and leaves us with 10 to look at.

07:05.920 --> 07:13.560
The other problem is gateways, but gateways have become popular most recently, and trucks run for a lot of time.

07:13.560 --> 07:18.400
They run for 20, 30 years on the road, and gateways are relatively modern.

07:18.700 --> 07:22.460
So most trucks out on the road today don't have gateways.

07:22.660 --> 07:26.720
So the question of having a firewall inside a truck is gone.

07:27.060 --> 07:48.400
Even the ones that do have gateways, they can be subjected to some configuration errors, and recently our team has discovered some diagnostic protocol flaws that allows you to write messages in a way that can bypass a firewall and go into the parts of the truck where it should not go and actually cause some harm.

07:49.380 --> 08:03.020
The other thing about ELDs is that if something bad happens, the first thing a diagnostic technician would do is remove the ELD to plug their own maintenance tool there to find out what's wrong with the truck.

08:03.620 --> 08:09.080
So actually finding out the issue becomes a big problem if an attack is launched through an ELD.

08:10.580 --> 08:20.460
And thus, we introduce in this research a novel approach of actually compromising an ELD and creating a truck-to-truck warm.

08:20.940 --> 08:26.380
With that, I would like to hand it over to Jake to go into the in-depths of this research.

08:30.880 --> 08:39.280
Alrighty, so since it's DEF CON, instead of just going over what we found, I'm also going to go over how we did it because it's a bit of a journey.

08:39.280 --> 08:49.280
This was the first big thing that I've reverse-engineered and therefore, in comparison to CTS and stuff like that.

08:49.680 --> 08:55.500
Alright, so real quickly, I want to make it clear that I'm not up here to shame the company.

08:55.820 --> 08:59.100
In my opinion, all companies have security vulnerabilities.

08:59.100 --> 09:01.160
Some might not have been found yet.

09:01.160 --> 09:04.840
But this company did a great job in their response.

09:04.840 --> 09:11.000
So we did a responsible disclosure with them and they ended up putting out a patch.

09:11.360 --> 09:14.160
And in our opinion, they responded pretty well.

09:15.460 --> 09:17.000
So one day, Dr.

09:17.000 --> 09:22.820
Daly, which is our advisor, just went onto Amazon and he bought some of these devices.

09:22.900 --> 09:25.060
It's actually... oh, screens are up there.

09:25.060 --> 09:27.200
It's actually the little disk, right?

09:27.200 --> 09:28.500
So it's about this big.

09:28.500 --> 09:32.200
And the reason he bought them is that they all look very similar.

09:32.280 --> 09:33.320
And they work.

09:33.320 --> 09:37.760
They were the exact same devices being sold by many different major brands.

09:37.760 --> 09:42.240
So the devices are IO6, IO1020 micro-ELDs.

09:42.240 --> 09:45.680
We found that this device was sold by like 50 plus different brands.

09:46.120 --> 09:50.020
And this is kind of commonplace in the ELD industry.

09:50.020 --> 09:54.880
So as Rick mentioned before, these devices come with additional wireless networks on them.

09:54.880 --> 09:59.360
So this one had Bluetooth and GPS, which were mentioned in the manual.

09:59.360 --> 10:12.300
But what was interesting is that when you first powered it on, it actually popped up a Wi-Fi network as well, which is curious because why would you go through all the effort of programming the Wi-Fi if you don't mention it in the manual?

10:12.300 --> 10:18.180
So that's kind of the first thing that kind of was a clue initially.

10:18.360 --> 10:23.120
And if you go ahead and look at the picture of the PCB, that's the PCB of the board.

10:23.120 --> 10:25.220
It's an ESP32-based device.

10:25.320 --> 10:29.440
And that port right there is kind of what we're going to talk about next.

10:29.440 --> 10:33.100
So it was labeled PROG, which we assumed was likely programming.

10:33.100 --> 10:34.700
It's an ESP32 device.

10:34.700 --> 10:42.420
So doing a little bit of hardware reverse engineering, figuring out what pins, what communication, what programs to use, we were eventually able to check the eFuses on it.

10:42.420 --> 10:47.020
And checking the eFuses allowed us to determine that it had no protections on it at all.

10:47.020 --> 10:49.580
So we could go ahead and just dump the firmware off of it.

10:49.640 --> 10:52.900
And the first thing we're going to do with the firmware is run strings on it.

10:52.920 --> 10:56.800
And normally you don't hit the jackpot with just strings.

10:56.800 --> 10:58.420
But in this case, we did.

10:58.420 --> 11:03.300
So as we're looking through strings, I come across that SSID.

11:03.380 --> 11:09.560
And then two lines down, I see what I can only describe as a Wi-Fi password.

11:09.560 --> 11:10.700
And that is what we found.

11:10.700 --> 11:14.220
It was the hard-coded default Wi-Fi password for this device.

11:14.220 --> 11:21.060
We continue scrolling down, and we start seeing stuff about web servers and these endpoints, this slash upload.php.

11:21.060 --> 11:23.480
It's talking about OTAs and flashing.

11:23.480 --> 11:24.980
But it needs a key.

11:25.160 --> 11:31.260
And as we go down a little bit more, we see something that starts with a 1 and it ends with a 6.

11:31.260 --> 11:33.640
And I'll let you figure out what's in between that.

11:33.680 --> 11:40.080
And that was the hard-coded key that protected the over-the-air updates for this device.

11:42.120 --> 11:42.780
All right.

11:42.780 --> 11:47.420
So once we now got onto the Wi-Fi network, of course, we can go ahead and do an NMAP scan.

11:47.420 --> 11:51.820
The NMAP results there are incomplete, but essentially it would find three services.

11:51.820 --> 11:54.520
We had a Telnet service on port 23.

11:54.520 --> 11:55.900
We had SSH.

11:55.900 --> 11:58.660
Well, NMAP thought it was SSH on port 22.

11:58.660 --> 12:00.300
I did not think it was that.

12:00.540 --> 12:02.960
And then we had an HTTP server on port 80.

12:02.960 --> 12:07.860
So if we look at the screenshot of the HTTP server, we can see it's listing serial version.

12:07.900 --> 12:10.600
And then we have that key and a little bit of foreshadowing.

12:10.600 --> 12:15.520
We have a firmware-mal standing for a malicious firmware that we created.

12:16.040 --> 12:16.600
All right.

12:16.600 --> 12:19.960
So this slide is, of course, the part that takes the longest.

12:19.960 --> 12:21.380
This is the reverse engineer.

12:21.380 --> 12:24.220
We found a device that has these vulnerabilities.

12:24.220 --> 12:31.520
We went ahead and did a little bit of testing to confirm it's not doing firmware signing and that we could actually upload a modified binary to it.

12:31.520 --> 12:33.060
But now what do we do with that?

12:33.060 --> 12:41.660
So at this point, we need to reverse engineer the binary, figure out how it works to the point that we can create a malicious firmware for it and get it to do what we want it to do.

12:41.820 --> 12:44.800
So this was on ESP32.

12:44.920 --> 12:50.100
So the code for it is Extensa.

12:50.160 --> 12:52.140
And Extensa was not well supported.

12:52.140 --> 12:53.980
It's now officially supported by Ghidra.

12:53.980 --> 12:59.220
But at the time, it was not on any of the major ones that I at least had the money for.

12:59.680 --> 13:01.880
And so we were looking at community support.

13:01.880 --> 13:06.020
And the best community support was for Ghidra at the time, but still needed a lot of work.

13:06.020 --> 13:12.080
So after spending weeks fixing up the decomp and going through all that, I had a bunch of flows.

13:12.260 --> 13:15.960
And it's kind of hard to describe what I mean by flows, but essentially I had a bunch of functions.

13:15.960 --> 13:17.420
They all kind of connected to each other.

13:17.420 --> 13:19.440
It was clear what their purpose was.

13:19.440 --> 13:23.820
But I was missing the thing that connected them and the main function.

13:23.820 --> 13:25.640
And that was a giant thing.

13:25.640 --> 13:27.020
I still don't have main.

13:27.020 --> 13:30.560
So I did what any good hacker would do, is I went snooping.

13:30.560 --> 13:32.900
And I learned that there's an Expressive Forms.

13:32.900 --> 13:34.900
I created an account, logged on.

13:34.900 --> 13:39.200
And after looking around, I found that there is an account called io6llc.

13:39.220 --> 13:45.700
And I guess that was probably related to someone that was working at that company.

13:45.700 --> 13:49.020
And most of their questions and that stuff were pretty normal.

13:49.020 --> 13:55.400
They were either reporting bugs or they were asking about help for certain things.

13:55.400 --> 14:00.160
But on one of them, they posted a full crash dump, which was beautiful.

14:00.160 --> 14:04.480
Because if we look at the crash dump, we can see it's talking about having a bunch of different threads.

14:04.680 --> 14:07.300
And it actually gives names to each of those threads.

14:07.480 --> 14:18.880
And so if I cross-reference those strings that we were looking at earlier, and I look at where those names are used, I came across a function that ended up being main, and it just wasn't decompiled correctly.

14:18.880 --> 14:23.680
So now that I had that, I was actually able to get the full picture of how it all worked.

14:23.800 --> 14:26.980
And we went from there.

14:27.760 --> 14:32.460
So quick overview of the vulnerabilities that were discovered through the reverse engineer.

14:32.460 --> 14:35.700
We already talked about the default network credentials.

14:36.560 --> 14:41.060
And we had this web server that seemingly was unused by these resellers.

14:41.140 --> 14:43.560
But it was always on and it was always there.

14:43.560 --> 14:46.600
We had Bluetooth and Wi-Fi being on at the same time.

14:46.600 --> 14:48.280
Firmware wasn't being signed.

14:48.280 --> 14:51.600
Firmware updates were protected by the weak password.

14:52.120 --> 14:58.220
And then what I ended up finding was that service on port 22 was actually a debug service.

14:58.220 --> 15:03.460
It essentially acted as an echo server, which we had no use for.

15:03.460 --> 15:11.180
And it was beautiful because it gave us a giant function to go ahead and put our malicious code in that would always get called.

15:11.180 --> 15:12.680
It was in its own thread.

15:12.680 --> 15:16.520
We didn't have to make any trampolines out for space or anything like that.

15:16.520 --> 15:21.700
And so we went ahead and just put in a pretty simple little bit of malicious code.

15:21.700 --> 15:25.200
And it's what you kind of see on the screen up there.

15:25.460 --> 15:28.280
And so essentially this would check a status variable.

15:28.280 --> 15:34.040
And once the status variable was equal to certain conditions, we knew that CAN was initialized.

15:34.040 --> 15:36.440
And it actually had a connection to the CAN bus.

15:36.440 --> 15:40.720
And then at this point, we just went ahead and spammed TSC1 messages.

15:40.940 --> 15:44.520
TSC1 messages are Torque Speed Control 1 messages.

15:44.520 --> 15:51.660
They are a J1939 message that are essentially there to allow you to tell the engine to go to a certain torque.

15:51.800 --> 15:57.580
So in the video, you saw us slowing down the truck because for safety reasons, we're going to slow down the truck.

15:57.580 --> 16:00.500
But we could have also sped up the truck as well.

16:01.980 --> 16:05.520
In terms of like how long it takes, it's a wireless attack.

16:05.520 --> 16:08.500
So if you're really close to the device, it goes pretty quickly.

16:08.500 --> 16:11.180
It can go in like 30 seconds, the entire thing.

16:11.180 --> 16:14.060
But the farther you move away, the longer it takes.

16:14.980 --> 16:19.080
We also found that the service on port 23 was this Telnet service.

16:19.080 --> 16:31.100
And this provided a pretty comprehensive API that not only allowed you to do all the normal ELD stuff, but it also allowed you to go ahead and change those defaults.

16:31.100 --> 16:33.460
Unfortunately, those weren't being used.

16:33.460 --> 16:35.060
And then we found something interesting.

16:35.060 --> 16:46.780
As we were looking through a function that was essentially the main command handler, we can see that most of the commands are a pretty normal string compare between essentially the command and whatever your input is.

16:46.780 --> 16:59.360
But if you go all the way down to the bottom, and you see these like five consecutive if statements, and you match all of these very specific criteria, you'll see it goes all the way down to a send can function.

16:59.600 --> 17:01.340
And that's what it allows you to do.

17:01.340 --> 17:12.220
And this secret function would allow you to arbitrarily wirelessly send whatever can messages you want, if you were connected over Bluetooth, Wi-Fi, anything like that.

17:13.980 --> 17:21.980
All right, so while I was doing this, I didn't have much experience with ESP32s, but I know that they're loved in the IoT community.

17:21.980 --> 17:31.640
And one of the things I knew about them is that they could simultaneously be an access point and a station, or a client and access point, essentially.

17:31.980 --> 17:41.220
And so this would allow us to create a worm, a device that would not only be able to execute the attack, but could also scan for and spread to other devices.

17:41.480 --> 17:45.100
So we get a lot of truck deliveries to our building where we were working.

17:45.220 --> 17:49.440
And we didn't really think it was worth it to build this full cyber weapon on the actual device.

17:49.440 --> 17:51.200
So we switched over to dev boards.

17:51.200 --> 17:53.280
And on these dev boards, we developed this worm.

17:53.280 --> 17:57.300
And essentially it does work exactly like how it would on the actual devices.

17:57.300 --> 18:04.180
It just goes ahead, uses the default credentials to log in, perform an over-the-air update, and copy itself onto the new device.

18:04.560 --> 18:05.900
So is this realistic?

18:06.140 --> 18:07.600
I would argue yes.

18:07.600 --> 18:09.440
Trucks congregate a lot.

18:09.440 --> 18:13.940
They have truck stops, gas stations, rest stops, ports, distribution centers, hubs.

18:14.260 --> 18:18.880
And if you've ever been on the highway, sometimes they take a really long time to pass each other.

18:19.400 --> 18:28.400
We found that with the normal ESP32 dev boards, we were able to get a total distance of about 120 feet in a dense parking lot.

18:28.400 --> 18:32.260
So this is between all of the different cars that were parked there.

18:32.260 --> 18:34.440
So that's about 12 parking spaces.

18:36.640 --> 18:48.300
Now, the other thing that we found that for many trucks, the diagnostic port is also left on all the time, which means that it can continually spread even while the driver is sleeping in one of those large sleeper trucks.

18:49.040 --> 18:50.360
So this is fixed, right?

18:50.360 --> 19:01.780
This ability for us to drive up alongside of a truck that's using these popular ELD devices, reflash it, and then control the vehicle, causing it to speed up, slow down, spread a worm, something like that.

19:01.880 --> 19:03.240
It's fixed.

19:03.260 --> 19:05.340
Well, IO6 responded great.

19:05.340 --> 19:08.940
They went ahead and they pushed out a patch to fix these issues.

19:09.020 --> 19:12.740
And they overall responded well to the vulnerability report.

19:12.740 --> 19:19.820
But these vulnerabilities arose from government-mandated, self-certified devices that lacked sufficient security standards.

19:19.820 --> 19:27.880
So we argue that since government regulators have little incentive to get security right, the problem is not fixed until that changes.

19:27.880 --> 19:28.820
Thank you.

