1 00:00:00,860 --> 00:00:08,260 That was quite the introduction for compromising an electronic logging device and creating a truck-to-truck worm. 2 00:00:08,300 --> 00:00:09,800 But that's what we're going to be talking about. 3 00:00:09,800 --> 00:00:10,680 So, my name is Jake. 4 00:00:10,680 --> 00:00:11,860 This is Rick. 5 00:00:11,860 --> 00:00:14,360 And, Rick, take it away. 6 00:00:15,700 --> 00:00:17,200 Thanks, Jake. 7 00:00:18,340 --> 00:00:26,140 So, we are systems engineering master's students from Colorado State University and we work with Dr. 8 00:00:26,140 --> 00:00:32,360 Jeremy Daly and primarily concentrate our research on cybersecurity of heavy vehicles. 9 00:00:34,040 --> 00:00:38,580 And, here's a video of the work we have done. 10 00:00:38,580 --> 00:00:39,980 Hopefully, it plays. 11 00:00:48,130 --> 00: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. 12 00:00:59,950 --> 00:01:01,650 We were successful in this attack. 13 00:01:01,650 --> 00:01:03,770 The car broke up alongside it. 14 00:01:03,770 --> 00:01:08,930 About 30 seconds later, the truck begins to slow down and the car pulls out. 15 00:01:09,130 --> 00:01:10,750 This is a wireless attack. 16 00:01:10,750 --> 00:01:16,050 It gives us the freedom to explore creative attack vectors, including flying a drone. 17 00:01:16,050 --> 00:01:19,570 Critical infrastructure is becoming more and more connected, including trucks. 18 00:01:19,570 --> 00:01:22,290 One of the reasons is due to the ELD mandate. 19 00:01:22,290 --> 00:01:26,510 When the ELD mandate first came out, it did not have much security in it. 20 00:01:26,510 --> 00:01:28,970 They couldn't use many security improvements. 21 00:01:28,970 --> 00: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. 22 00:01:43,760 --> 00:01:50,700 Basically, what we did is, as far as we know, the first wireless drive-by attack on a truck. 23 00:01:53,940 --> 00:01:55,940 I was driving the truck. 24 00:01:55,940 --> 00:01:59,460 Ray got to drive the smooth Tesla by it. 25 00:02:00,540 --> 00: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. 26 00:02:09,740 --> 00:02:14,160 After about 30 seconds, after the firmware was loaded, the device rebooted. 27 00:02:14,420 --> 00:02:18,920 Basically, what happened was the car pulled ahead and the truck started to slow down. 28 00:02:20,140 --> 00:02:24,740 What we found and what we did was that the accelerator pedal stopped working. 29 00:02:24,820 --> 00:02:28,760 It was stuck in idle, and that's why we could not move the truck any forward. 30 00:02:31,360 --> 00:02:37,320 So, a bit of background on what happened, why we did, and why we chose to do that. 31 00:02:39,080 --> 00:02:44,560 The first big question that comes up is, why do we do research on commercial vehicles? 32 00:02:45,280 --> 00:02:50,200 Well, one simple answer to that thing is, they are very important to the supply chain. 33 00:02:50,480 --> 00:02:55,060 And I think the pandemic gave us a good lesson on why it's important to the supply chain. 34 00:02:55,060 --> 00:03:00,900 The shortages were pretty obvious, what lack of trucks on the road can do. 35 00:03:00,920 --> 00:03:05,340 And they are considered part of critical infrastructure for that very same reason. 36 00:03:07,260 --> 00:03:09,020 What's under the hood of trucks? 37 00:03:09,360 --> 00:03:13,220 Well, basically, modern trucks are very much electronical. 38 00:03:13,220 --> 00: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. 39 00:03:23,060 --> 00: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. 40 00:03:32,320 --> 00:03:37,600 In most trucks here in the United States, they say J1939 is the standard of choice. 41 00:03:38,280 --> 00:03:42,980 And most trucks on the road do use that standard for communication between these ECUs. 42 00:03:45,580 --> 00:03:50,140 Now, what are electronic logging devices and how did they come into trucks? 43 00:03:50,900 --> 00: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. 44 00:03:59,980 --> 00:04:06,700 The goal of an ELD is to record hours of service because paper logs are not reliable enough. 45 00:04:06,700 --> 00:04:14,560 Truckers would more often than not be honest in those paper logs and keep driving more than the allotted hours. 46 00:04:14,600 --> 00: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. 47 00:04:22,580 --> 00: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. 48 00:04:31,420 --> 00: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. 49 00:04:40,400 --> 00: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. 50 00:04:50,140 --> 00: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. 51 00:05:00,140 --> 00: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. 52 00:05:11,420 --> 00:05:16,840 And that write access may create a problem if exploited. 53 00:05:17,460 --> 00: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. 54 00:05:37,420 --> 00: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. 55 00:05:54,420 --> 00: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. 56 00:06:05,900 --> 00:06:13,580 The other big problem is most trucks have started incorporating gateways, which basically act as firewalls. 57 00:06:13,580 --> 00:06:20,720 They sit between your diagnostic port and the internal components which need to be shielded from attacks. 58 00:06:21,660 --> 00:06:27,560 The other thing is that it's a device that plugs in, so plugging it out would stop the attack. 59 00:06:28,780 --> 00: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. 60 00:06:39,840 --> 00:06:45,720 But doing a deeper dive into the world of ELDs reveals something entirely different. 61 00:06:46,420 --> 00: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. 62 00:07:01,440 --> 00:07:05,740 Okay, that takes out 880 and leaves us with 10 to look at. 63 00:07:05,920 --> 00:07:13,560 The other problem is gateways, but gateways have become popular most recently, and trucks run for a lot of time. 64 00:07:13,560 --> 00:07:18,400 They run for 20, 30 years on the road, and gateways are relatively modern. 65 00:07:18,700 --> 00:07:22,460 So most trucks out on the road today don't have gateways. 66 00:07:22,660 --> 00:07:26,720 So the question of having a firewall inside a truck is gone. 67 00:07:27,060 --> 00: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. 68 00:07:49,380 --> 00: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. 69 00:08:03,620 --> 00:08:09,080 So actually finding out the issue becomes a big problem if an attack is launched through an ELD. 70 00:08:10,580 --> 00: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. 71 00:08:20,940 --> 00:08:26,380 With that, I would like to hand it over to Jake to go into the in-depths of this research. 72 00:08:30,880 --> 00: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. 73 00:08:39,280 --> 00:08:49,280 This was the first big thing that I've reverse-engineered and therefore, in comparison to CTS and stuff like that. 74 00:08:49,680 --> 00:08:55,500 Alright, so real quickly, I want to make it clear that I'm not up here to shame the company. 75 00:08:55,820 --> 00:08:59,100 In my opinion, all companies have security vulnerabilities. 76 00:08:59,100 --> 00:09:01,160 Some might not have been found yet. 77 00:09:01,160 --> 00:09:04,840 But this company did a great job in their response. 78 00:09:04,840 --> 00:09:11,000 So we did a responsible disclosure with them and they ended up putting out a patch. 79 00:09:11,360 --> 00:09:14,160 And in our opinion, they responded pretty well. 80 00:09:15,460 --> 00:09:17,000 So one day, Dr. 81 00:09:17,000 --> 00:09:22,820 Daly, which is our advisor, just went onto Amazon and he bought some of these devices. 82 00:09:22,900 --> 00:09:25,060 It's actually... oh, screens are up there. 83 00:09:25,060 --> 00:09:27,200 It's actually the little disk, right? 84 00:09:27,200 --> 00:09:28,500 So it's about this big. 85 00:09:28,500 --> 00:09:32,200 And the reason he bought them is that they all look very similar. 86 00:09:32,280 --> 00:09:33,320 And they work. 87 00:09:33,320 --> 00:09:37,760 They were the exact same devices being sold by many different major brands. 88 00:09:37,760 --> 00:09:42,240 So the devices are IO6, IO1020 micro-ELDs. 89 00:09:42,240 --> 00:09:45,680 We found that this device was sold by like 50 plus different brands. 90 00:09:46,120 --> 00:09:50,020 And this is kind of commonplace in the ELD industry. 91 00:09:50,020 --> 00:09:54,880 So as Rick mentioned before, these devices come with additional wireless networks on them. 92 00:09:54,880 --> 00:09:59,360 So this one had Bluetooth and GPS, which were mentioned in the manual. 93 00:09:59,360 --> 00: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? 94 00:10:12,300 --> 00:10:18,180 So that's kind of the first thing that kind of was a clue initially. 95 00:10:18,360 --> 00:10:23,120 And if you go ahead and look at the picture of the PCB, that's the PCB of the board. 96 00:10:23,120 --> 00:10:25,220 It's an ESP32-based device. 97 00:10:25,320 --> 00:10:29,440 And that port right there is kind of what we're going to talk about next. 98 00:10:29,440 --> 00:10:33,100 So it was labeled PROG, which we assumed was likely programming. 99 00:10:33,100 --> 00:10:34,700 It's an ESP32 device. 100 00:10:34,700 --> 00: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. 101 00:10:42,420 --> 00:10:47,020 And checking the eFuses allowed us to determine that it had no protections on it at all. 102 00:10:47,020 --> 00:10:49,580 So we could go ahead and just dump the firmware off of it. 103 00:10:49,640 --> 00:10:52,900 And the first thing we're going to do with the firmware is run strings on it. 104 00:10:52,920 --> 00:10:56,800 And normally you don't hit the jackpot with just strings. 105 00:10:56,800 --> 00:10:58,420 But in this case, we did. 106 00:10:58,420 --> 00:11:03,300 So as we're looking through strings, I come across that SSID. 107 00:11:03,380 --> 00:11:09,560 And then two lines down, I see what I can only describe as a Wi-Fi password. 108 00:11:09,560 --> 00:11:10,700 And that is what we found. 109 00:11:10,700 --> 00:11:14,220 It was the hard-coded default Wi-Fi password for this device. 110 00:11:14,220 --> 00:11:21,060 We continue scrolling down, and we start seeing stuff about web servers and these endpoints, this slash upload.php. 111 00:11:21,060 --> 00:11:23,480 It's talking about OTAs and flashing. 112 00:11:23,480 --> 00:11:24,980 But it needs a key. 113 00:11:25,160 --> 00: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. 114 00:11:31,260 --> 00:11:33,640 And I'll let you figure out what's in between that. 115 00:11:33,680 --> 00:11:40,080 And that was the hard-coded key that protected the over-the-air updates for this device. 116 00:11:42,120 --> 00:11:42,780 All right. 117 00:11:42,780 --> 00:11:47,420 So once we now got onto the Wi-Fi network, of course, we can go ahead and do an NMAP scan. 118 00:11:47,420 --> 00:11:51,820 The NMAP results there are incomplete, but essentially it would find three services. 119 00:11:51,820 --> 00:11:54,520 We had a Telnet service on port 23. 120 00:11:54,520 --> 00:11:55,900 We had SSH. 121 00:11:55,900 --> 00:11:58,660 Well, NMAP thought it was SSH on port 22. 122 00:11:58,660 --> 00:12:00,300 I did not think it was that. 123 00:12:00,540 --> 00:12:02,960 And then we had an HTTP server on port 80. 124 00:12:02,960 --> 00:12:07,860 So if we look at the screenshot of the HTTP server, we can see it's listing serial version. 125 00:12:07,900 --> 00:12:10,600 And then we have that key and a little bit of foreshadowing. 126 00:12:10,600 --> 00:12:15,520 We have a firmware-mal standing for a malicious firmware that we created. 127 00:12:16,040 --> 00:12:16,600 All right. 128 00:12:16,600 --> 00:12:19,960 So this slide is, of course, the part that takes the longest. 129 00:12:19,960 --> 00:12:21,380 This is the reverse engineer. 130 00:12:21,380 --> 00:12:24,220 We found a device that has these vulnerabilities. 131 00:12:24,220 --> 00: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. 132 00:12:31,520 --> 00:12:33,060 But now what do we do with that? 133 00:12:33,060 --> 00: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. 134 00:12:41,820 --> 00:12:44,800 So this was on ESP32. 135 00:12:44,920 --> 00:12:50,100 So the code for it is Extensa. 136 00:12:50,160 --> 00:12:52,140 And Extensa was not well supported. 137 00:12:52,140 --> 00:12:53,980 It's now officially supported by Ghidra. 138 00:12:53,980 --> 00:12:59,220 But at the time, it was not on any of the major ones that I at least had the money for. 139 00:12:59,680 --> 00:13:01,880 And so we were looking at community support. 140 00:13:01,880 --> 00:13:06,020 And the best community support was for Ghidra at the time, but still needed a lot of work. 141 00:13:06,020 --> 00:13:12,080 So after spending weeks fixing up the decomp and going through all that, I had a bunch of flows. 142 00:13:12,260 --> 00:13:15,960 And it's kind of hard to describe what I mean by flows, but essentially I had a bunch of functions. 143 00:13:15,960 --> 00:13:17,420 They all kind of connected to each other. 144 00:13:17,420 --> 00:13:19,440 It was clear what their purpose was. 145 00:13:19,440 --> 00:13:23,820 But I was missing the thing that connected them and the main function. 146 00:13:23,820 --> 00:13:25,640 And that was a giant thing. 147 00:13:25,640 --> 00:13:27,020 I still don't have main. 148 00:13:27,020 --> 00:13:30,560 So I did what any good hacker would do, is I went snooping. 149 00:13:30,560 --> 00:13:32,900 And I learned that there's an Expressive Forms. 150 00:13:32,900 --> 00:13:34,900 I created an account, logged on. 151 00:13:34,900 --> 00:13:39,200 And after looking around, I found that there is an account called io6llc. 152 00:13:39,220 --> 00:13:45,700 And I guess that was probably related to someone that was working at that company. 153 00:13:45,700 --> 00:13:49,020 And most of their questions and that stuff were pretty normal. 154 00:13:49,020 --> 00:13:55,400 They were either reporting bugs or they were asking about help for certain things. 155 00:13:55,400 --> 00:14:00,160 But on one of them, they posted a full crash dump, which was beautiful. 156 00:14:00,160 --> 00:14:04,480 Because if we look at the crash dump, we can see it's talking about having a bunch of different threads. 157 00:14:04,680 --> 00:14:07,300 And it actually gives names to each of those threads. 158 00:14:07,480 --> 00: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. 159 00:14:18,880 --> 00:14:23,680 So now that I had that, I was actually able to get the full picture of how it all worked. 160 00:14:23,800 --> 00:14:26,980 And we went from there. 161 00:14:27,760 --> 00:14:32,460 So quick overview of the vulnerabilities that were discovered through the reverse engineer. 162 00:14:32,460 --> 00:14:35,700 We already talked about the default network credentials. 163 00:14:36,560 --> 00:14:41,060 And we had this web server that seemingly was unused by these resellers. 164 00:14:41,140 --> 00:14:43,560 But it was always on and it was always there. 165 00:14:43,560 --> 00:14:46,600 We had Bluetooth and Wi-Fi being on at the same time. 166 00:14:46,600 --> 00:14:48,280 Firmware wasn't being signed. 167 00:14:48,280 --> 00:14:51,600 Firmware updates were protected by the weak password. 168 00:14:52,120 --> 00:14:58,220 And then what I ended up finding was that service on port 22 was actually a debug service. 169 00:14:58,220 --> 00:15:03,460 It essentially acted as an echo server, which we had no use for. 170 00:15:03,460 --> 00: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. 171 00:15:11,180 --> 00:15:12,680 It was in its own thread. 172 00:15:12,680 --> 00:15:16,520 We didn't have to make any trampolines out for space or anything like that. 173 00:15:16,520 --> 00:15:21,700 And so we went ahead and just put in a pretty simple little bit of malicious code. 174 00:15:21,700 --> 00:15:25,200 And it's what you kind of see on the screen up there. 175 00:15:25,460 --> 00:15:28,280 And so essentially this would check a status variable. 176 00:15:28,280 --> 00:15:34,040 And once the status variable was equal to certain conditions, we knew that CAN was initialized. 177 00:15:34,040 --> 00:15:36,440 And it actually had a connection to the CAN bus. 178 00:15:36,440 --> 00:15:40,720 And then at this point, we just went ahead and spammed TSC1 messages. 179 00:15:40,940 --> 00:15:44,520 TSC1 messages are Torque Speed Control 1 messages. 180 00:15:44,520 --> 00: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. 181 00:15:51,800 --> 00: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. 182 00:15:57,580 --> 00:16:00,500 But we could have also sped up the truck as well. 183 00:16:01,980 --> 00:16:05,520 In terms of like how long it takes, it's a wireless attack. 184 00:16:05,520 --> 00:16:08,500 So if you're really close to the device, it goes pretty quickly. 185 00:16:08,500 --> 00:16:11,180 It can go in like 30 seconds, the entire thing. 186 00:16:11,180 --> 00:16:14,060 But the farther you move away, the longer it takes. 187 00:16:14,980 --> 00:16:19,080 We also found that the service on port 23 was this Telnet service. 188 00:16:19,080 --> 00: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. 189 00:16:31,100 --> 00:16:33,460 Unfortunately, those weren't being used. 190 00:16:33,460 --> 00:16:35,060 And then we found something interesting. 191 00:16:35,060 --> 00: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. 192 00:16:46,780 --> 00: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. 193 00:16:59,600 --> 00:17:01,340 And that's what it allows you to do. 194 00:17:01,340 --> 00: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. 195 00:17:13,980 --> 00: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. 196 00:17:21,980 --> 00: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. 197 00:17:31,980 --> 00: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. 198 00:17:41,480 --> 00:17:45,100 So we get a lot of truck deliveries to our building where we were working. 199 00:17:45,220 --> 00:17:49,440 And we didn't really think it was worth it to build this full cyber weapon on the actual device. 200 00:17:49,440 --> 00:17:51,200 So we switched over to dev boards. 201 00:17:51,200 --> 00:17:53,280 And on these dev boards, we developed this worm. 202 00:17:53,280 --> 00:17:57,300 And essentially it does work exactly like how it would on the actual devices. 203 00:17:57,300 --> 00: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. 204 00:18:04,560 --> 00:18:05,900 So is this realistic? 205 00:18:06,140 --> 00:18:07,600 I would argue yes. 206 00:18:07,600 --> 00:18:09,440 Trucks congregate a lot. 207 00:18:09,440 --> 00:18:13,940 They have truck stops, gas stations, rest stops, ports, distribution centers, hubs. 208 00:18:14,260 --> 00:18:18,880 And if you've ever been on the highway, sometimes they take a really long time to pass each other. 209 00:18:19,400 --> 00: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. 210 00:18:28,400 --> 00:18:32,260 So this is between all of the different cars that were parked there. 211 00:18:32,260 --> 00:18:34,440 So that's about 12 parking spaces. 212 00:18:36,640 --> 00: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. 213 00:18:49,040 --> 00:18:50,360 So this is fixed, right? 214 00:18:50,360 --> 00: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. 215 00:19:01,880 --> 00:19:03,240 It's fixed. 216 00:19:03,260 --> 00:19:05,340 Well, IO6 responded great. 217 00:19:05,340 --> 00:19:08,940 They went ahead and they pushed out a patch to fix these issues. 218 00:19:09,020 --> 00:19:12,740 And they overall responded well to the vulnerability report. 219 00:19:12,740 --> 00:19:19,820 But these vulnerabilities arose from government-mandated, self-certified devices that lacked sufficient security standards. 220 00:19:19,820 --> 00: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. 221 00:19:27,880 --> 00:19:28,820 Thank you.