So we will get started. I think now is as good a time as any. Again, thank you for coming, spending your time, your DEF CON precious time with me. This is the car hackers version. So the main stage talk had a lot of background information. Today's information, I just assume that you know a little bit about hacking cars and we're just going to go. 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. That's how we see so far. We have lots of people that help us. Many are named on screen. There's many that are not named that write open-source software and contribute to open-source software and fix bugs, etc. All of this is only really possible because we all work together in that regard and we can stand so tall. So thank you to everybody on the slide and not. So we found some SeedKeyExchange and this is a car hacking talk. So if you know a little bit of car hacking, you're probably thinking, so what? You found SeedKeyExchange. I see that every day and we all know what SeedKeyExchange is, right? This is the authorization mechanism that protects diagnostic functions on cars. You find it in UDS, which is in CAN, but UDS is also now an automotive Ethernet in the form of DOIP. You also find SeedKeyExchange in the precursor to UDS known as KWP-2000, Keyword Protocol 2000. And SeedKeyExchange even existed in J1587, which was on J1708, which was a very old serial bus on trucks. So SeedKeyExchange in some form has been around for a long ass time. This is what it looks like on CAN. So because this is on CAN, the first layer is ISOTP, the ISO transport layer. That's what these first bytes are. It's telling you there's a 2-byte message here, 4-byte message, 4-byte message, 2-byte message. Then we have the service identifier. The security service for SeedKeyExchange is 27. So here's your 27. The next one, because we're dealing with UDS, is saying positive confirmation. That's plus 40 hex, 67, 27. This is an error. That should say 67. And then we have the subservice. This is give me a seed right here. And in the request, it gives you back the seed. Then the diagnostic software, or potentially the attacker, says here's the matching key. And then if those match, if the ECU sees a match, you're good, you unlock. There's no session control here, right? When the ECU is unlocked for this diagnostic software, it's unlocked for everything else on that CAN bus. And because this is a CAN bus, there is no integrity or confidentiality protection here on this bus. So an attacker that has access to the bus can actually see these messages as well. Which is what we all do when we're assessing our security, our diagnostic software security, right? I had this log. So here's a traffic capture of some data on J1708, or at least that's what the log says. And we were running the diagnostic session, the diagnostic tool, pushing buttons in the diagnostic tool and capturing this traffic. And we said, well, what's going on right here? 27, 67, 27, 67. Is that seed key exchange on J1708? Because that really looks like service 27. And that means it's probably UDS in J1708, which UDS is very new and J1708 is very old. This wasn't J1708 though. This was Powerline. We were doing diagnostic tools for a trailer brake unit on the Powerline network, which I'll talk about a little bit. It turned out it wasn't UDS. 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. And then, yeah, there's ISOTP there. And then these things here, ACFE89, 89FEAC, these are what are called data link escapes in J1708. And they are the proprietary space on that bus. So what we found here was seed key exchange in UDS on a bus that is really much newer, much older than that. We had a really new technology on a really old bus, and it's really weird. And of course, we found it in a trailer brake controller. The same one that you see hidden behind mud right here. And Powerline networks are what connect trailers, these things in the picture, to the tractors that tow them. For everything in North America since 2001. 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. So initially, we had categorized these as UDS services, but UDS services don't line up perfectly to KWP. 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. 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. We all know that when you're looking at diagnostic software, it relies very heavily on routine control, right? Hex 31. But the routine controls are always kind of proprietary. You send some data into routine control and something happens. It's not like it's documented what the extra data is in routine control. Very useful to say, okay, that was a three-byte routine control. That was a five-byte routine control. These are obviously somehow different. You can see that there is a heavy reliance on routine control, which shouldn't surprise you. We only really repeated the operation a few times, a handful of times, and yet there's like 20 security access calls. So this software is doing a whole bunch of spurious C key exchanges. 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. 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. But yeah, this is the kind of first step that we would take when we're looking at assessing diagnostic software logs. Yeah, I can do questions in the middle. What's up? Yeah. Well, so at this point, we only really had this J1708 log and we knew that there was the stack. So we knew there was like UDS data in here. To get to this point, we made a fake CAN driver that I'll tell you about in a little bit. So of course, what I love to do when I'm messing with trailers is a chuff test. Hopefully you can hear that. No, the audio did not work. I apologize. It is chuffing right now. I swear I have my volume up and they said it would work, but you'll hear... And this is actually a wireless test that we did on this tanker. So we are sending a request to reset the ECU and it is chuffing its brakes in response. Every time I get on a brake controller for trucks, I always start with the chuff test because chuff tests are demonstrable air control. So you're able to remove or control the air pressure in the pneumatic brake system. So there's an obvious cyber-physical impact. It's also really audible, right? 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. So it's a very great stand-in. It is only abuse of commands, right? And abuse being taking the software and making it do what they wrote the software to do. 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, right? No one intended me to wirelessly chuff the brakes. So it is just abuse. 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. That entire space is unexplored somewhat intentionally. 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. That's our hope. So yeah, just to underscore, this is abuse and not exploitation. So back to SeedKey Exchange. We're all car hackers here, right? Whenever we're getting to a diagnostic system, we want to assess the security of our SeedKey Exchange. There's a whole bunch of different ways to break it. I'm a big fan of attack trees as well as flags. This is an attack tree that I created a while ago for a training at Cybertruck. I see a few Cybertruck students in the audience. Thank you for coming. There's a lot of different ways to break this depending on what you have access to. If you have diagnostic software, you can actually extract a lookup table just by repeating requests through the diagnostic software. You can obviously go into the diagnostic software and reverse engineer the routine that has to be in there if it's not protected. If you have ECU firmware, reverse engineering is also possible. If you have a capture of the SeedKey Exchanges, which remember, this particular diagnostic software does about, you know, three or four per operation. So we get a lot of captures. You can either figure out the formula. That's this green one. Or you can just retry until the seed that you've recorded shows up again. So let's just go back quickly to SeedKey Exchange so I can drive that home. This is a challenge response protocol. 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. 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. 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. Right? 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. That's what this retry is about. Just keep retrying until you see the seed you already know and then send the key that matches. So there's a whole bunch of different ways to do retry until you win. One of them is known as the reset attack. 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. Okay, and we'll talk about a tool that does it as well. But of course, there's other ways to do the retry. 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. To begin with, try to get multiple seeds. Can I just keep requesting seeds without changing diagnostic session, without sending a key? Will it just let me brute force until I get the seed I want? Sometimes ECUs aren't written correctly, and they let you get one seed and try a key, try different keys multiple times. That is a weakness that has happened. There's also been a very specific weakness, where you could ask for a seed, send a key. If it said no, you could just change diagnostic session control level, and then try a different key. So there was a side effect in the DSC processor, where it would reset the try count. So it's these kind of things where we're trying to test these systems. And as testers, we should always assume, how could this go wrong? And then cook up a test based on that assumption of how it could go wrong. And one of them here is this time dependence. So many of you in the audience have probably used Caring Caribou, right? It's a pretty powerful tool that will run on any socket can system. Caring Caribou actually has modules for assessing the time dependence of seeds that are emitted. So it'll send a reset request, it'll wait for a delay, and then it'll send a seed request. And it does this repeatedly. And if it sees a repeated seed, it says, all right, you won. You're good. There's a vulnerability here. But if it doesn't say anything, then obviously we've tested the ECU and everything is fine, right? We ran Caring Caribou, we asked, hey, are there any time dependent seeds? And Caring Caribou said, no, you're good. Just move on, right? The problem is, there's timing slop, right? Caring Caribou sent a reset, did a little bit of a wait, and then asked for a seed. 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. There's no jitter in there. If there's any slop in there, and it is a time dependent seed, the time dependence will change the value of the seed. So, of course, you won't see a repeated seed. And that's why it has this iterations value. 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? Because this is just Python code. And under the hood, it's just running sleep in between reset and the seed request. Now, this is how we tested for time dependence the very first time on the trailer break controller. This is using a bash script and a Python script that we use to send messages and a Python sleep. 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. Like, I can see it in the repeated values. Do this 100 times, and you'll see some repetition. So even with Caring Caribou, we'll say yes or no. This method where you look at the plot will give you a better judgment. But look at the output. Let your eyes judge. When we did this, we almost immediately had the gut feeling that, yes, there was a time-dependent seed here. Now, I mentioned this to you, and we'll talk about it in some detail. I made a fake Python can driver, which ultimately actually let me script Scapy Automotive into the trailer brake controller. So this actually was interfacing with Powerline networks. And it's Scapy Automotive. And this was the version that, you know, runs as well. It's a little bit better. And this looks very much like Caring Caribou. But this one here, the sleep is still kind of... there's too much slop. There's too much potential jitter here. 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. But you have to remember, there's a lot of slop happening, not just in this sleep. There's slop happening every time you do ascent. Because there's buffers. There's buffers in between your Python code and the actual bus. There's a FIFO in the can controller. There's probably another FIFO in the driver for the can controller. If you're crossing the user space to kernel space boundary, there's another copy that happens there. There's all kinds of these buffers. Each one of them can introduce timing slop. So there are ways with can bit banging, in particular, to bypass a lot of that. 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. 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. For us, we were using J2497, which is the powerline bus. The powerline bus communicates in radio frequency range. So we were using SDRs. 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. And we just eliminated all of these sources of jitter. 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. And it connects over USB and there's a USB driver and that USB driver has buffers in it. And then your software in Windows has buffers and it's buffers all the way down introducing jitter. But our transmit method was just straight out through an SDR and we just cut all of that jitter out. 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. And we'll talk about that too. But, you know, we'll step back a little bit. We've all tested some ECUs. You have a seed, so what, right? Like a seed is not a key. That's the limitation of the reset attack, right? The reset attack lets you control the seed, but you still ultimately do need a key to match it to unlock the ECU. So how are you going to do that? I mean, one of the ways is if you're lucky, you see a seed you know, right? We have all these captures. And once we see a repeated seed, like I mentioned, it'll be the same key and then you're good. Now, reverse engineering is also possible, as I mentioned in that attack tree, et cetera, et cetera. What we wanted to do was demonstrate that, you know, reverse engineering wouldn't be necessary here. Although ultimately, yes, reverse engineering of the software was also possible. And we made an auto hotkey script, which is like this thing you do to automate UI interactions. And it just kind of goes click, click, click, click, click. And I would love to show you a video, but the video is of the actual supplier's software. We're not really interested in, you know, supplier shaming here. So I just did this thing in a loop, in a loop, in a loop. And I was chatting with my friend Haystack. 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. We had a chuckle about that. So we extracted about 200 of these seed key pairs. And that means that if we see the repetition, then we're good. We just kind of move on. Now that's useful in bench setups. 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. Obviously, you can get a matching key some way. And if we're on a bench, yeah, this is fine. We'll just retry until we see a seed. It isn't a useful method for, like, a malicious actor that's going to do a remote payload, for example, right? 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. You need to understand, like, what is this f of x here, right? And to do that, reverse engineering is possible. 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. So it was easy to do that. 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? 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. So, like, as humans, we look at this and we might think it's uncorrelated, right? It doesn't look like anything in particular. But what you can do and what attackers could do is make an assumption that it is perhaps linear, right? 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. In this particular case, yeah, this doesn't look linear, but it is linear. It's y equals mx plus b wrapped around by 16 bits, unfortunately. So attackers don't need many of these points to get the answer. You don't even have to stop at linear. You can always say, is it XOR and solve for XOR dragging. 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. You can create an, like, arbitrary equation and just let the computer do the work for you. All of this is possible, right? 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. Right, so where do we end up? We had the diagnostic software. Good. We were able to reverse engineer it. Yep, that was one of the things. We also had captures, and the captures were enough that we could solve for the constants. In a known equation, ultimately linear. And we could then retry until we saw the repeated one. We could have just stopped with the repeated one as well. All of this was possible. And attackers with more, you know, more resources could do other ways that you could think of it in this tree as well. So anyways, we unlocked this thing. That's great. Unlocking the controller means that you can do diagnostic actions, right? That's what we did. Um, we should test what services are available after we unlock. We should test the sub functions of those services. We should also see like that diagnostic seed key routine that we know now. Is it the same one for all the other levels in the ECU? Like ECUs have multiple diagnostic levels, multiple seed key routines. How powerful is this thing that they gave us in the diagnostic control? So we went through all of this. We cooked up this automotive SCAPI script that you see here, which tests whether keys can be retried. So you can test retry without knowing the seed. If you just assume that like the return codes are different. When you know the actual right seed, you can be 100% sure whether the return codes are not different or not. And here's an example. And of course, this will be on the media server. So you're welcome to use it. I'm a big fan of automotive SCAPI. It's very powerful. 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. So yeah, SR1. This is SCAPI. I think one of the benefits of using automotive SCAPI today is automotive Ethernet is coming at us like very rapidly. And really all the tooling that we're going to spin up, like our own custom tooling, we don't publish everything, right? 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. So it'll save us that ramp up time as we change technologies. It'll just still be SCAPI. Yeah, so how we did this? Sorry, it took me a while to get to your question. We actually faked PythonCAN. So if we go all the way back to that log at the beginning, ACFE89 and 89FEAC are the J1708 data link escape bytes. And they're saying it's a unicast message. It's a point-to-point message. And because it's FE, it's like escaped from 1708. It's not processed. It's opaque. And then right after that, you can see it's isotp. O2, there's a transport marker, 10. There's a flow control, 30. So it's isotp right on the next layer. And then UDS after that. So we just lied that this was CAN. And one of the interesting things is that every single one of these was 7 bytes. Now, Powerline and J1708 can actually take 211 bytes. 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. And inside the ECU, they're probably doing some version of the faking of the CAN bus that we did. 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. I hope it makes you happy, too. We have Python CAN connecting to RP1210, which is a very trucking-specific DLL. And then that RP1210 is opening J1587, which is a trucking-specific protocol. And then that's being converted in the adapter on J2487. So the stack just goes down and gets weirder and weirder, which I really like. And here's the driver code, roughly, for that fake Python CAN. It's actually pretty simple. It is very easy to write a fake or any Python CAN driver. 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, it's actually really easy to write a Python CAN driver. I did not delete much of the code here. And the entire code of this Python CAN driver is available in the white paper. 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. 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. And that's it. That's how we faked CAN. And it lets us do stuff like this, because SCAPI Automotive has a UDS scanner. And the UDS scanner code is capable of emulating the state space of the target ECU. It knows that certain UDS commands change the state of the ECU, and it models that state change of the ECU. And what we're looking at here is an adjacency matrix. It's like a directed graph of all the ways that the states can change. It's kind of like what you would look at for a finite state machine. 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. And then these edges are saying, I actually used DSC 135 to get there, but I could use DSC 134 for this edge. Now, this diagram, unfortunately, is unnecessarily complicated. If you look at the adjacency matrix version of this, it's just all connected. So this diagram looks very interesting, but it's ultimately telling you that every diagnostic session is reachable from every other diagnostic session. Sometimes when you look at ECUs, it's not fully connected. It's more like, oh, to get to this diagnostic session, you have to authenticate here first and then go to there. 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. And the code to do that is fairly straightforward. 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. And of course, the Scapi authors that are probably too many to name for the last 20 years, right? So it's a lot of reuse. And this code is nice and tight, and we get good outputs. You can also ask Scapi to enumerate security access levels. That's the SA enumerator here. And for those of you taking pictures, slides will be available. 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. So you're welcome to copy and paste it. It's all MIT-licensed. So please, free to reuse. 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? So now we have a two-dimensional map. And you can see in this table that 131, 130... I have to look at the screen, actually. 134 and 135 were all diagnostic levels that had different security access levels. So these security access levels were relevant for this DSC, these levels for that DSC. 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. I was asking for an invalid security level when I was doing this setup. So I should have actually done a skip in the scan range, and that's why you get NRs. But it tells us now, if we want to go to this security level, we have to first go to this DSC. And in this ECU, getting to the DSC is easy. We can get to any DSC from anywhere, but that's not always true in all ECUs. 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. These other SA levels and DSC levels are probably bootloaders, or other field service, or maybe engineering functions. And all of those use a different routine. 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. Although the vendor did confirm that this CVE did have a potential corruption of firmware impact later. So there is enough in the diagnostics still to be bad. A little bit of a segue before we go back to the actual CVE. I'll talk about that at the end. We're all car hackers here. I want to share with you something I'm passionate about, which is all the bench setups. So I love my bench. This is a picture of my bench on a clean bench day. The RS, the target, the roll stability system that we looked at is right here underneath this monkey. And this is my favorite desk mat, etc, etc. So you all have bench setups too. At the back here, there's a power line network. You can actually see a lamp connected there. And I have a battery underneath here. And you can see some power line messages happening on the oscilloscope. This is where I usually stand and do stuff. I'm sure you have a cool bench like that too. 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. Now these things need power. The absolute easiest way to power one of these things is a 12-volt battery. 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. Note that we call them 12-volt batteries. 12-volt is actually not a great voltage reading on one of these things. You do want a little bit more than that. And so we call them 12-volt batteries, but they're probably more like 15-volt batteries, ideally, right? 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. The chunky ones that we used to use on desktop computers, at least in my day. Actually, in my day it wasn't ATX, it was just AT. And you can get good 12-volt lines out of this. And it turns out that there's not a sufficient amount of noise to stop the power line. So this still works power line. The thing I wanted to share with you that I think is really useful is these USB PD triggers. So I use USB-C to power everything these days. And USB-PD is capable of giving you 12 and 15 and 20 and all kinds of voltages. You can actually power your entire trailer from this. 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. So they're very useful. 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. A lot of power supply output impedances, sorry, power supplies input impedance at this frequency looks like ground. Many power supplies are not well isolated. So when you try to generate these radio frequency signals, if you have the wrong power supply connected, it actually attenuates the signals. They just disappear and go to ground. This was a problem that actually happened during the fielding of J2497, like in 1999 and in 2000. 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. 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. Right here, you saw a little video of me reworking one of these triggers. It's really not hard to buy a surface mount inductor of about 100 microhenries. Any size will do, really. 100 microhenries was just easy to get. You just scrape some copper off, solder it down, and then any USB PD supply you use is now going to be Powerline compatible. And it makes testing things much, much easier. Another thing I love for testing, who loves lever nuts? Come on, we must have some lever nut lovers. Thank you very much. I appreciate that. Yes, I know you love lever nuts, actually. Thank you. Thank you for piping up. I love lever nuts. Um, something you may not know, the OEM Waggo lever nuts, Waggo, Waggo, are exactly the right size to fit banana jacks. Which is really great. These AliExpress ones are like, you know, I think $2 for a bag of 50. 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. Um, and then talking J2047. 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. There's a bunch of send only options, right? So the truck duck, the truck cape, these things have a way to bit bang J2497 and that's send only. You also can use an FL2K SDR, which are these VGA dongles that you can use for transmitting radio frequencies. 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. You can repurpose that Python code to send anything you like on J2497. So these are your send only options. 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. To me, I think there's a really great one made by DG Tech called the PLC-TESCON. And then the Noregon Systems PLC adapter is also really good in my experience. And these things essentially just convert from 1708 to 2497 and you're going to use 1708 in your software. Your software will just think it's using 1708. Under the hood, it's going to be using 2497. 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. I didn't cover it in this talk, but you can actually capacitively couple your SDR to the power line. 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. Which is essentially what we did. Here's how we inspected J2497. And when we injected it, it was just an SDR plugged in. 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. 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. 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. And the timings are really necessary because we did a blind version of the unlock. So previously, it's been disclosed that you can read this traffic remotely. You can also write this traffic remotely from roughly the same distance for a cheap amount. 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. But the bad news in all of this is that the most susceptible equipment in both cases was always tankers. The things that are just big hunks of metal ended up being the things that are the most susceptible. And the equipment that we're testing now is obviously tankers because they're that most susceptible. 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. 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. This was to demonstrate that that's not the case. You can have some replay protection, and if there's problems in that replay protection, then it ultimately gets reduced to the same thing. It's entirely possible for people to create a full duplex send and receive wireless J2497 interface. If they did that, they don't need to do these blind timing things. They can just send a request for a seed, look up the key, and send the unlock for the key. So it becomes simpler. The range may be reduced. 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. 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? It's even harder than what Karen Caribou does. Karen Caribou can actually read the thing back. We want to make sure that we sleep for a very specific amount of time after reset and send our diagnostic session control. So we need to find a spot here where the bus is quiet and the ECU is ready to receive that command. 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. Then again, process, wait for it's quiet, and then send our key to unlock this thing. This is like the POC of how you would do a wireless unlock. And every one of these sleeps has to be way more accurate than Python sleep. 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. The jitter is removed. We needed to know, though, what was happening when things came back, which is why we created these decoders. So down here, you can see a screenshot of a SideRock decoder output, and we set this up like glitch campaigns. 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. And it ends up looking at a lot of logs, and maybe you post-process the logs, but you're sweeping parameters, right? You try here, you try here, you try here. 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. But I didn't want to look at logs, and the behavior is very stateful as well, right? 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? I also really like looking at traces. So we wrote custom CyGrok tracers that would do the decoding, and then you get these nice colors. 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. And you can see it goes from purple to green. 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. So this is like what we would do with generating the signal. 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. So pretty accurate. And the culmination of all those decoders let us ultimately find all the quiet places. And if you want details for all the nitty gritty, it's in the white paper. But here is a screenshot of like the first time that we got kind of the same seed out again and again. 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? Trucks stop at stop signs and stop lights for minutes, right? We reasoned that if we could really get an attempt out in a two minute period, then we would be good, right? So how deterministic was this? We found that if we do a 30 second between retries, we have about a 50% chance of getting the seed right. And that's just like a hot loop. 30 seconds, try, try, try, try, try. 50% of the time we get the seed we wanted, which is actually still good enough for a stop sign or a stop light. 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. So the chance of having that first good seed is actually way higher than the repeated seeds. Yes, please go ahead. So it's really equipment dependent. We didn't do any in motion testing. 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? But it is possible for, you know, less than 10 grand to set this up in a mobile unit. It is possible. It's also possible for like less than a grand to set this up in a ditch from the side of the road. So these are all tractable situations to be sure. Thank you for the questions. I appreciate it. So we did get a CDE for this one. First contact was like February 2024. We claimed the following. Ultimately assigned a medium, which I think is accurate. I have no problem with that. In this case, it's a different CWE because this unit actually did have seed key exchange. It did have an authentication mechanism. In the past, the CWE was complete lack of authentication. In this case, it's broken authentication. There was also an ICSA advisory that was released right at the top of the year regarding this. So the impacts are a bit nuanced. 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. 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. And usually those things are much higher privileged and you're able to do bad things in those levels. So this is good news. That seed key routine is limited. Excellent. There is some bad news. 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. So this is not terrible news, but still that level is bad enough in some ways. 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. 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. This doesn't scale to arbitrary units. 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. In this case, we were able to obtain four different units. These things are expensive and they're deployed pretty heavily. And four was about as much as the resources that we have could get. In all four of the cases, they had different build dates. Two of them had the same firmware on them, but in all four cases, they had a different first seed. And this is not the real first seeds. There are some limitations to this good news. Like, we don't know for sure how uniformly distributed those first seeds are in the 16-bit space. It's only 16-bit numbers. There's 65,000 possible numbers. There's way more than 65,000 of these units on the road. And even if they had them perfectly uniformly distributed, it's still not a great answer. We're also not equipped to obtain 1,000 units and test 1,000 units and decide how well-spaced that is. We feel the vendor has access to the firmware. They should be able to do that. Reverse engineering would answer this question. We're not going to proceed with reverse engineering to answer that question. We feel that it's the responsibility of the vendor to decide how uniformly distributed that is. And yeah, this isn't just about a blind attack, right? Remember, we did the blind attack so it was the minimum possible equipment for wireless access. We wanted to demonstrate that it's not true that any replay protection saves you from this wireless attack. It's possible that your replay protection is also broken and can be reduced to this attack. 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. There's four different suppliers of internet-connected trailer telematics that do active diagnostics of the ECUs. 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? So the problem here isn't just the CVE, it's a more systematic one. 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. 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. It's very akin to the early days of automotive and the early days of trucking CAN bus stuff. So we've been busy. We did the coordinated disclosure. These things take time. I'm sure you're all familiar with that. 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. So today we have this Powerline connection in the near future. I hope. They've been saying this for years. In the near future, we're going to have a CAN bus connection and possibly automotive Ethernet between the trucks and the trailers. And if you look at the ATATMC documentation that's produced, there is security requirements in it. And we hope that SAE looks at those. 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. 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. The Truck and Bus Committee did agree to reopen it. There has been two different discussions of document changes that we proposed in two different quarterly meetings. So we feel that's moving forward in a good way. These things take time. We have also published proof of concept mitigation. 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. 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. We gave you the software to do that . It's not going to take a lot to protect a trailer. It's just a little bit of deployment of some more code. Blind code, in fact. 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. So in conclusion, these timing attacks are generally applicable. It's not just CAN. You can do this in all kinds of weird places. If you want to know more about the CAN stuff, I highly recommend reading Sagar's paper, CANDAN. If you're going to be assessing time dependence of seeds, you have to make sure that you have very jitter-free timing. Right? If it is a time-dependent seed and you actually have jitter in your timing, you might not know that it's time-dependent. You need to have very reliable timing to be sure about that. Scapi Automotive is awesome. I think that's the conclusion. I hope you agree. And we found some novel ways to use, you know, previous J2497 stuff to make this happen. Here is the QR code for the white paper. It should be free to access without, like, a paywall or a login wall or anything. All the code is copy and pasteable. My contact information is there. This is the email of my boss. If you don't like anything I said, you can tell him that I shouldn't have said it. And I really do appreciate your attention to this matter. Thank you for your time today. Thank you. If there is a couple questions, but I am going to run to a CTF otherwise. Okay. Thank you. Thank you very much. Bye, everybody.