start	end	text
0	15720	Okay, so hi all Welcome to the You know, the topic of my presentation is context-aware anomaly detection in Automotive CANN without decoding So my name is Ravi Rajput.
15720	29020	I'm a principal architect and information security at Neotech Global I have expertise in telecom and automotive service security and I had
33700	40060	I spent my life in Advanced pen testing.
40400	64720	I had launched an AutoAC OS, which is an operating system designed for automotive pen testing and it was launched in BlackHat Arsenal in Asia and it has been It has reached millions of downloads now and it has been used by VMs I am a core team member of a telecom village at DefCon I had been I had presented at DefCon,
64720	100820	BlackHat, HITV, NullCon, HitCon and several besides conferences So the agenda of today's talk is we will talk about how the CAN bus is blind and how the machine learning can detect the anomaly without the use of decoding it So we will go ahead with the demo as well We will we will talk about the working mechanism of the models that are the algorithms that will be used and We will discuss about the key findings and result and the deployment possibilities as well.
100880	106940	And later we will have a Q&A So CAN bus is blind, right?
107340	112360	The problem with CAN bus is there is no authentication Encryption or integrity check.
112360	113680	There is no sanity checks.
113860	121840	It's a broadcast architecture So every ECU can receive the message or can send the message, right?
121920	156420	No built-in support for access control or anomaly detection the traditional Detection is based on the rules that catches the you know patterns There is no state awareness, okay, it's a stateless protocol CAN is a stateless protocol so it allows a malicious actor to inject the inconsistent state triggering the alerts Over here,
156420	198060	we will use the machine learning algorithm to detect the CAN anomalies it Rely heavily on the you know protocol decoding the traditional way depends on the decoding while the approach That can be used for anomaly detection in CAN is supervised and unsupervised learning While the challenge with the supervised learning is that we need and CAN dataset labeled to understand the anomalies while the unsupervised Unsupervised learning doesn't need that,
198060	201160	and that is the reason we will go with unsupervised.
202580	214580	And if we see CAN messages as sequential and time-sensitive, we will be able to detect the anomalies.
215540	220240	So anomalies doesn't mean that one wrong message, it's a break in the context.
221540	233520	So, you know, the problem that I was trying to address was like every vehicle model have a different structure, signal, meanings, and encodings.
233520	236880	So it's not scalable across the fleets or vendors.
237320	250300	The solution for it is try to find out the frequency of CAN IDs and the burst patterns, payload byte entry entropy, timing deltas, and sequence correlation.
251100	258680	The algorithm that can be used for detecting will be LSTM, and the better version will be LSTM VAE.
260380	267240	So it can learn what a normal sequence of CAN messages look like.
267240	274420	And when the frequency changes, what will be the, you know, correction error.
275420	282340	So autoencoders are trained on normal behavior, and it reconstructs the expected output.
282340	290460	Whatever the deviation is, if it is above some threshold, it is detected as an anomaly.
291700	296540	So and then why LSTM and LSTM VAE?
296540	300760	So LSTM is long short-term memory network.
301180	314360	It knows what is to forget, what is to remember, and what is to be, like, so it knows the memory to be remembered.
314480	324800	So it sees the, you know, the whole network as like the whole messages as a, what we say, the sequence.
325450	329350	Okay, rather than picking up the messages separately.
330140	343750	It's like a musician, you know, trying to play a music and if he misses a note or do some minor mistake, the whole music is disrupted.
344260	347380	That is how the LSTM also works.
347380	349030	It's a sequential thing.
350170	357190	So the VAE adds a variational interface, inference to the standard VAE.
357190	359750	It adds actually a latent distribution.
361430	368670	So the intuition behind this LSTM is feed-free, feed-forward network.
369790	370190	Okay .
371450	378830	So it maintains, like, it has three gates, what to forget, what to remember, and what to output.
379050	381990	Okay, so it maintains the cell state.
382330	390610	Okay, so why the neural net failed for the sequence is there is no understanding of sequence flow and the time dependencies.
390690	399230	So if we map the message IDs with the time, we will be able to understand the pattern and if there is a burst, there is a change in the pattern.
399230	403530	We will be able to detect the anomalies above some threshold.
405770	410390	So the sequence-to-sequence model will be like input sequence encoder.
410870	416450	It will be feed to latent vector, then decoder, and it will try to reconstruct the sequence.
416990	421230	Okay, the reconstruction error is typically mean sequence error.
421590	427150	Okay, it will try to minimize this sequence error, but it still gets above.
427810	430470	It will try to detect that.
430470	452490	It's something like if I am driving my car from 0 to 10 to 20, then 25, 30 kilometers per hour, but there is a message saying that 0, then 10 kilometers per hour, but then all of a sudden there is a 100 kilometers per hour of message, then it is the change in a pattern.
452630	454750	This is what LSTM detects.
456310	482970	So, so that there is an input that you have to, like the input will be the sequence of 10 frames, typically shaped as, you know, sequence length, and we have to do the feature extraction engineering, like feature engineering, and then read the, the encoders will read the input sequence one time step at a time.
507540	509800	Clearly, that anomalies are there.
511240	520220	So the LSTM way is basically the extension of autoencoders with a latent variable on the distribution.
521040	542140	Okay, so basically it has loss function is into two parts reconstruction loss, which actually measures how well the sequence is rebuilt, and the KL divergence loss, which measures how the how far latent distribution deviates from the standard normal.
542680	555200	So it's a while you can consider this autoencoder as a, you know, not distributed, but this can be taught as a distributed as like the way.
558460	563770	The major part of way is latent sampling.
564200	566920	Okay, which introduced the control noise.
566920	574690	Okay, that's a major difference between we and auto LSTM autoencoder.
575660	583180	Why uncertainty matters in a can or anomaly detection is automotive networks are noisy and busty.
583180	586160	Static threshold can cause false positives.
586560	590880	Okay , need models that can express confidence, not just anomalies.
591840	598760	And how this LSTM way tackles uncertainty is learns the distribution of a valid behavior rather than a fixed pattern.
600160	604060	It produces a latent vector with a mean and variance.
605040	617460	And samples from that mean and variance to the variability and more tolerance to the natural deviation.
617460	627000	So if we talk about the real-life example, replay attack basically detected with the wrong timing.
627000	632360	That is a latent shift draft KL spike in the divergence spike.
632860	636280	While the fuzzing is detected on the entropy spike.
637820	657600	Okay, so the data pipeline for the demo that we will do currently is we will, you know, collect the log for the normal, you know, canvas for training the data for training the model.
658580	669480	While the attack.log will be used for evolution, and it will extract the timestamp canid and payload byte.
669580	677320	Then it will filter the, you know, this non-standard form of frames and discard that.
677720	688610	We'll try to find the difference in timestamp as a delta t, then the entropy and the frequency of canid in a sliding window.
690200	700310	Feature engineering constructs a sequence of windows basically and tries to normalize the min-max or Z-score.
701380	706750	Then we will train the model and then inference the scoring.
707480	712530	So rather than going through the slides, let's do some demo.
714290	721150	The simple demo will be by using the ICSIM.
722530	726830	Okay, so I'm trying to increase the speed and left and right.
727210	737430	Okay, so what we will do here is we'll try to capture the normal log.
742240	746280	And we will do some normal activity.
746440	758720	Okay, and we'll first this other canids as well.
758720	763820	So the main target canid will be on the door that is 19B.
764460	772280	Okay, so the door lock and unlock mechanism that is 19B basically canid.
772280	774040	So we are capturing that.
778330	783130	Okay, so now it must be enough.
789560	791200	Yeah, perfect.
793280	803260	Now on the one screen, we will try to fuzz on particular canid 19B.
803300	809440	While on the second, we'll run the... we'll capture the log.
824280	826740	Okay, as you can see here.
827920	834780	The door, we are basically fuzzing on the door canid.
842340	845580	We'll give five more seconds.
849010	853230	Hey, Ravi, just a heads up, you've got five minutes left for your presentation.
855130	857790	Okay, just five minutes.
859150	865030	Yeah, they need five minutes to get the next speaker on before, so sorry.
866670	881250	Okay, so rather than going on this, I will show you the already experimented one and the results.
891870	895550	So we'll get the logs from here and on this.
895900	905060	And once you run, you will find the feature engineering and you will find the time delta and the entropy.
905600	920090	Okay, the sequence generator will get the MSE loss and you will get the MSE loss graph.
920090	929110	Then the model will try to detect the anomalies over the top five canids.
930470	934770	Okay, over here, you can see the canid 19B is detected.
934770	938610	There is a little bit of a false positive.
938610	954630	While if you can see on this VE, which is more robust algorithm, you will see that 19B is detected as highest entropy and anomaly detection.
955510	961930	And you can see the peak of this canid.
962210	969270	While you can see this, the entropy is very much over here, which can be concluded that anomaly.
971230	979970	And these are the other graphs that we can discuss, but due to the lack of time, we will go with just a simple output of this.
979970	983950	I will publish this on GitHub as well after the talk.
985050	989170	And it will give you the reconstruction error, but that we had already talked about.
989170	991930	The reconstruction error will be high.
991930	995670	That is how the anomaly detection will be detected.
995670	1004210	So let's talk about the key findings, the unusual or previously unseen IDs.
1006510	1007250	Sorry
1011880	1021050	, the unseen IDs during replays in rare IDs showing up high frequency will be detected as can anomalies.
1021540	1028820	Payload entropy spikes and timing deviations will be shown as anomalies.
1028940	1038140	While you can go ahead with VE is another version of like LSTM's VE is another version for the replay attack detection.
1038140	1048440	And for the deployment possibilities are you can deploy this lighter version of this model on your ECUs as well.
1048440	1055280	And this can be the best option for your VSOC as well as SIEM solutions.
1055980	1060160	Yep, so let's move to the Q&A.
1060600	1064560	Maybe we have time for one question.
1064560	1066600	I think we might have time for one question.
1066600	1068180	We only have two minutes left.
1068180	1071340	Is anyone in the audience got anything to ask?
1077990	1080770	The question was, what is the application for this?
1080770	1084230	Is this specially designed for intrusion detection?
1086310	1088130	Yeah, currently it is.
1088590	1092150	I'm currently experimenting on intrusion detection only.
1092330	1097950	Still not have figured out for the, you know, prevention part.
1097950	1101190	Is that good?
1101990	1104710	I think we're out of time now.
1104710	1107450	So thank you so much, Ravi, for your presentation.
1108490	1109790	Thank you.
1110010	1111610	Thank you so much.
1112250	1116350	You can reach out to me on social media anytime.
1117910	1119030	Thank you.
1119030	1119590	Thank you.
1119590	1120270	Thank you.
