start	end	text
0	4800	My name is Aaron or Acorn. Uh and I'm a security researcher with
4800	10120	Grimm. And I play with cars and I'm gonna tell you about what
10120	15240	UDS is and why it can help you hack cars. And let's get
15240	19380	moving. So what is UDS? Um I'm not gonna go through all this
19380	21920	detail because it's really boring and a bunch of standards.
21920	26060	But basically UDS is a higher level protocol that lives on top
26060	31100	of CAN. CAN itself uh for the for the purposes of this
31100	35120	particular talk you can think of CAN as about uh kind of old
35120	38660	school 10 100 ethernet. You can have a bunch of things on the
38660	41160	bus and they can talk to each other to use the MAC address to
41160	43460	figure out what messages are meant for them. Right? So keep
43460	46860	that in mind that's basically CAN. UDS itself is then a higher
46860	51940	level protocol living on top of that. As you may know CAN has a
51940	55560	limit of 8 bytes per message. And so if you want to send
55560	59480	anything bigger than 8 bytes, like you want to send firmware
59480	62840	to an ECU on a car, you're going to need to use a higher level
62840	68600	protocol to segment that up into multiple messages. So ISOTP is a
68600	72420	segmentation layer, kind of like IP. And then you have UDS itself
72420	76280	which you can think of like, I mean the analogies break down at
76280	79000	this point but you can go with maybe UDP, TCP, whatever you
79000	82280	feel like. Like I said the analogy does break down at that
82960	84520	point. But there's the ISO standards if you feel like
84520	88120	looking at it. One quick mention OBD2. OBD2 is a little bit
88120	91180	different standard. Uh it's not really living on top of these
91180	94980	things as well. Uh it but it's meant it's very specifically uh
94980	98980	single purpose meant to talk to the uh emissions related
98980	102780	equipment for scanning codes. So it's not really the same thing
102780	107420	but sometimes the ECUs which do talk OBD2 also talk UDS.
107560	112920	Sometimes not. So CAN. Um you have a message ID, arbitration
112920	115300	ID. It's what identifies what message is meant to go on the
115300	120780	bus. Uh the if you have standard CAN is 11 bits only for the
120780	126360	message ID, arbitration ID. In standard for UDS is 7xx is going
126360	130700	to be the request and then 7xx plus 8 is going to be the
130700	135480	response ID. This will make sense eventually. I promise. Uh
135480	138860	the 29 bit which or the extended CAN is a little bit different
138860	142580	where it uses two different uh you know two different bytes as
142580	145200	kind of the sender and receiver. It makes a little bit more
145200	149660	sense. Uh OBD2 there's a specialized set of uh IDs that
149660	155120	are meant for OBD2 only. So you don't know and so going back to
155120	159400	the Ethernet and IP example, we don't have uh routers here. We
159400	162840	don't have a switch. We don't have DNS to tell us what's on
162840	167000	the bus. So the thing is we need to figure it out. But right here
167000	171100	we've got a very it's a pretty limited subset of IDs that we
171100	174300	can scan to figure out what's on that bus. It's like a maximum
174300	183800	of that's actually a little bit less than 255, 256. So real
183800	187100	quick, ISOTP, there's a couple different frame types. It's not
187100	190240	really important at this point but basically the first nibble
190240	194520	of the CAN data frame indicates what type of message it is.
194600	197740	Since it's a limited subset of values, it can make it really
197740	202520	easy to see uh large data transfers. And which is one of
202520	205480	the things that is nice about UDS. It makes it easy to just
205480	208680	visually take a look at it and see that something is happening.
210660	213540	Uh couple different UDS services. If you take a look at
213540	216720	this and you say what do I want to do to a car? You can say that
216720	219620	well downloading and uploading things to the ECUs does sound
219620	223400	interesting. Transferring data, security access. This is there's
223500	225680	a lot more than this. If you want to know you can go look at
225680	228840	the standard. Actually the Wikipedia page for UDS is pretty
228840	232820	good. Uh and so you can go take a look at that. There's a lot of
232820	237140	things in here that are custom per automaker which means to
237140	240720	figure out what uh is actually supported for an ECU. You need
240720	243660	to either have the design documents or you need to figure
243660	249020	it out. So that's kind of the goal here. So let's take a look
249020	252740	here's a couple different ECU uh UDS responses. The whole idea
252740	255640	is you've got a request. So in the very first message here
255640	263140	we've got a request ID of 74A. And the response here is 7B4. And
263140	265260	you'll notice that that's not actually what I said earlier.
265260	268300	Earlier I said it should be 8 more than that. Well that's the
268300	270900	standard. Just because it's the standard doesn't mean it's
270900	273580	actually what is ever done because nothing's ever actually
273580	278120	done standardly on passenger automa- passenger vehicles. So
278120	281240	here we see the message uh the very first you see the first
281240	284280	nibble of the data is uh 0 which means it's a single frame
284280	287720	message. Again it's very obvious what's going on. Second nibble
287720	293920	is the length. And then after that we see 10, 0, 3. 10 is the
293920	298720	uh diagnostic session request. 3 is just a session ID. What does
298720	304760	that session mean? Well again it means whatever the automaker
304760	309060	wants it to mean. So the only way to figure out what it means
309060	314480	is if you can start actually taking uh you know querying what
314480	318820	functionality is available in that diagnostic session. You
318820	321660	might have some simple diagnostics in session 2. You
321660	325420	might be able to um reprogram the ECUs in session 2. Maybe
325420	330440	session 3 lets you do things like um disable the brakes or
330440	334140	something like that. You know so maybe it's some uh debugging or
334140	336780	implementation. Something the engineers were doing that's not
336780	339840	really meant for general consumption. Well if you can
339840	342940	figure out what that is if you can get in there and scan what's
342940	346340	going on then it allows you to get access to what that type of
346340	349980	functionality is. So other another one the second UDS
349980	353560	request here again we've got 7 oh oh yeah so the response
353560	357620	itself so we have 0, 6. Uh so again single frame message 6
357620	363120	bytes. 50. So the first byte here is isotp. That's kind of
363120	368500	the encapsulation layer. UDS itself is then the actual uh the
368500	371120	remaining bytes right the remaining 7 bytes of this
371120	377400	message. The request is the service ID which was 10. The
377400	382660	response if it's a successful response is then hex 40 more
382660	386360	than the request. These all seem incredibly arbitrary. I know.
386360	389360	And basically it's because I don't know the people who wrote
389360	392580	the standard did it that way. It's actually it's similar it's
392580	395880	based on of older standards so what you're seeing here is kind
395880	398900	of the evolution of a lot of things based on a lot of things
398900	402480	based on a lot of things. Which is basically how all technology
402480	406420	in computers has ever worked. Because it's all based on well
406420	409920	we did it this way so let's do it this way now. That's why it's
409920	412140	this way. So you just gotta take a look at it and look at the
412140	416480	standard and you eventually figure it out. So 50. That means
416480	420100	successful because it was 40 more than the request. And then
421540	425800	the next thing is going to be 3 which is the diagnostic session
425800	428940	that was requested. The length is 6 which means there's 3 more
428940	433220	bytes of data here. I have no idea what they mean but usually
433220	436200	it doesn't actually matter much what they mean but they're here
436200	440560	in case you wanna refer to it later. Uh if you're actually
440560	443020	implemented this or doing something with the dealer tools
443020	449820	it might be meaningful. I don't know. So if it's 40 more that's
449820	452560	successful response. Uh what happens if it's an unsuccessful
452560	456520	response? That's the next example I got here. Got 0, 2, 10,
456520	459900	4. So it's slightly different session uh session ID I'm
459900	463620	looking for. The response itself then is 7F. That means it's a
463620	467080	negative response. And then you have the error code here which
467080	472400	so it says after the negative response the next byte is the
472400	475360	service ID that caused the error. 10. And then it's the
475360	479500	error code. Well the error code itself is 12. Uh that is
479500	482980	thankfully a standard thing in this. And 12 means subfunction
482980	486900	not supported. So that basically is somebody telling us
486900	490040	that we don't know what this means. So this is again this is
490040	494000	the way that the UDS protocol is allowing us to enumerate what
494000	499620	functionality exists on an ECU. The last one here is a read did
499620	504180	message. So a did in UDS speak is uh a block of data. If you
504180	507920	wanna find out what VIN is in a car you read a particular data
507920	512620	identifier and in this case data identifier F190. Uh that's part
512620	515060	of the standard. There's a range of these different dids which
515060	518500	are standard for the ISO standard. There's uh then
518500	521740	there's a bunch of other stuff which automakers or suppliers do
522280	525580	because they feel like it. Or probably really to put in
525580	528120	information that they feel is necessary. What version of
528120	531140	software do we have in here? Uh what version of the hardware is
531140	539220	this? Who compiled it? Navy. So here the response was uh there's
539320	542380	a couple two things I wanna point out about this last one.
542400	548300	You can see that the error is we have a 7F which means error. But
548300	556420	the error code is 78. Error code 78 means that it's a it's a hold
556420	560340	on let me look let me read this properly. Request correctly
560340	564640	received. Response pending. So basically it means hold on a
564640	568560	second. And this is one that always annoyed me a little bit.
568560	570260	Because if you take a look at the timestamps it didn't
570260	572740	actually take that much longer for the actual message to come
572740	575940	back. First nibble is 1 which means it's the first frame of a
575940	580000	multi-frame message. And then again like I said 3 is the flow
580000	583900	control. So it's saying here's uh it's the person who's
583900	587180	receiving the data telling the other end if it has any
587180	589280	restrictions in the block sizes right? So if you can think of
589280	594460	this again in terms of Ethernet this is kind of like uh uh uh
594460	597840	handshake working out like MTU sizes or something like that
597840	601120	right? Again these these these analogies are a little bit
601120	604740	strained but you know it's it's a way to think about it. But
604740	608020	then the first frame is 2. 2 means it's a multi-frame
608020	611360	message. And this is really good if you're like looking at the
611360	615040	dealer tools for taking a look at if you use the dealer tools
615040	617440	and look at the canned messages that are happening while the
617440	620460	dealer tools are like programming the ECU. It makes it
620460	624460	extremely obvious when there's a block of data going to a
624460	628380	particular location. Because it all starts with 2 and the
628380	633660	message ID is all 7 something or other. Uh in this case the
633660	635860	actual response doesn't matter too much. It was just because of
635860	641440	those two things I wanted to point out there. Alright. So
641440	645400	that's the basics of UDS. Um I could go in for quite a long
645400	647500	time going into detail of UDS which would probably bore
647500	651660	everyone more than you're already bored. Um unless you're
651780	654340	a standards nerd, you don't necessarily like looking at
654340	657220	standards. But it's useful to see that raw level of things.
657220	661460	Tools can usually can easily uh abstract what's the important
661460	664360	stuff that's going on behind the scenes that helps you have a
664360	667940	deeper understanding of what the how the computer is behaving.
668100	671020	So a couple useful tools I want to point out here. First one is
671020	674600	CanCat. Um I work with Grimm. We've uh we like CanCat. We use
674600	678340	it. It's not. There's a uh it has a lot of libraries for
678340	680400	allowing you to do the low level can stuff which is what we
680400	683660	demonstrate over at our booth. But we also have uh class in
683660	687820	there for UDS. It allows you to interact with uh ACU uh doing
687820	692240	UDS functionality. Um and what I'm gonna show here in the
692240	695740	second half is taking a look at a tool I wrote on top of the
695740	699460	CanCat stuff that allows you to essentially do Nmap style
699460	704460	scanning uh on a car. There's uh two other ones I'd like to
704460	707920	point out here that are capable of doing uh UDS things. First
707920	710780	one is carrying car- carrying caribou which I have a hard
710780	714000	time saying. Um it works pretty well. It works with standard
714000	718200	Python can stuff. Uh if you have a socket can capabilities like a
718200	722840	cantact, uh this will work well with it. Um it also does UDS
722840	725660	scanning. Scapey can also do this as well. As much as I love
725660	729580	Scapey, it's not uh the interface is a little bit harder
729580	731960	to use unless you're familiar with how it's working. In this
731960	741300	particular case. So can utils um the raw low-level socket can
741300	744280	that if you run in Linux, you've got socket can. You've got can
744280	747420	utils. They're installed by default, pretty sure, on most
747420	751260	distributions. Uh but the thing is they interact with the raw
751260	753180	can messages. They don't necessarily give you the UDS
753180	757100	capabilities. Um what we demo over at our booth for just
757100	759640	recording and replaying messages, you can do that with
759640	762900	can dump and can player. Uh can sniff is also a really useful
762900	767320	tool. Unfortunately can sniffer isn't actually support 29 bit
767320	769980	messages. There's a pull request that's been open for like a year
769980	773220	for it. Uh you can go and look at the pull request if you want
773220	775520	to go and see it. You can go find a particular patch and
775520	778720	download it and compile it. So it's useful for low-level
778720	782400	things but uh once you start getting to higher-level
782400	785860	protocols, uh you need to usually need to step outside of
785860	792200	something like socket can. And here, like I said, you can use
792200	795300	the can message uh can utils for doing can injection. And
795300	797700	here's just a simple example. You don't really see it
797700	800420	interacting with the vehicle at this point but what I did was I
800420	803680	hit can dump. I started logging. I hit the unlock button. And
803680	807440	then I can't, I control C to kill the can dump. Then I take
807440	810320	the can dump that was generated and I run it through can player
810840	814180	and I watch the car unlock itself, right? So this is again
814260	818620	a simple example of message injection with can utils. Can
818620	822280	sniffer is another useful one um and this allows you to do
822280	825520	like an interactive viewing of the messages that are going on
825520	828680	the bus. You hit the pound sign and then it will slowly shrink
828680	831360	the window like notches the messages it's receiving. And
831360	834260	then it highlights, if you give it the dash C flag, it'll
834260	837560	highlight the new messages it receives. So in this particular
837560	840440	case, what I did was I started can sniffer and then I was
840440	843920	periodically hitting the lock, unlock button. And if you got a
843920	848180	sharp eye, you might notice what message ID is actually doing the
848180	853100	door unlocking in this case. Or if you already did, figured it
853100	856780	out when you were taking a look at it on our booth. But anyway,
856780	860760	so again, hit the lock, hit the unlock message, unlock button on
860760	863260	the key fob and the message popped up, you're highlighted
863260	870800	with the changed bytes in red. Can escapee again, so there's
870800	873940	the uh, there's the incantation for doing it. You can go on the
873940	877760	escapees, read the docs page and it will, there's a good lot of,
877760	879900	there's a lot of information there about using escapee for
879900	883580	automotive testing. And you know, this is just a simple
883580	886640	example. Again, you can do can sniff, this again records all
886640	889520	the messages and you can, it's a python interactive shell and you
889520	892320	can interact with them using all the different python tools
892320	898400	escapee presents. Caring caribou, again this is uh, doing
898400	902180	an ECU scan. So this is starting to get into more of what I was
902180	905820	talking about. How you can use UDS capabilities to identify
905820	909840	what's on the bus. So this again was looking, I was scanning
909840	915320	3PO and I did UDS discovery. This is just using uh, the can,
915320	919380	cannibal, I was uh, little $10 piece of hardware. And it's fi-
919380	922240	going through all the different ECUs to find out what's present
922240	925080	on the bus. And you can see here it's finding different things.
925080	927000	It's finding some things that are standard, it's finding some
927000	930040	things that are not standard. The particular results in this
930040	934120	case don't matter too much. It's nicer to have something animated
934120	942840	on the screen. So UDS, uh, one of the nicest, well okay, the
942840	945660	functionality of, not the nicest, but one of the nicer
945660	948940	things about UDS is the error codes. They're extremely
948940	951040	verbose. This is one of those things where you take a look at
951140	953880	a protocol and you can tell it was written by an engineer.
953880	959240	Because they say, well I want to know why this didn't work. I
959240	961420	want to know why this didn't work. So there's, well, there's
961520	963520	a byte for the messages. So you've got a couple hundred
963520	966880	possibilities of what the error code is. They're not all valid
966880	970080	but a lot of them are valid. And here's some of the common ones.
970180	972620	Service not supported. Conditions not correct, which is
972620	976320	an interesting one. Security access denied. Invalid key.
976800	980400	Exceeded number of attempts. Uh, so exceeded number of attempts
980400	983300	for example is one where if you're trying to do a security
983300	986800	access, what should happen if you do it wrong is you're
986800	989320	supposed to then get an error message back saying that you
989320	992880	ran out of attempts. Well, sometimes it happens, sometimes
992880	996480	it doesn't. Uh, conditions not correct is a good one because
996480	999460	what it's saying is I can't do the thing that you're asking
999460	1003620	for but I am capable of doing it if the conditions were correct.
1003620	1006740	So then you've got to figure out what those conditions might be.
1006740	1009340	Again, it lets you start narrowing down the type of
1009340	1011920	functionality you're looking for. There's also a really
1011920	1015880	verbose section of errors like RPM too high, RPM too low.
1015880	1019660	Engine is running. Engine is not running. Uh, throttle pedal
1019660	1023420	too high, too low. Transmission not in neutral. Transmission in
1023420	1027700	gear. And not all of these different error codes are things
1027700	1031320	that all automakers implement. But when you see them, it allows
1031320	1034520	you to know that, well, great, this thing I've almost gotten
1034520	1038060	to the ability to activate this function. All I have to do is
1038060	1041640	change the conditions that the car is in. So again, this is
1041640	1044640	allowing you to scan the functionality. You don't have
1044640	1047040	any knowledge of what's going on. And it's allowing you to
1047040	1053920	figure out what is going on. So, UDS. So, because I can't help
1053920	1057600	myself, I named it CanMap. Because it's based on CanCat and
1057600	1063180	it helps you do end mapping of a car, right? That's the theory
1063180	1066340	anyway. So there's, there's my, there's my car. My own test
1066340	1071160	subject that I tested this on. Uh, to try and figure out what's
1071160	1075540	going on. So, again, uh, when you're taking, doing a pen test,
1075540	1077820	right? If you're doing a pen test, you want to figure out
1077820	1080920	what's on this network. What services are available on this
1080920	1084500	network? You run Nmap with a different range of IP addresses
1084500	1087920	and you come back with, there's a service there that gives you a
1087920	1090980	successful or an error, some error responses. It allows you
1090980	1094420	to know that that IP address is valid and allows you to know
1094420	1097500	what services may or may not be present on there. It can allow
1097500	1101500	you to detect if there's a firewall present. Um, so Nmap is
1101500	1103540	again a blind tool that lets you go through it and figure out
1103540	1107140	what's going on. CanMap is pretty much the same thing. And
1107140	1111440	of course Karen Caribou does similar things as well. But I
1111440	1114360	had the, I, I, I felt like doing it on my own. I don't really
1114360	1117560	like using tools that I've not wrote because I don't actually
1117560	1120720	ever understand how the tools work until I play with them
1120720	1124060	myself with my own hands. I might be the only one who ever
1124060	1126460	uses the tool, but the whole point is it's helped me learn
1126460	1129880	about how, how UDS works. It's written on top of CanCat. So
1129880	1133340	it's an example of how you can use CanCat's existing API to
1133340	1137500	interact with the bus. So use it as a way to learn how CanCat
1137500	1140100	stuff works. Uh, use it as a tool, standalone tool by
1140100	1145120	itself. Um, whatever you, use this as an example or a chance
1145120	1148120	to explore other new tools. As long as people are going out and
1148120	1154320	learning new things, that's my goal. So, first thing the tool
1154320	1159200	has right now, uh, because it's brand new, is it allows you to
1159200	1165280	scan for ECUs. Right here, and it'll start over in a second. So
1165280	1168060	it allows you to, first thing I'm doing is scanning for ECUs.
1168060	1169920	There's a couple different ways you can do this. Any
1169920	1172940	functionality you can send to an EC, any function you can
1172940	1176640	request. So the things I pointed out earlier, redid, diagnostic
1176640	1181880	session control, uh, data transfer, ECU reset, there's all
1181880	1185060	these things that you could send that would allow you to check if
1185060	1189400	an address is valid. Um, in this particular case, the one of the
1189720	1192820	default modes is just reading a DITS. So it tries to read the
1192820	1197200	VIN out of a vehicle. And you can see a bunch of things coming
1197200	1200360	back here. So it's detecting that, that if there's a
1200360	1206500	nonstandard response, um, and it logs it in different ways. There's
1206500	1208820	different, this is just the way that I had figured out how I
1208820	1215230	wanted to do it. I want to, uh, talk a little bit too about how
1215230	1219030	the scanning works. UDS works, uh, UDS is the basis of all the
1219030	1221730	different functionality that like the dealer tools use. When
1221730	1224370	the dealer goes and interacts with an ECU, if they need to
1224370	1227270	reprogram it, they're going to use the UDS protocol to get this
1227270	1230710	to happen. Well, one of the things that's being hap- that's
1230710	1233290	happening on newer vehicles is there's a CAN gateway sitting on
1233290	1236410	the OBD2 port. That's supposed to only let the certain things
1236410	1238570	through that are allowed to go through to the rest of the
1238570	1242090	vehicle. One of the things that by design it has to allow
1242090	1246490	through is the UDS messages that allow the dealer tool to interact
1246490	1250970	with the ECUs. Which means that you, using the UDS will help you
1250970	1254090	find things, even getting through a gateway. It's
1254090	1258130	essentially using a firewall's capabilities to allow you to go
1258130	1260510	through it on its own. You don't have to break through it as long
1260510	1267550	as it lets you through in a nice and friendly manner. So here's
1267550	1271750	the results, the results of my scan are output into a YAML file.
1272630	1276590	I'm not a fan of YAML but it does work well. And the YAML file
1276590	1279510	has the list of like what are the transmit IDs, what are the
1279510	1283410	response IDs and eventually what are the actual values of
1283410	1286990	different DIDS. Now what is the bus speed that I use for this?
1286990	1290630	And then this YAML file can be used in future scans that will
1290630	1293330	allow you to not worry about scanning for the ECUs because
1293330	1296110	you've got them already saved in the file and then you can use
1296110	1300250	those and go on and scan for other things. It's also got the
1300250	1303550	notes there indicating what the actual command you ran was. The
1303550	1306330	idea being that it should help you find out how long did the
1306330	1310170	scan take and uh what actually, how did you actually invoke the
1310170	1315510	command that generated the results you see there. So here
1315510	1318210	again scanning for DIDS, I'm not gonna show you an animated one
1318210	1321190	for that because it's just a ton of output. But I wanna point out
1321310	1325590	a couple things here. Again looking at the ISO TP frame IDs.
1325590	1328070	If you take a look at the bottom one, you'll see you've got the
1328070	1333950	0, 1, 3 and a bunch of 2s. Again that's very in, that's very
1333950	1337610	classic, it's an easy way to see looking at the raw CAN messages
1337610	1341910	that you're looking at an ISO TP uh block transfer. And then you
1341910	1345710	can actually see the read DID result there. In this case it
1345710	1351130	was uh one of the application identifiers. F182, whatever it
1351130	1356860	is, I don't know. One of the things I also wanna point out
1356860	1361160	about how UDS is useful in this case is by taking a look at the
1361160	1363860	contents that you can get out of the different data identifiers
1363860	1367100	on the different ECUs. Once you have extracted the firmware for
1367100	1370820	the ECU, they can act as good sign posts. Because it allows
1370820	1374040	you to have this particular string, search for that string
1374040	1377140	in the firmware somewhere. And then once you find it, you can
1377140	1379660	start finding the references. And you can uh, you know that
1379660	1383780	the references are going to be related to this particular CAN
1383780	1387840	function out. So it can allow you to go from a known info set
1387840	1390920	of information in the software that will allow you then figure
1390920	1393760	out how you get back there to the CAN stuff. And once you take
1393840	1395560	a look at the CAN functions, you can see what other
1395560	1403940	functionality might be available through that CAN interface. Uh
1403940	1406520	one of the other things that is nice about uh that I like about
1406520	1410340	the tool CANCAT, so it allows you to do a save session file.
1410340	1412240	You've recorded all this information, all these CAN
1412240	1414780	messages have been saved, you've been doing hours of testing.
1414780	1418500	Well, there's a function called save session to file. Uh you can
1418500	1421260	just type it interactively on the IPython shell, it's a normal
1421260	1425020	way. Or what, and what we can do here is if you pass the dash C
1425020	1429460	flag to CAN map, it'll save the session file for you also. It's
1429460	1432460	just a pickle, a Python pickle if you know how those work. Yes
1432460	1435300	they're insecure so don't unpickle other people's pickles
1435300	1438520	that they provide. If that phrase makes, if that sentence
1438520	1443240	makes sense. But it's really useful because it allows you to
1443240	1446160	take your logged output that you see, here's the results I
1446160	1449220	see, here's what's going on, and you can take a look at the raw
1449220	1453540	CAN messages themselves. So if something has gone weird, then
1453540	1455940	it can allow you to core, find out exactly what's going on
1455940	1459100	here. In my limited testing leading up to this, I didn't
1459100	1462240	have time to go through every scenario to figure out what
1462240	1464680	works, but being able to go through and look at the raw
1464680	1468100	messages helps you figure out what's going weird. The last
1468100	1470900	set of functionality I've gotten it is scan for diagnostic
1470900	1474700	sessions. Um, I've got the warning here because when I
1474700	1477740	started doing this, things do start acting weird because it
1477740	1481020	does involve, uh, putting the ECUs into different modes. I set
1481020	1484640	the immobilizer off on my car. It did clear as soon as I turned
1484640	1489260	the car on and off again. Off and on again. Uh, but again, this
1489260	1490820	is one of those things where once you start messing around
1490820	1493580	with different diagnostic sessions and ECU resets, things
1493580	1496660	can get weird. Uh, on the other hand, it can also help you
1496660	1500820	identify which ECU does what on a car. When I was doing this
1500820	1504320	scanning for sessions and I saw, okay, well here's the
1504320	1508500	session ID and then I see my radio start rebooting, I know
1508500	1512040	that that session ID is my radio. Because just looking at
1512040	1515420	the raw message IDs, you don't know which ECU those belong to
1516060	1519580	necessarily. But when you start seeing the actual physical
1519580	1522820	effects on the car, then you can start correlating that to what
1522820	1527540	ECU does what function. Again, here's some results. You can see
1527540	1529840	some of the weird errors I started getting. One of them was
1529840	1532680	like, when I go to a particular session, after I start scanning
1532680	1535660	long enough, then it just, it just kind of stopped responding
1535660	1539960	in a friendly manner. Um, again, I'm not entirely sure why, but
1539960	1542520	looking at the raw messages can help you diagnose what's going
1542520	1546260	on. And again, this is the first version of it. It'll get better.
1546260	1548780	It's still sitting in a pull request up to the main CANCAT.
1548780	1554940	So, uh, it'll get there eventually. Uh, the, oh, that
1554940	1559700	must be a later slide. So, real quick wrap up. UDS helps you to
1559700	1563100	enumerate the vehicles and taxis. Let's you figure out what
1563100	1565700	ECUs are present. It lets you figure out what data is in
1565700	1568520	there. The data can then be used to more easily reverse engineer
1568520	1572040	what's going on in the thing. I do want to point out that UDS
1572040	1576080	itself is not necessarily a vulnerability in and of itself.
1576220	1579040	It's simply a way to discover the functionality that's present
1579040	1582400	on the vehicle. The functionality itself might be
1582400	1585700	the vulnerability, right? If I'm alive, if I can do things to a
1585700	1592120	car that are bad, if I can, uh, put my, if I can unlock a
1592120	1595140	vehicle from an external location, that itself is the
1595140	1597520	vulnerability. Not the fact that I found out I could do it with
1597520	1601840	UDS. Uh, if I can put an ECU into diagnostics mode while the
1601840	1606060	car is running and then, uh, impact the vehicle dynamics,
1606060	1608500	that is the vulnerability. Not the fact that I use a session
1608500	1612820	control to do it. This is again similar to the way different
1612820	1615740	protocols work. Uh, in, in, if you're talking, thinking about
1615740	1618680	regular computers. I could go on forever with these if I had
1618680	1625980	time, which I don't. Um, again, the more tools, the better. So I
1625980	1629020	like Canmap, Kirin, Caribou, Scapey, other options out there.
1629060	1632580	Uh, and lastly, go out there, scan, be curious, play with your
1632580	1638920	own car, uh, and have fun. That's it. I know it was really
1638920	1646190	quick. And if you have any questions, uh, we don't have
1646190	1648850	time right now, unfortunately, but please, uh, I'll stand
1648850	1651250	around afterwards. If you have questions, let me know and I'll
1651250	1654270	answer them or go into more detail if you wish. A couple
1654270	1656470	links here. If you haven't yet read Chris and Charlie's paper,
1656470	1659870	it goes a lot into UDS and security access key, uh, uh,
1659870	1663030	the seed key pairs. That's very valuable to go and look at. It
1663030	1665110	talks about reverse engineering those algorithms out of the
1665110	1668090	dealer tools. The dealer tools are always a valuable resource
1668090	1670110	when you're trying to figure out what the capabilities of a
1670110	1672990	vehicle are. Uh, and again, some links to the other different
1672990	1680870	CAN tools here. That's it. Yes? Uh, yeah, question was if I've
1680870	1682950	messed with the Tesla 3. I've not personally messed with the
1682950	1692290	Tesla 3. Anyway, I'm pretty sure I'm out of time. It is in a poll
1692290	1695230	request up on the CANCAT repo. So if you go up to CANCAT and
1695230	1697070	you look for pull requests, you'll find one of them that's
1697070	1701350	branch labeled CANMAP. So it's working on it. It was a lot of
1701350	1705050	code changes, so it is, uh, it was a lot of code changes, so
1705050	1707530	it's gonna take a little while to review and make, and fix all
1707530	1719000	the stylistic things that I've messed up. Alright, question was
1719000	1721560	about emulators, so for messing around with this. If you play
1721560	1724300	with the SocketCAN tools, you can create a virtual CAN device
1724300	1727480	which will allow you to play back pre-recorded data. Uh, I
1727480	1732260	did, did create a testing CAN interface for CANMAP. Uh, it's
1732260	1734060	kind of limited at the moment though, but it allows you to
1734060	1736280	kind of fake out the high level stuff, but not the low level
1736280	1744180	ones. So, short answer is, kind of. Right, yeah, and there's
1744180	1746840	also tool, we also have a tool in CANCAT now that allows you to
1746840	1752060	go between SocketCAN dumps and, uh, P, or PCAPs and CANCAT
1752060	1754960	sessions files. So you can convert from one to the other to
1754960	1757840	play with them if you wanted to. But, uh, that is functionality
1757840	1761700	I would like to do eventually. But, I'm now a couple minutes
1761700	1764180	past time. Whoever's next is gonna need to get up here, so I
1764180	1769200	do need to shut down. Thank you everybody for being here. And
1769200	1770600	I'll be hanging around afterwards.
