1 00:00:00,000 --> 00:00:03,860 This is a talk called Understanding Heavy Truck Event Data. 2 00:00:04,440 --> 00:00:05,680 With part two. 3 00:00:05,700 --> 00:00:08,980 With part two, he's going to talk about something about electronics. 4 00:00:10,400 --> 00:00:12,980 I'm a software guy. I never understand anything he says. 5 00:00:13,620 --> 00:00:14,860 So what does this talk about? 6 00:00:15,540 --> 00:00:18,860 It's about data stored on heavy truck engine control modules, 7 00:00:19,160 --> 00:00:20,860 communicating with them, 8 00:00:20,960 --> 00:00:23,880 and reverse engineering proprietary diagnostic protocols 9 00:00:23,880 --> 00:00:28,940 used by heavy truck ECMs in the context of accident reconstruction. 10 00:00:31,320 --> 00:00:35,520 So the outline, background information, you know, what are ECMs, 11 00:00:35,540 --> 00:00:37,360 and what is HVEDR data? 12 00:00:37,980 --> 00:00:40,240 That's mostly what I deal with on a day-to-day basis. 13 00:00:40,700 --> 00:00:46,240 And then I'm going to work through an example of reverse engineering ECM network data. 14 00:00:48,200 --> 00:00:53,600 So heavy truck crashes, semi-trucks, big over-the-road trucks haul lots of stuff. 15 00:00:54,040 --> 00:00:58,020 They crash into stuff all the time. 16 00:00:58,940 --> 00:00:59,980 In 2008. 17 00:01:00,000 --> 00:01:05,060 There were 380,000 of these things involved in trucks just that year, 18 00:01:05,100 --> 00:01:07,000 or involved in crashes just that year. 19 00:01:07,400 --> 00:01:09,560 4,000 of which were fatal. 20 00:01:10,500 --> 00:01:15,560 And 66,000 were injury crashes, including the fatalities. 21 00:01:16,120 --> 00:01:21,140 Average cost per crash, according to, I think, NHTSA, is over $148,000. 22 00:01:22,140 --> 00:01:26,180 If it's an injury crash, that goes up to $331,000. 23 00:01:26,720 --> 00:01:29,980 And if there's a fatality, that goes up to $7,000. 24 00:01:31,560 --> 00:01:32,600 Yes, in the U.S. 25 00:01:35,700 --> 00:01:40,140 Expensive crashes lead to lawsuits, and lawsuits lead to forensic examination, 26 00:01:41,780 --> 00:01:45,540 which gives rise to the field, the profession of accident reconstruction. 27 00:01:45,640 --> 00:01:50,960 So the accident reconstructionist's job is to review the data and determine who is at fault. 28 00:01:51,900 --> 00:01:56,480 If they're law enforcement, that could lead to criminal charges, charges of negligence. 29 00:01:56,940 --> 00:01:59,980 And if they're private and they're working for an insurance company, that could lead to criminal charges, charges of negligence. 30 00:01:59,980 --> 00:02:01,860 If they're private and they're working for an insurance company, that can lead to civil claims. 31 00:02:03,200 --> 00:02:07,200 So the parties involved are insurance companies, law enforcement, and attorneys. 32 00:02:07,500 --> 00:02:11,900 Those are the three people who you always try to avoid in your day-to-day life. 33 00:02:11,980 --> 00:02:14,460 Insurance companies, cops, and lawyers. 34 00:02:15,380 --> 00:02:18,460 Those are who I have to deal with all the time, so feel bad for me. 35 00:02:20,300 --> 00:02:21,260 Scientific reconstruction. 36 00:02:22,520 --> 00:02:29,440 TIPIC traditionally uses physical evidence, such as deformation of the vehicle and measuring skid marks on the road. 37 00:02:29,980 --> 00:02:37,720 You can do some math with weight of the vehicle, coefficients of friction, and then figure out who is going how fast, and who hit who when. 38 00:02:38,840 --> 00:02:43,860 In recent years, you end up with these things called event data recorders. 39 00:02:44,920 --> 00:02:48,380 So this, those of you who are sitting close enough can see this. 40 00:02:48,480 --> 00:02:50,480 It's a passenger vehicle event data recorder. 41 00:02:50,760 --> 00:02:52,160 It's its own dedicated box. 42 00:02:52,900 --> 00:02:54,780 Usually there will be somewhere under the dash. 43 00:02:56,780 --> 00:02:59,280 People call them black boxes, almost none are black. 44 00:02:59,280 --> 00:03:05,320 This is one of my pet peeves. They're all silver. So if you want to call them silver boxes, that's fine, but not black boxes 45 00:03:06,240 --> 00:03:11,400 They're typically integrated into an airbag control module and they depending on the model 46 00:03:11,400 --> 00:03:17,420 They weren't standardized until just a couple years ago. So it was kind of a crapshoot what you'd get before then 47 00:03:18,160 --> 00:03:26,260 And they would record speed before the crash brake usage whether or not the driver was buckled up stuff like that 48 00:03:26,260 --> 00:03:28,940 And it's a purpose purpose-built device 49 00:03:29,560 --> 00:03:35,500 Which is great for forensics it all this thing does is it wakes up it decides hey 50 00:03:35,500 --> 00:03:41,520 Do I need to deploy the airbags if it does then it records what's called a deployment event if it doesn't it recalls what it? 51 00:03:41,560 --> 00:03:48,020 records what's called a non deployment event and then it's read by a special tool called the Bosch CBR kit in most cases and 52 00:03:48,940 --> 00:03:50,500 That's it for forensics. That's great 53 00:03:51,380 --> 00:03:55,460 Heavy vehicle EDRs are a completely different beast. They're not legislated 54 00:03:56,260 --> 00:03:59,180 Heavy trucks are not required to have them. I think what happened was 55 00:03:59,180 --> 00:04:06,860 The government regulators went to the heavy trucking industry and said hey you should really really include this stuff in your ease in your engine 56 00:04:06,860 --> 00:04:07,700 control modules 57 00:04:08,420 --> 00:04:12,400 Otherwise, we may be forced to legislate you. This is not a veiled threat 58 00:04:12,920 --> 00:04:17,140 It was a veiled threat. So they all began implementing this stuff 59 00:04:19,220 --> 00:04:25,680 Began showing up in the early 90s as an add-on but nowadays it's standard in pretty much all of them 60 00:04:26,260 --> 00:04:31,800 And it's extracted using maintenance software not actual forensic software like the Bosch CBR kit 61 00:04:31,800 --> 00:04:35,940 it's the same stuff that you would use for driver information reporting or 62 00:04:38,000 --> 00:04:40,320 Diagnostic maintenance and diagnostics 63 00:04:41,540 --> 00:04:42,140 so 64 00:04:42,840 --> 00:04:49,900 The data like I said, it's control. It's in the engine control module whose primary focus is controlling injector timing 65 00:04:51,380 --> 00:04:55,900 You know all the stuff that an engine computer does to keep the engine running, right? 66 00:04:56,620 --> 00:04:59,480 Because the if you if you caught our talk on Friday 67 00:04:59,480 --> 00:05:05,860 I think we talked about how data hungry the trucking industry is. They said oh we have these computers and 68 00:05:06,560 --> 00:05:08,620 they can store data and 69 00:05:09,180 --> 00:05:14,220 We can do we can gather all this data that will help our fleet customers be more efficient in their business 70 00:05:14,840 --> 00:05:17,700 So maintenance history they track driver behavior 71 00:05:18,360 --> 00:05:25,900 Some ECMs actually have a mechanism where if a driver is really good on fuel economy, it'll raise the vehicle 72 00:05:26,260 --> 00:05:28,740 Speed limit for a little bit that's called the driver reward 73 00:05:28,740 --> 00:05:34,660 So if you're really good, it'll let you cheat on the speed governor a little bit, which is an interesting 74 00:05:35,460 --> 00:05:35,940 interesting 75 00:05:37,920 --> 00:05:38,760 Motivational tool 76 00:05:39,500 --> 00:05:42,980 It also stores fault codes so mechanical faults, you know 77 00:05:42,980 --> 00:05:48,060 If your car is throwing a check engine light you go to down to O'Reilly's and have that cheap little scanner same kind of thing 78 00:05:48,060 --> 00:05:55,500 But more full-featured and well, we're interested in crash event data and all of this may be interesting in a forensic context 79 00:05:55,500 --> 00:06:03,000 So maintenance data if you can prove if you can support a narrative where the fleet was negligent on maintenance 80 00:06:03,000 --> 00:06:05,420 You can go to the fleet and sue them or 81 00:06:06,280 --> 00:06:07,420 pursue criminal charges 82 00:06:08,940 --> 00:06:13,820 So issues with heavy vehicle ECM forensics the maintenance software is not 83 00:06:14,820 --> 00:06:18,920 Great as a forensic tool usually many of them delete evidence 84 00:06:19,800 --> 00:06:25,420 Some of them if you forget to uncheck a box it clears all this data on other ones 85 00:06:25,940 --> 00:06:29,180 If you click next and then it comes up 86 00:06:29,180 --> 00:06:30,440 Do you want to delete this data? 87 00:06:30,560 --> 00:06:35,240 Yes or no and yes is right under where your mouse was to click next before so if you're not paying attention 88 00:06:35,240 --> 00:06:36,820 stupid stuff like that 89 00:06:39,380 --> 00:06:42,140 It's also stored in securely if you 90 00:06:42,700 --> 00:06:44,080 This that's a different talk 91 00:06:44,080 --> 00:06:49,780 But the cryptography that they use for their secure file format is stuff like a password protected zip file 92 00:06:49,780 --> 00:06:52,360 And it's all one password and I have it written down someplace 93 00:06:53,680 --> 00:06:55,020 and vehicle impacts 94 00:06:55,020 --> 00:07:03,140 Frequently cause data loss imagine that so if you're storing your data in such a way that 95 00:07:03,140 --> 00:07:09,340 The thing that you're trying to record causes your software to not read it properly. That is a problem 96 00:07:11,200 --> 00:07:15,040 Speaking of data loss, so I'm gonna just kind of run through a case study 97 00:07:15,040 --> 00:07:18,560 It's kind of boring if you if you just talk about this stuff in general 98 00:07:18,560 --> 00:07:22,860 So I'm gonna go over a specific case where we solve this problem 99 00:07:25,020 --> 00:07:26,040 Let's play this video 100 00:07:31,760 --> 00:07:34,240 I hate computers 101 00:07:36,880 --> 00:07:37,380 Go 102 00:07:37,380 --> 00:07:38,140 I 103 00:07:38,140 --> 00:07:38,640 I 104 00:07:42,120 --> 00:07:43,120 I 105 00:07:43,120 --> 00:07:44,240 I 106 00:07:44,240 --> 00:07:44,360 I 107 00:07:44,360 --> 00:07:44,860 I 108 00:07:57,280 --> 00:07:57,720 I 109 00:07:57,720 --> 00:08:01,200 Did it seriously just copy over the ScreenShot 110 00:08:02,000 --> 00:08:02,940 bool pul � يbear 111 00:08:02,940 --> 00:08:03,660 bool pul 112 00:08:05,840 --> 00:08:06,720 P conten dią vividão de can leis combatie 113 00:08:06,720 --> 00:08:10,180 Ok, I have some still images of the aftermath in a few slides 114 00:08:10,180 --> 00:08:13,260 Ok I have some still images of the aftermath in a few slides so we're just going to go off of those imagine that that city bus over 115 00:08:13,260 --> 00:08:14,420 Ok, I have some still images of the aftermath in a few slides so we're just going to go off of those imagine that that city bus over there just had a school bus 116 00:08:14,420 --> 00:08:19,760 bus crash into it, and the carnage was glorious. I just need you to imagine that for me. So 117 00:08:19,760 --> 00:08:26,120 we crashed a bus on purpose. I occasionally moonlight as a crash test engineer, and it 118 00:08:26,120 --> 00:08:32,140 was an experiment to verify that the HVEDR data stored on board actually matched what 119 00:08:32,140 --> 00:08:39,140 happened in the real world. The plan was crash bus, connect software, download data, so then 120 00:08:39,140 --> 00:08:43,000 we have the data, and then we have all the stuff from our accelerometers and GPS and 121 00:08:43,000 --> 00:08:48,680 everything, and then we would compare it in Excel and do science. So here are some 122 00:08:48,680 --> 00:08:57,740 gratuitous carnage pictures. That is a pretty good delta V right there. That's from the 123 00:08:57,740 --> 00:09:03,600 inside of the bus when I was trying to recover some of the equipment. So as you can see, 124 00:09:03,600 --> 00:09:06,220 if you were seated on that side of the bus, it would have been road pizza. It would have 125 00:09:06,220 --> 00:09:12,980 been pretty bad. So we were going through and trying to extract the data, and we were 126 00:09:13,000 --> 00:09:16,060 able to. And this is a picture of us going through. And you can see the sudden decel event, 127 00:09:16,280 --> 00:09:23,940 or I'm sorry, this cat calls them quick stop events. So we have the, so good. It recorded 128 00:09:23,940 --> 00:09:29,680 a quick stop event. Awesome. So we go to extract it, and it's going through and receiving 129 00:09:29,680 --> 00:09:33,220 data. I'm thinking that I'm going to get to go to bed early tonight, which is kind 130 00:09:33,220 --> 00:09:39,960 of a rare occurrence on these crash tests. Oh no, it was unable to retrieve snapshot 131 00:09:43,000 --> 00:09:50,940 of Mountain Dew. I had to get into it. So surprise, surprise. When buses hit stuff, 132 00:09:51,060 --> 00:09:54,940 they break stuff. And power loss during event writing causes data loss. 133 00:09:55,200 --> 00:10:02,100 So the way these ECMs work is all of the event data recorder data is stored as a series 134 00:10:02,100 --> 00:10:10,420 of frames. And when it detects this speed loss, it's not like a passenger airbag where 135 00:10:10,420 --> 00:10:12,980 it has an accelerometer and detects a shot. It has an accelerator and detects a shot. 136 00:10:12,980 --> 00:10:20,560 It just detects a sudden drop in wheel speed, which is transmitted over either the J1708 or J1939 bus. 137 00:10:21,240 --> 00:10:25,680 And if it's interrupted while it's writing, then you get an incomplete record. 138 00:10:26,340 --> 00:10:27,680 But can we get it back? 139 00:10:28,540 --> 00:10:29,460 So I'm really sorry. 140 00:10:29,560 --> 00:10:31,940 I was assuming I was going to have a projector today, but I don't. 141 00:10:32,340 --> 00:10:35,980 This is the logged network traffic, if you can all squint. 142 00:10:36,880 --> 00:10:46,620 And so this is over J1708, and it's kind of a degenerate transport protocol that this manufacturer invented. 143 00:10:48,440 --> 00:10:51,560 Because I looked at it, and I saw increasing sequence numbers and everything. 144 00:10:51,800 --> 00:10:57,840 And I thought, man, that's weird, but that's not how J1587 does transport. 145 00:10:58,000 --> 00:10:59,280 Well, this is a thing that they invented. 146 00:10:59,660 --> 00:11:05,620 And you can see that there's three messages within each record, and then this byte over here. 147 00:11:06,460 --> 00:11:08,320 It increments by one every time. 148 00:11:10,180 --> 00:11:19,860 But then, and there's this kind of request-response framework where it says, hey, I want this frame, and then it gives it to it. 149 00:11:19,940 --> 00:11:22,060 And then it says, I want this frame, send it. 150 00:11:22,380 --> 00:11:29,240 And then here it just says, send it, send it, send it, send it, send it, which is the software going, are you there, guys, hello? 151 00:11:30,300 --> 00:11:34,340 After which point, you know, when it gets no response, it just throws everything away. 152 00:11:35,600 --> 00:11:35,960 So. 153 00:11:35,980 --> 00:11:38,960 So power loss caused only the last few frames to not be extracted. 154 00:11:39,940 --> 00:11:42,940 And the OEM software just took its toys and went home. 155 00:11:43,020 --> 00:11:45,720 It said, if I can't get the whole thing, I'm not giving you anything. 156 00:11:47,180 --> 00:11:57,520 So if we decode the traffic, we had cheat codes because we had GPS and we had a few different IMUs hooked up to this thing. 157 00:11:58,500 --> 00:12:05,800 So doing manual analysis of the speed data, we found that we found something. 158 00:12:05,800 --> 00:12:11,960 That looked a lot like what our GPS logs showed the vehicle speed was. 159 00:12:12,980 --> 00:12:18,000 And it was the J1587 format, one byte, miles per hour times two. 160 00:12:18,560 --> 00:12:21,640 And the records in frame appear to follow a PID value format. 161 00:12:21,680 --> 00:12:24,020 In this case, the PID was 32. 162 00:12:25,760 --> 00:12:28,480 So this is road speed as we decoded it. 163 00:12:31,420 --> 00:12:33,260 And then, so how close were we? 164 00:12:34,340 --> 00:12:35,760 As you can see, we've. 165 00:12:35,800 --> 00:12:39,840 We've plotted on the same axes the actual road speed. 166 00:12:40,080 --> 00:12:43,840 We logged it as it was transmitted across the bus live. 167 00:12:44,900 --> 00:12:48,600 And then along with the recovered EDR speed. 168 00:12:48,920 --> 00:12:57,740 And then we also recorded using GPS road speed and actually using a few different methods, we logged speed. 169 00:12:58,900 --> 00:13:01,860 And as you can see, it's basically dead on for all of them. 170 00:13:01,940 --> 00:13:05,520 And it tops off at 27. 171 00:13:05,800 --> 00:13:06,880 Point five miles an hour. 172 00:13:07,020 --> 00:13:12,740 So the takeaway from that is that kind of destruction can easily happen at low speeds. 173 00:13:12,880 --> 00:13:14,100 Don't text and drive, please. 174 00:13:16,840 --> 00:13:24,020 And the takeaway from all this is we now have a well verified forensic methodology for covering partial ECM data from power loss. 175 00:13:25,260 --> 00:13:35,260 Decoding the other PIDs required dumping a proprietary database made by a fly by night operation in Florida several years ago over comm using Python. 176 00:13:35,800 --> 00:13:38,300 Which is something I don't want to get into because it caused me to lose a little hair. 177 00:13:39,020 --> 00:13:46,020 But at the end of that, we were able to decode all of these records, including the ones that we didn't have cheat codes for. 178 00:13:46,200 --> 00:13:52,040 So now we can extract this stuff without the buggy software that we were trying to work around in the first place. 179 00:13:53,280 --> 00:13:56,220 And with that, I will hand it over to my electrical engineering friend. 180 00:14:16,700 --> 00:14:24,120 So I'm going to talk about some of the background that led to what we were able to do with the stuff Haystack there talked about. 181 00:14:24,980 --> 00:14:29,420 So one of the problems we have with doing research with heavy trucks is that they're extremely expensive. 182 00:14:30,440 --> 00:14:35,540 In the earlier we showed you that that crash, we were very lucky to have access to. 183 00:14:35,540 --> 00:14:42,520 A school bus and a city bus that had been decommissioned and there was a that was a conference for a bunch of accident reconstructionists. 184 00:14:42,540 --> 00:14:44,800 So somebody was willing to destroy those. 185 00:14:45,100 --> 00:14:46,040 That's pretty rare. 186 00:14:46,620 --> 00:14:49,520 So for our day to day research, we had to build a tool. 187 00:14:53,020 --> 00:15:04,620 It isn't very common for like a big trucking fleet or someone who owns a truck to just let you have access to their vehicle and potentially do things to it that could destroy it or disable it or cause them. 188 00:15:05,460 --> 00:15:06,420 Monetary harm. 189 00:15:07,120 --> 00:15:08,460 So we had to build a device. 190 00:15:09,000 --> 00:15:11,440 So the device we ended up building was called a truck in a box. 191 00:15:11,800 --> 00:15:15,520 And again, sorry for the small picture since there's no projector. 192 00:15:16,160 --> 00:15:18,820 But the device here, we essentially. 193 00:15:20,300 --> 00:15:21,280 Oh, sorry. 194 00:15:21,420 --> 00:15:22,200 I'll go back a little bit. 195 00:15:22,560 --> 00:15:32,800 We took all of the electronics from the inside of the engine department in a this is a Navistar Pro Star with a Max Force 13 engine. 196 00:15:32,980 --> 00:15:33,460 And. 197 00:15:33,580 --> 00:15:33,820 And. 198 00:15:34,100 --> 00:15:34,580 And. 199 00:15:34,580 --> 00:15:46,280 Put the electronics in this apparatus and hooked up a bunch of sensors to convince the electronics that it was in an actual vehicle and powered it up and turned it on and started doing stuff to it. 200 00:15:46,900 --> 00:15:49,260 This was an incredibly tedious process. 201 00:15:49,580 --> 00:15:52,680 You can see the this was part of the wiring harness going to the ECM. 202 00:15:53,020 --> 00:15:54,300 This was handmade. 203 00:15:55,020 --> 00:16:00,000 I think there were something like two or three hundred wires in this apparatus. 204 00:16:01,340 --> 00:16:04,500 So the the truck in a box project was originally funded by the. 205 00:16:04,500 --> 00:16:05,780 The DARPA cyber fast track program. 206 00:16:06,060 --> 00:16:08,020 So thank you to much if you know much is. 207 00:16:09,960 --> 00:16:24,080 We we assemble all those components into a box and then we we actually had a semi functional vehicle that we could test on the bench and we could we could do things to it that you wouldn't want to do to a real vehicle that could potentially destroy it at almost no cost. 208 00:16:27,080 --> 00:16:32,520 So to recreate all of the things inside the vehicle, we had to create the J. 209 00:16:32,580 --> 00:16:34,380 Nineteen thirty nine network, which is a basic. 210 00:16:34,500 --> 00:16:36,060 Can bus, which is not complicated. 211 00:16:36,360 --> 00:16:37,600 Lots of people have talked about that. 212 00:16:38,400 --> 00:16:39,960 The older legacy J. 213 00:16:39,980 --> 00:16:43,540 Seventeen eight bus and we had to kind of roll our own electronics for that. 214 00:16:43,620 --> 00:16:45,820 And we talked about that in our talk on Friday. 215 00:16:46,040 --> 00:16:47,060 There's some stuff on GitHub. 216 00:16:47,180 --> 00:16:59,120 If you were interested, we had to hook up and simulate passive sensors, which were just resistors and potentiometers and things like that so that we could set the oil pressure to a value where the ECM didn't think it was having issues. 217 00:17:00,000 --> 00:17:02,520 And then we had to simulate some more active signals. 218 00:17:03,440 --> 00:17:04,260 I'll talk about that. 219 00:17:04,260 --> 00:17:17,700 But more in a minute, some of the manufacturers publish voltage values for some of these sensors, so we were able to simulate those pretty simply by just reading the manual and hooking up the resistor values and some of them we actually had to reverse engineer. 220 00:17:19,680 --> 00:17:33,380 So in the first truck in the box, we had the main control module, the instrument cluster, and then rather than actually install these two other modules, the body control and the brake controller, we ended up recording traffic from a real truck and just. 221 00:17:33,380 --> 00:17:39,540 Just playing that traffic back at the other two ECU so that they thought it was in the in the box. 222 00:17:39,800 --> 00:17:48,940 It turns out that their functionality is simple enough when the key on the ignition is off that you don't really need to do anything other than broadcast a few can messages. 223 00:17:50,780 --> 00:17:57,000 We used a thing called the National Instrument C Rio to broadcast all of those simulated traffic messages. 224 00:17:58,140 --> 00:18:02,220 We also use that to simulate some of the more complicated analog sensors. 225 00:18:02,320 --> 00:18:03,160 It'll talk about in a second. 226 00:18:03,760 --> 00:18:07,160 And again, the passive sensors were done with potentiometers and resistors. 227 00:18:07,420 --> 00:18:13,980 So these active sensors, there's a bunch of sensors on the ECMs that don't work like a resistor. 228 00:18:14,180 --> 00:18:15,800 You have to they change over time. 229 00:18:16,020 --> 00:18:19,780 So they're like a pulse width modulation or like a sine wave. 230 00:18:20,080 --> 00:18:23,940 And the ECM does pulse counting to figure out what what's going on. 231 00:18:24,080 --> 00:18:29,500 So we've got two sensors that the ECM was particularly frustrated that it could not see when we hooked up to it. 232 00:18:29,560 --> 00:18:32,320 And it kind of refused to do anything until we solve those problems. 233 00:18:32,560 --> 00:18:33,260 One of them. 234 00:18:33,380 --> 00:18:43,240 It was the accelerator pedal with no accelerator pedal, it wouldn't do anything, even even though it's like a resting truck is just sitting there, the accelerator pedal is sending a position as long as the power of the truck is on. 235 00:18:43,380 --> 00:18:44,660 So that was a PWM signal. 236 00:18:44,800 --> 00:18:48,760 We hooked up a microcontroller and solve that one in a couple hours. 237 00:18:49,800 --> 00:18:52,780 The more complicated one was the vehicle speed sensor. 238 00:18:52,980 --> 00:18:58,940 This is the sensor that actually is on the mechanics of the truck that helps it determine how fast it's going down the road. 239 00:18:59,640 --> 00:19:02,520 So again, apologies for the small picture because the no projector. 240 00:19:02,520 --> 00:19:09,840 But this is the laser pointer is not going to work in the middle here is a toothed ring. 241 00:19:10,560 --> 00:19:21,940 That's the vehicle speed sensors, tone ring and then off to the left is a little little black nubs looking thing that's actually a magnetic pickup and it can detect the changing ridges in the rain. 242 00:19:23,120 --> 00:19:30,200 So we bought the tone ring, we hooked it up and it was kind of complicated because you have to spin this thing pretty fast to get it working. 243 00:19:30,400 --> 00:19:31,760 So we rigged up a 244 00:19:32,520 --> 00:19:42,280 an adapter that we cut out using some some prototyping equipment and hooked up a remote control and since this is something spinning very fast using 245 00:19:43,820 --> 00:19:48,960 some welds not by somebody who knows how to weld, we hid behind something metal after we spun it up and 246 00:19:50,040 --> 00:19:52,920 eventually figured out that was safe and it wasn't going to fly apart, we hope. 247 00:19:53,420 --> 00:20:02,300 So there's a picture of it spinning in a vice hooked up to the or with holding the sensor near it and we ended up getting this signal on a oscilloscope and it's just 248 00:20:02,300 --> 00:20:10,340 an AC signal at about a kilohertz and the frequency varies depending on how fast the vehicle is moving. 249 00:20:11,480 --> 00:20:22,340 The unfortunate part for this is that the the signal can reach up to 100 volts peak to peak. So basic like a microcontroller can't do that. So we had to use the National Instruments CREO to generate a 250 00:20:22,920 --> 00:20:31,620 a differentials not differential rail to rail signal. So we spun it up. We got it up to 3000 RPMs. I believe the 251 00:20:32,940 --> 00:20:35,240 final vehicle speed was something like 85. 252 00:20:36,040 --> 00:20:40,460 And we fed that into an ECM and magic the ECM converted the analog signal 253 00:20:41,560 --> 00:20:51,900 into a canned message on the network. So it actually thought it was moving and it passed the sense that message along to the instrument cluster and it actually started counting up miles. 254 00:20:52,340 --> 00:20:56,600 So it thought it was going down the road, even though the key wasn't off and there's actually no engine. 255 00:20:57,520 --> 00:21:00,560 It was kind of fantastic. Eventually, we ended up building a 256 00:21:00,560 --> 00:21:02,220 a more safe apparatus. 257 00:21:02,300 --> 00:21:06,540 with this enclosure around it in case the thing ever decided to fly apart 258 00:21:06,540 --> 00:21:10,180 because metal things spinning at 3,000 RPM is like to fail. 259 00:21:10,920 --> 00:21:14,980 So we built this apparatus that was much more reliable, 260 00:21:15,040 --> 00:21:16,400 and we were able to use it for several years. 261 00:21:17,140 --> 00:21:20,780 And then here's a picture of an instrument cluster we rigged up, 262 00:21:20,860 --> 00:21:23,500 and we're feeding the ECM the signal, 263 00:21:23,560 --> 00:21:25,140 and then the ECM is broadcasting the CAN traffic, 264 00:21:25,300 --> 00:21:26,880 and the instrument cluster is receiving it. 265 00:21:27,980 --> 00:21:30,200 So that's nice, but what's that good for? 266 00:21:30,200 --> 00:21:33,940 Well, that's not particularly useful for security analysis, 267 00:21:34,200 --> 00:21:36,680 but we can do some reverse engineering on the ECM 268 00:21:36,680 --> 00:21:38,260 to figure out how it stores some of the data. 269 00:21:38,560 --> 00:21:41,040 So as James was talking about earlier, 270 00:21:42,880 --> 00:21:46,680 these devices store event records for when you slam on the brakes 271 00:21:46,680 --> 00:21:47,520 or something bad happens. 272 00:21:47,920 --> 00:21:49,500 So that gets stored in flash memory. 273 00:21:49,740 --> 00:21:53,760 So we can use our fake vehicle speed sensor 274 00:21:53,760 --> 00:21:57,320 to put in a pattern that we know what it looks like, 275 00:21:58,500 --> 00:22:00,180 run the ECM through that, 276 00:22:00,200 --> 00:22:01,680 that simulated driving pattern, 277 00:22:01,860 --> 00:22:04,380 and then slam on the simulated brakes, 278 00:22:05,120 --> 00:22:09,560 and the vehicle will record that as a crash or hard brake event. 279 00:22:09,940 --> 00:22:12,080 And then we can go fishing around in the flash memory 280 00:22:12,080 --> 00:22:14,920 for that pattern to see how it stores that data. 281 00:22:16,440 --> 00:22:20,000 Now, that sounds simple, but it's terribly complicated. 282 00:22:20,340 --> 00:22:24,820 The first challenge is these ECMs are incredibly rugged. 283 00:22:24,920 --> 00:22:29,660 So in cars, ECMs are just like a little thin, 284 00:22:30,200 --> 00:22:32,240 metal can, and maybe the circuit board inside 285 00:22:32,240 --> 00:22:35,300 has some simple coating over the top of it. 286 00:22:35,480 --> 00:22:38,280 But with the truck ECMs, these things are like cast aluminum. 287 00:22:38,600 --> 00:22:40,680 A lot of times they're epoxied into the case. 288 00:22:41,220 --> 00:22:44,420 And the whole point of that is they have to go for millions of miles 289 00:22:44,420 --> 00:22:48,140 and endure road grime, oil, all kinds of stuff that can get all over them. 290 00:22:48,620 --> 00:22:51,260 And so here's a picture of the inside of an ECM. 291 00:22:51,380 --> 00:22:53,840 This is the inside after we opened it up of one we found. 292 00:22:54,000 --> 00:22:57,120 And you can see the little patch, if you're close enough, 293 00:22:57,260 --> 00:23:00,120 where we had started to clean away so we could get to the flash. 294 00:23:00,200 --> 00:23:02,080 It was just disgusting. 295 00:23:02,360 --> 00:23:03,320 And we don't even know what this is. 296 00:23:03,360 --> 00:23:05,880 It could be oil, it could be road grime, it could be anything. 297 00:23:06,200 --> 00:23:08,360 But it was covered, even on the inside. 298 00:23:08,520 --> 00:23:11,860 And there's a gasket seal around this ECM. 299 00:23:12,460 --> 00:23:14,800 This was an older one that was pretty simple to open. 300 00:23:14,900 --> 00:23:18,620 All we had to do was take out some screws and pop off a rubber seal. 301 00:23:19,060 --> 00:23:22,920 But that was probably the only time we ever encountered that simplicity. 302 00:23:23,940 --> 00:23:26,280 Most of the ECMs we had to mill apart. 303 00:23:27,960 --> 00:23:29,640 So you can't see it here. 304 00:23:29,720 --> 00:23:30,180 But this is a... 305 00:23:30,200 --> 00:23:33,940 This is an ECM where we are milling the connector housing off the top of it 306 00:23:33,940 --> 00:23:35,540 so that it will release the circuit board 307 00:23:35,540 --> 00:23:38,860 so that we can get to the components that are hidden from us. 308 00:23:40,920 --> 00:23:44,280 So once we spent a few months disassembling all these ECMs, 309 00:23:44,320 --> 00:23:47,100 breaking several of them at, you know, a couple thousand dollars a pop, 310 00:23:47,900 --> 00:23:49,180 we had to clean the boards up. 311 00:23:49,260 --> 00:23:52,240 We had to get road grime or whatever off of them if they were surplus. 312 00:23:52,760 --> 00:23:55,700 Then we had to get the conformal coating, which was part of the, you know, the protection. 313 00:23:56,640 --> 00:23:59,780 Not protection from me, protection from road grime and such. 314 00:23:59,820 --> 00:24:00,180 We had to get the board out of the way. 315 00:24:00,180 --> 00:24:03,520 We had to take that off, and some of that requires different caustic chemicals 316 00:24:03,520 --> 00:24:06,320 depending on the material they used for conformal coating. 317 00:24:06,560 --> 00:24:07,340 It could be acrylic. 318 00:24:07,420 --> 00:24:08,120 It could be an epoxy. 319 00:24:09,460 --> 00:24:10,800 Some of them we couldn't figure out, 320 00:24:10,920 --> 00:24:15,140 and just the solution was to leave it sitting in a chemical bath for a couple of days 321 00:24:15,140 --> 00:24:16,160 and eventually it flaked off. 322 00:24:17,000 --> 00:24:18,520 Sometimes, so did some of the components. 323 00:24:20,920 --> 00:24:23,540 So we eventually, we get a bare circuit board. 324 00:24:23,680 --> 00:24:26,420 We use a hydro rework station to get the chips off of the board. 325 00:24:27,220 --> 00:24:30,140 And then we used a universal chip reader to get the data, 326 00:24:30,180 --> 00:24:30,900 off the chip. 327 00:24:31,740 --> 00:24:37,700 These are just a generic device you can buy from a company like Dataman or Zeltek. 328 00:24:37,820 --> 00:24:40,160 They have a socket for different ICs, 329 00:24:40,300 --> 00:24:42,120 and if you're lucky, they make one for the chip you've got, 330 00:24:43,360 --> 00:24:47,140 and then they've got an algorithm for extracting it. 331 00:24:47,220 --> 00:24:51,960 So we didn't have to develop the algorithm for removing the data from the chip. 332 00:24:53,320 --> 00:24:57,200 So there's a picture of one of the flash chips that we got out. 333 00:24:57,300 --> 00:24:59,040 This one was clean beforehand, 334 00:24:59,040 --> 00:25:00,880 and this still has the conformal coating on it, 335 00:25:00,960 --> 00:25:05,420 but they're relatively simple devices once you get them off the board. 336 00:25:06,080 --> 00:25:08,880 So here, again, sorry for the small size. 337 00:25:09,100 --> 00:25:11,340 You can see some raw hex data, 338 00:25:11,560 --> 00:25:13,700 and then that's the engine serial number highlighted. 339 00:25:13,920 --> 00:25:16,840 So we've actually got access to some of the internal data. 340 00:25:17,480 --> 00:25:21,540 And then here we found the hard break event. 341 00:25:21,640 --> 00:25:25,220 This is the record of actually spinning up the vehicle speed sensor 342 00:25:25,220 --> 00:25:27,640 and then stopping it suddenly and it reporting, 343 00:25:27,800 --> 00:25:29,020 oh, hey, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, 344 00:25:29,020 --> 00:25:31,180 I went through a hard breaker crash event. 345 00:25:31,540 --> 00:25:35,600 So we were able to extract that data from the chip. 346 00:25:35,720 --> 00:25:38,000 So even if the ECM is in pieces, 347 00:25:38,180 --> 00:25:40,900 as long as that chip isn't cracked in half, we can get to it. 348 00:25:41,960 --> 00:25:45,880 So the conclusions, reverse engineering these ECMs, it's not impossible. 349 00:25:46,120 --> 00:25:47,080 It's a lot of work, 350 00:25:47,740 --> 00:25:50,840 but we can go from the analog input data all the way down 351 00:25:50,840 --> 00:25:53,460 to the internal hex storage stuff on the flash chips. 352 00:25:54,420 --> 00:25:59,000 We can simulate things that you could never do to a real vehicle. 353 00:25:59,020 --> 00:26:05,760 like crash it into a wall because I mean that would be one expensive and no one wants to buy 354 00:26:05,760 --> 00:26:11,380 a truck just to crash it into a wall except you know NHTSA. So we were able to do that in the lab 355 00:26:11,380 --> 00:26:16,260 and then reverse engineer all the stuff. For future work we're looking at tearing open some 356 00:26:16,260 --> 00:26:21,420 of these newer ECMs. We were very lucky that most of the older ones had a separate flash storage 357 00:26:21,420 --> 00:26:25,440 chip. Some of the newer ones they integrate the flash storage into the same package or on the 358 00:26:25,440 --> 00:26:29,640 same die and that makes it a lot harder. I can't just pull it out and stick it in a reader. 359 00:26:31,560 --> 00:26:35,140 We're looking at doing ECU analysis for some of the other units like the brakes 360 00:26:35,140 --> 00:26:39,860 and the telematics units. So we'll hope to be presenting about that in the future. 361 00:26:41,860 --> 00:26:45,460 Thank you very much for your time. We've got plenty of time for questions if anyone has any. 362 00:26:50,440 --> 00:26:53,960 Again sorry for the lack of projector. So if you want to come up and see any of the pictures 363 00:26:53,960 --> 00:26:54,580 feel free. 364 00:26:59,220 --> 00:27:05,800 Yeah, we gave a talk at the main conference on truck hacking and we'll put it up on the 365 00:27:05,800 --> 00:27:14,580 GitHub. I think that's truckhacking.github.io. Give us like a couple of days to get home from 366 00:27:14,580 --> 00:27:16,500 the conference and put those up. But we'll put them up there. 367 00:27:18,340 --> 00:27:23,460 Truck hacking, excuse me. Yeah, github.io. 368 00:27:25,440 --> 00:27:26,160 You want to say anything? 369 00:27:27,480 --> 00:27:28,400 Thanks everybody.