start	end	text
0	1620	Thank you all for coming.
2080	4100	Thanks DEF CON for having me up here.
4360	11300	As Juris mentioned, I've been involved here in a lot of different ways, but this is the first time I've actually been up on the stage, so it means a lot.
11560	14880	Do we have any car enthusiasts in the audience?
15060	16180	Yeah, okay.
17340	20880	Any of you ever had problems with your emissions testing?
21300	22920	Yeah, we're going to have some fun.
23960	26640	So I assume you all can see something.
26640	27680	I can't see shit.
27680	33560	But we're going to talk about the ODB2 systems in cars and what we can have fun with.
33960	36880	So this is a car I bought about ten years ago.
36880	41320	It's a fun go-kart of a car.
41820	44220	It has a little quirk about it.
44220	45800	Anybody know what this car is?
45800	46480	Anybody?
47160	50460	Yeah, so we've got the Wankel rotary motor in it.
50880	54920	And specifically, these things love to kill catalytic converters.
57200	61540	But at the time, I was living in Kansas City, and they don't do emissions testing.
61800	64200	Oh, by the way, did he mention SetKC?
64200	66740	Yeah, so we'll wrap around to that.
67880	69960	So, you know, it's not there.
69960	70940	We don't have to worry about it.
70940	74600	So I enlisted my little helper, and we were like, fuck that, get it out of here.
75320	77920	So life was good for about eight years.
78480	81940	Then I decided, well, let's move to the West Coast.
82020	85980	Turns out, they don't like that so much around here.
86620	91960	However, as I was digging into the laws, they had this statute that got me kind of excited.
92020	97800	It said for collectible vehicles, we don't do emissions testing.
97800	99980	I'm thinking, well, this car is kind of unique.
99980	100800	It's old.
100800	101800	They don't make it anymore.
101800	103940	It's the last time they made this type of motor.
104840	107520	So I'm like, yeah, let's start digging into this.
107520	110960	And then, you know, used infrequently, sign me up, right?
112180	113780	This is how I'm going to get in.
113780	116500	But then they had this last little thing at the end.
116500	123860	It's like, every person must have, every person who's of a driving age in your house must also have another car.
124980	128520	I've been working from home for like, ever.
128680	134060	And I drive this car less than 5,000 miles a year, maybe once a week, right?
134060	143920	So not only do I have to have this car that I never drive, but I have to have another car registered to me that I never drive, right?
143920	146200	And motorcycles don't count.
146320	149500	Lots of other fun little things don't count.
149500	156700	You have to have a car that you can drive every single day, regardless of the fact that my wife works from home, I work from home, we take the kids to school.
156700	157660	That's it, right?
157660	159720	So we're like, well, glad.
159880	163800	I'm kind of a hoarder, so I still have the catalytic converter and all that kind of crap.
163800	164720	Put it back in.
165640	180820	A thing about that, if you don't ever have to do emissions testing, and it's never a concern of yours, if you just put the stuff back in there and you go and try and get it tested, there's this thing that happens in the computer that they don't really ever tell you about unless you have to deal with it.
182420	185220	I was like, what the fuck does it mean to not be ready?
185400	194820	And you dig into it, and I pull up the service manual, and sure enough, after you reinstall these parts, and it turns out any time you reset the battery, you're going to have to go through the cycle.
195040	202340	Drive the car up to a certain speed, let it idle for so long, and meanwhile you have to have the air conditioner off and all that stuff.
202340	204240	Did I mention I live in the desert?
205020	210560	Driving a car around for 40 minutes to do this with the air conditioner off is not fun.
210580	217540	But I tried for months doing this thing while in the time that I don't actually drive this car.
218180	222140	And I just can't get rid of these goddamn readiness monitors.
222140	224920	And so I'm like, what the hell?
226000	228360	So let's throw back to DEF CON 26.
228460	229680	Mentioned I was tech Casey.
229680	231340	Anybody heard of the badge pirates here?
232320	235020	So this was their first badge they made.
235260	240340	As part of a tech Casey kind of let's have fun, we're going to be part of badge life, blah, blah, blah.
241280	250680	And as part of it, I made this little add-on to my badge and hooked it into the ECU and it could read the oil temperature and water temperature and stuff.
250680	252600	So I was like, yeah, I've done this before.
252600	255840	At the time it was a UART adapter, no problem.
256360	259980	It's a little high-level, but really how hard can it be?
260040	263580	So I start digging into the protocol.
263580	265780	There's an authentication mechanism in the front.
265780	270000	We're like, okay, I've got to bypass that at some point, right?
270000	271680	There's something that's going to happen.
271780	276500	Anybody who's familiar with Canvas right now is going, oh, yeah, okay, I know where this is going.
276800	280020	A basic data frame.
281060	285320	As I dug in to the next part, by the way, the references for all these are on there.
285320	286000	I'm not going to go there.
286000	286900	We only have 20 minutes.
286900	287920	We're going to keep this moving.
288660	292200	Zero to eight are the possible authentication IDs, okay?
292200	297100	So when I saw that is the moment when I went, you know what, maybe I don't have to do this the right way.
297100	301240	I can just kind of tell the computer to do what I want it to do.
301840	308560	So I did what any sane person would do and put together a thread board that let me hook up a logic analyzer.
309040	310680	That's kind of what it looks like.
310680	315840	You can buy these things off of Amazon for a couple of bucks and you hook them up.
316660	333420	But then you plug in a logic analyzer and anybody who is familiar with Canvas knows this part, but anybody who's just kind of getting into analyzing hardware signals, you'll notice that the signal never goes near zero.
333420	340560	So you have it's plus 2.5 up or down over 1.7 volts, I believe.
341260	345780	And it's inverted together to cancel noise and all that stuff.
345780	353500	So if you want to be able to use like a Salia logic analyzer or any of the cheaper stuff, you need to do a little bit of messing around.
353500	357420	So this is what we call a DC filter or an AC coupling.
357420	365320	And you're essentially just removing that low level DC voltage from the signal so that you can get something like this.
365560	372100	And also I added a cap in there that rounds off the top so you get a nice square wave, but square being relative.
372940	374340	So now we see data, right?
374340	377080	At the top of the screen we can see it's actually starting to parse data.
377080	384360	We're not going to dig into it too much, but at least we can confirm what we read in the document is what we're seeing, right?
384360	385300	It's good.
385400	390200	But what I really wanted to do was, hey, how can I respond to this thing in a programmatic way?
390560	393900	So these things now, they don't even bother to separate them.
395040	396840	I can't fucking see the screen.
398560	399360	Sorry.
400560	402840	You pay six bucks for six of these.
402840	403680	They don't split them up.
403680	404820	You just pop them off or whatever.
404820	406820	But these are your transceivers.
406820	409680	I have ESP32s laying around the house.
409680	412360	Anybody who plays with these kind of things have them, right?
412380	416220	It has a built-in CAN bus controller, but it doesn't have a transceiver.
416220	417300	So you need one of these.
417300	418260	They're a couple of bucks.
418260	421640	You get them off of Amazon, plug it in, and then you can start seeing this kind of stuff.
421640	428080	It's actually acknowledging packets instead of just being able to listen to it.
428820	434100	So as we dig in a little bit deeper, we see there's the identifier field, but just fixed, by the way.
434100	437840	The zero is the ECU, so you just tell it you're the ECU.
437860	440580	You tell it this is the received packet from the scanner.
440580	443280	It's saying, well, there's a link, there's a service, there's a PID.
443320	457000	Turns out there's this handy little thing called Wikipedia that you go in and you look it up, and it tells you exactly what it's looking for, and then you go back to the other page where they have this little decoder tool that says, oh, I can't, you know,
457000	461240	if you receive this message, this is how you want to respond and construct the frame.
461660	464780	So we have a response , right?
464780	466820	So now you can see it's being sent on both.
466820	471280	It's a response on both sides when you send a message.
471280	473980	So echo, I believe is what we call it.
473980	481100	But then we have this error that happens right after we respond to the goddamn thing, and this is what happens.
481100	490240	So this is a little cheap scanner you can buy anywhere that I just use for clearing messages and stuff, but the goal at first was, like, can I even fool this thing?
491340	494580	That screen I looked at for probably two months.
495360	498660	Turns out these kinds of things are pretty complicated.
498660	501220	It's just so many different layers that you're worried about.
505100	509080	Yeah, you just got to make sure you're keeping track of every little piece.
509260	517380	And it didn't help that at this time I had lots of friends on Twitter going, AI coding agents are awesome, you should really look into these, blah, blah, blah.
517380	524620	I'm thinking, great, I'm in this really, really complicated project, now's a great time for me to start exploring AI coding tools.
527100	534400	Malicious ignorance is about the best word or phrase I can come up with to describe that experience.
535660	537920	Something it's really, really good at.
538140	545520	The, like, writing registers, reading back registers, debugging information, all that kind of crap it was really, really great at.
545520	555600	It thinks about hardware like a high school level kid who just read a book on hardware thinks, right?
555600	560500	It had convinced me that I knew nothing about hardware at all.
560680	565580	And the protocols were just garbage and everything that I thought I knew was just terrible.
566120	567480	Don't listen to it, right?
568140	571140	Half of what we're going to do with these things is figure out how to teach them.
571140	590020	But in the process, I ended up actually abandoning the entire design of the original one, digging in a little bit deeper, I learned the canvas controller on this thing is actually kind of a pseudo copy of whatever the SDA 1000 proper one was, and there's some details that they don't expose that you really need to know when you're figuring out all the timing and all that kind of crap.
590020	599720	So I went with an external spy controlled one, which has the secondary benefit of later on, I actually wanted to proxy on the same board without having to, like, chain two ESPs together.
599720	602300	So I'm like, I know I can run multiple spy buses.
602380	604720	I'm sorry if I'm high leveling some of this stuff.
604960	606500	You're just going to have to look it up later.
606500	607700	We only have 20 minutes.
609620	612840	But, yeah, faster, faster, faster.
612840	619120	So we've gone through, we have it working, and sure enough, we have a working response to the scanner.
619140	625920	This is very, very phase one, gone through all this, but within the end of the day, we have this thing reading out exactly what we want.
625920	631040	So these are the same screens that we saw earlier where I was like, god damn, I just can't get it to do what I want.
631040	638780	Now I've proven this concept of, like, okay, we can actually show that we can convince this little crappy scanner to do what we want.
639000	647280	So, you know , I have an emulator working, and I had some working knowledge of the AI thing, and I forked it off and said, hey, turn it into a proxy for me, let's see what happens.
647280	648460	It can't hurt, right?
648560	652040	So it turns out, it actually didn't do a real bad job.
653180	666160	But the ultimate incarnation of this thing is you've got the two breakout boards, one goes to your scanner side, one goes to your ECU side, and installed, it looks like this.
666160	673180	I mean, it looks, if you've ever crawled under the dashboard and looked at your ODB2 plug, you've got a legit-looking thing.
673180	674180	That's part of the thing.
674600	690580	And I should mention, too, in the state where I live, which I haven't said what it is, but the rule is, it doesn't matter, as long as there's no check engine light and they can plug the thing in and it reads what it wants to read and it gets an okay, then it says,
690580	691560	yeah, it's going to work.
692720	696100	So we have a video.
701510	705390	So it starts off just, you've got to start the motor when you get up there.
706090	711710	It gets it running, make sure the, come on, move it a little faster.
713330	719150	So we can see the DAS is running, we have RPMs, it's all working the way you would expect it to.
719430	723230	Then we get our ODB2 tester out.
724330	725970	That one, we plug it in.
725970	727990	This is your factory configuration.
732150	740670	I know it feels like an eternity when I've been talking this fast, but really, it just, so you can see, it run the scan, it can't really see with the lights, huh ?
740670	747070	But it's showing, like, there are two incomplete, or actually more than that in this case, because I had reset the motor.
747070	748990	Running through them, doesn't work.
750270	762550	So I reach under there and just kind of move the, pull that cable out, plug in the adapter and then tuck it back under the dashboard and I'll just skip forward in the video a second.
767670	768770	There we are.
768990	776190	It took about two minutes total to do this, if you can see the time stamp, but I'm impatient, so come on.
776530	777250	Okay, there we are.
777250	787030	We have it plugged in with the photo that you saw before and we can see we have zero codes, monitors, zero incomplete and 11 ready.
787190	790050	So that's, we have it working.
792630	799810	I chose specifically not to include any kind of active testing in this presentation.
799870	803070	You can extrapolate from that what you want.
803410	810530	But you can go to this website as of right after this talk and download the code for this and all the instructions on how to build it.
810730	812030	So have fun.
