<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ECU &#8211; @Forensicxs</title>
	<atom:link href="https://www.forensicxs.com/tag/ecu/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.forensicxs.com</link>
	<description>Ethical Hacking &#124; Cybersecurity</description>
	<lastBuildDate>Mon, 27 Dec 2021 14:46:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Car Hacking</title>
		<link>https://www.forensicxs.com/car-hacking/</link>
					<comments>https://www.forensicxs.com/car-hacking/#respond</comments>
		
		<dc:creator><![CDATA[Forensicxs]]></dc:creator>
		<pubDate>Sat, 25 Dec 2021 18:58:19 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[attacks on the CAN bus]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[CAN Bus]]></category>
		<category><![CDATA[CAN-UTILS]]></category>
		<category><![CDATA[cansend]]></category>
		<category><![CDATA[cansniffer]]></category>
		<category><![CDATA[Car Hacking]]></category>
		<category><![CDATA[car tuning]]></category>
		<category><![CDATA[ECU]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[firmware update]]></category>
		<category><![CDATA[Flashing]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[ICSim]]></category>
		<category><![CDATA[Intrusion Detection System]]></category>
		<category><![CDATA[Kayak]]></category>
		<category><![CDATA[Keil]]></category>
		<category><![CDATA[MEMS]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[microcontrollers]]></category>
		<category><![CDATA[Nucleo-64 STM32F103RB]]></category>
		<category><![CDATA[OBD]]></category>
		<category><![CDATA[remote car hacking]]></category>
		<category><![CDATA[seed to key]]></category>
		<category><![CDATA[socketcand]]></category>
		<guid isPermaLink="false">https://www.forensicxs.com/?p=2439</guid>

					<description><![CDATA[Hacking cars has started to make big headlines in the last years. In this article, I&#8217;m going to uncover the basic techniques used in car hacking, review related topics such as embedded software, CAN network, detecting and blocking attacks, and more Here below a short summary of some key research studies, about security flaws found &#8230; <p class="link-more"><a href="https://www.forensicxs.com/car-hacking/" class="more-link">Continue reading<span class="screen-reader-text"> "Car Hacking"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Hacking cars</span></strong> has started to make big headlines in the last years. In this article, I&#8217;m going to uncover the basic techniques used in car hacking, review related topics such as embedded software, CAN network, detecting and blocking attacks, and more</p>



<p>Here below a short summary of some key research studies, about security flaws found on real cars and their software solutions :</p>



<figure class="wp-block-table is-style-regular"><table class="has-cyan-bluish-gray-color has-text-color"><thead><tr><th class="has-text-align-center" data-align="center">   Year</th><th class="has-text-align-center" data-align="center">     OEM</th><th class="has-text-align-center" data-align="center">                                     Attack vector</th><th class="has-text-align-center" data-align="center">                   Article</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">2015</td><td class="has-text-align-center" data-align="center">Chrysler</td><td class="has-text-align-center" data-align="center">Mobile phone remote manipulation</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3yirW80" target="_blank" rel="noreferrer noopener">https://bit.ly/3yirW80</a></td></tr><tr><td class="has-text-align-center" data-align="center">2016</td><td class="has-text-align-center" data-align="center">Tesla</td><td class="has-text-align-center" data-align="center">Malicious Wi-Fi hotspot</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3dKVVfm" target="_blank" rel="noreferrer noopener">https://bit.ly/3dKVVfm</a></td></tr><tr><td class="has-text-align-center" data-align="center">2016</td><td class="has-text-align-center" data-align="center">VW</td><td class="has-text-align-center" data-align="center">Key cloning<br>Wireless signal</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3lTXyf5" target="_blank" rel="noreferrer noopener">https://bit.ly/3lTXyf5</a></td></tr><tr><td class="has-text-align-center" data-align="center">2016</td><td class="has-text-align-center" data-align="center">Nissan</td><td class="has-text-align-center" data-align="center">Authentication API</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3rWPQVB" target="_blank" rel="noreferrer noopener">https://bit.ly/3rWPQVB</a></td></tr><tr><td class="has-text-align-center" data-align="center">2018</td><td class="has-text-align-center" data-align="center">BMW</td><td class="has-text-align-center" data-align="center">Mobile phone remote manipulation<br>Malware attack on USB/OBD</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3ERqDzi" target="_blank" rel="noreferrer noopener">https://bit.ly/3ERqDzi</a></td></tr><tr><td class="has-text-align-center" data-align="center">2019</td><td class="has-text-align-center" data-align="center">MyCar</td><td class="has-text-align-center" data-align="center">Hardcoded credentials</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3rTAAsy" target="_blank" rel="noreferrer noopener">https://bit.ly/3rTAAsy</a></td></tr><tr><td class="has-text-align-center" data-align="center">2020</td><td class="has-text-align-center" data-align="center">Mercedes</td><td class="has-text-align-center" data-align="center">Mobile App <br>Embedded SIM</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3dFOMgx" target="_blank" rel="noreferrer noopener">https://bit.ly/3dFOMgx</a></td></tr><tr><td class="has-text-align-center" data-align="center">2020</td><td class="has-text-align-center" data-align="center">Toyota</td><td class="has-text-align-center" data-align="center">Bluetooth services</td><td class="has-text-align-center" data-align="center"><a href="https://bit.ly/3pWo9tw" target="_blank" rel="noreferrer noopener">https://bit.ly/3pWo9tw</a></td></tr></tbody></table></figure>



<p>The software manipulations addressed in the above articles, required unique and extensive <strong><span class="has-inline-color has-luminous-vivid-orange-color">technical knowledge</span></strong>, prolonged <strong><span class="has-inline-color has-luminous-vivid-orange-color">physical access</span></strong> to the target vehicle, and extended periods of <strong><span class="has-inline-color has-luminous-vivid-orange-color">time</span></strong> to write code and exploit</p>



<p>Cybersecurity researchers who made these studies have been <strong><span class="has-inline-color has-luminous-vivid-orange-color">responsibly disclosing</span></strong> the flaws found, first of all to the OEM, before releasing anything to the general public</p>



<p>The exploitation of these vulnerabilities in the manner developed in these articles, is extremely <strong><span class="has-inline-color has-luminous-vivid-orange-color">sophisticated</span></strong>, and the <strong><span class="has-inline-color has-luminous-vivid-orange-color">likelihood</span></strong> of such conditions to occur in the real world is therefore <strong><span class="has-inline-color has-luminous-vivid-orange-color">limited</span></strong></p>



<p>However, as more and more softwares are <strong><span class="has-inline-color has-luminous-vivid-orange-color">embedded</span></strong> into cars, and vehicles are connected to <strong><span class="has-inline-color has-luminous-vivid-orange-color">remote OEM service solutions</span></strong>, the risk to face major hacks can only increase</p>



<p>Now, let&#8217;s start our review</p>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">Cars are computers with wheels</span></strong></p>



<p>Today&#8217;s cars are very complex equipments</p>



<p>First of all, they are full of <strong><span class="has-inline-color has-luminous-vivid-orange-color">sensors/actuators</span></strong>, as without them, a smart car would be totally blind and unable to take control following the driver inputs</p>



<p>These sensors/actuators range from cruise control, wheel speed, tire pressure&#8230;to lane departure, rear camera, airbags, and so on</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="563" src="https://www.forensicxs.com/wp-content/uploads/2021/12/0931e130157611.5615beadf41b9-1024x563.jpg" alt="" class="wp-image-2453" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/0931e130157611.5615beadf41b9-1024x563.jpg 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/0931e130157611.5615beadf41b9-300x165.jpg 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/0931e130157611.5615beadf41b9-768x422.jpg 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/0931e130157611.5615beadf41b9.jpg 1200w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>Most of these sensors/actuators are based upon <strong><span class="has-inline-color has-luminous-vivid-orange-color">MEMS</span></strong> or Micro Electro Mechanical Systems, and constitute the technology of microscopic devices, particularly those with moving parts</p>



<p>They usually consist of a central unit that processes data &#8211; an integrated circuit chip such as a <strong><span class="has-inline-color has-luminous-vivid-orange-color">microcontroller</span></strong> &#8211; and several components that interact with the surroundings &#8211; such as microsensors</p>



<p>MEMS are based upon <strong><span class="has-inline-color has-luminous-vivid-orange-color">semiconductor</span></strong> device fabrication technologies, normally used to make electronics, and adapted to their specific requirements</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="What are MEMS and Why Do We Care?" width="525" height="295" src="https://www.youtube.com/embed/fQsKuXkfTtQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>The signals received by the sensors are processed by on board &#8220;computers&#8221; or ECU, who then relay instructions to the actuators</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">An electronic control unit (ECU)</span></strong>, also known as an electronic control module (ECM), is an embedded system that controls one or more of the electrical systems or subsystems in a vehicle. Some modern vehicles have up to 150 ECUs</p>



<p>Each ECU is connected to several sensors/actuators and electrical systems</p>



<figure class="wp-block-gallery columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img decoding="async" width="961" height="562" src="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-1.png" alt="" data-id="2455" data-link="https://www.forensicxs.com/?attachment_id=2455" class="wp-image-2455" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-1.png 961w, https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-1-300x175.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-1-768x449.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption class="blocks-gallery-item__caption">ECU with sensors/actuators </figcaption></figure></li><li class="blocks-gallery-item"><figure><img decoding="async" width="941" height="511" src="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture2-2.png" alt="" data-id="2456" data-full-url="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture2-2.png" data-link="https://www.forensicxs.com/?attachment_id=2456" class="wp-image-2456" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture2-2.png 941w, https://www.forensicxs.com/wp-content/uploads/2021/12/Capture2-2-300x163.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/Capture2-2-768x417.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption class="blocks-gallery-item__caption">ECU from Bosch</figcaption></figure></li></ul></figure>



<p>The development of most ECUs is carried out by Tier 1 suppliers based on specifications provided by the OEM</p>



<p>As part of the development cycle of an ECU, manufacturers perform detailed analyses to catch failure modes that can lead to unsafe conditions. Extensive testing and validation activities are carried out to gain confidence in the hardware and software</p>



<p>Within the ECU, are <strong><span class="has-inline-color has-luminous-vivid-orange-color">microcontrollers</span></strong> such as the one below from Infineon</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image.png" alt="" class="wp-image-2454" width="341" height="387" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image.png 802w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-264x300.png 264w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-768x872.png 768w" sizes="(max-width: 341px) 100vw, 341px" /><figcaption><a href="https://bit.ly/3s4UKjv" target="_blank" rel="noreferrer noopener">https://bit.ly/3s4UKjv</a> : TLD5542-1_MULTI_EVAL</figcaption></figure>



<p>The microcontroller will manage the I/O electric signals (Inputs/Outputs) received from the sensors and to be sent back to the actuators</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Flashed</span></strong> into the microcontroller chipset, there is an <strong><span class="has-inline-color has-luminous-vivid-orange-color">embedded software</span></strong>, providing all the intelligence to perform the necessary calculations. Let&#8217;s go deeper in the following section</p>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">Embedded software</span></strong></p>



<p>First of all, here is a video introduction. It features the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Arduino</span></strong> architecture, as it provides a versatile and low cost solution, to start with embedded softwares</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="1. Introduction to Embedded Systems" width="525" height="295" src="https://www.youtube.com/embed/9Q-3c0gQcok?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Now let&#8217;s create a simple embedded software, called the &#8220;LED Flasher&#8221;. It will blink the LED on our device. It&#8217;s a very basic program, it is the &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">hello world</span></strong>&#8221; of embedded softwares</p>



<p>I purchased a <strong><span class="has-inline-color has-luminous-vivid-orange-color">Nucleo-64 STM32F103RB</span></strong> <strong><span class="has-inline-color has-luminous-vivid-orange-color">microcontroller</span></strong> from ST-Microelectronics, as it provides an affordable and flexible way for users to try out new concepts and build prototypes (<a href="https://bit.ly/3pNrwCR" target="_blank" rel="noreferrer noopener">https://bit.ly/3pNrwCR</a>)</p>



<p>This board is compatible with Arduino. It is based upon the <strong><span class="has-inline-color has-luminous-vivid-orange-color">ARM</span></strong> processor architecture</p>



<p>You can also follow this section without buying the board, as you can run the embedded software in simulation mode (the hardware being simulated). In all cases, you need a <strong><span class="has-inline-color has-luminous-vivid-orange-color">Windows PC</span></strong></p>



<p><strong><span class="has-inline-color has-vivid-red-color">IDE basics</span></strong></p>



<p>We will need an <strong><span class="has-inline-color has-luminous-vivid-orange-color">IDE</span></strong> &#8211; Integrated Development Environment including the following software components :</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-8.png" alt="" class="wp-image-2470" width="288" height="405" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-8.png 462w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-8-213x300.png 213w" sizes="(max-width: 288px) 100vw, 288px" /></figure>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Editor</span></strong> : this is where you write the code for your embedded system</p>



<p><span class="has-inline-color has-luminous-vivid-orange-color"><strong>Compiler</strong></span> : it is used when you are done writing your source code. Its function is to convert the source code into object code, which are understandable by computers as it is a low level programming language</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Assembler</span></strong> : the function of an assembler is to convert a code written in assembly language into machine language. All the mnemonics and data are converted into op codes and bits by the assembler, as our chipset only understands binary and it works on 0 or 1</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Debugger</span></strong> : this is a tool used to debug your code. The debugger goes through the whole code and tests it for errors and bugs, for example a run time error or a syntax error and notifies you wherever it occurs</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Linker</span></strong> : it is a computer program that combines one or more object code files and library files together into an executable program. It is a very common practice to write larger programs, into small parts and modules to make the job easier, and to use libraries. All these parts must be combined into a single file for execution, so this function requires a linker</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Libraries</span></strong> : it is a pre written program that is ready to use and provides specific functionality. For Embedded Systems, libraries are very important and convenient. Library is a file written in C or C++ and can be used by different programs and users. For example, Arduino microcontroller comes with a number of different libraries that you can download and use while developing your software. For instance, controlling a LED or reading a sensor can be done with a library</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Simulation</span></strong> : a simulator helps you to see how your code will work in real time. You can see how sensors are interacting, you can change the input values from sensors, and you can see how the components are working and how changing certain values can change parameters. You can also simulate a target architecture</p>



<p>We can select <strong><span class="has-inline-color has-luminous-vivid-orange-color">Keil µVision</span></strong> IDE, as this software includes all components : compiler, assembler, linker, debugger, simulator and more. It is compatible with our Nucleo board</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-4.png" alt="" class="wp-image-2462" width="296" height="287" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-4.png 521w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-4-300x291.png 300w" sizes="(max-width: 296px) 100vw, 296px" /><figcaption><a href="https://bit.ly/3IJo3O7" target="_blank" rel="noreferrer noopener">https://bit.ly/3IJo3O7</a></figcaption></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">IDE Installation</span></strong></p>



<p>You need to download the <strong><span class="has-inline-color has-luminous-vivid-orange-color">ARM Microcontroller Development Kit</span></strong> (MDK-ARM). After installation, you need to specify the devices that you are going to use for coding. For this, launch the Keil Pack Installer</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-10.png" alt="" class="wp-image-2475" width="347" height="224" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-10.png 606w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-10-300x194.png 300w" sizes="(max-width: 347px) 100vw, 347px" /></figure>



<p>Then, in <strong><span class="has-inline-color has-luminous-vivid-orange-color">Devices &amp; Boards</span></strong>, select the correct device : STM32F103RB</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-11.png" alt="" class="wp-image-2476" width="521" height="384" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-11.png 947w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-11-300x221.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-11-768x567.png 768w" sizes="(max-width: 521px) 100vw, 521px" /></figure>



<p>In <strong><span class="has-inline-color has-luminous-vivid-orange-color">Packs &amp; Examples</span></strong>, make sure to update the packs : </p>



<ul class="wp-block-list"><li>Keil::STM32F1xx_DFP</li><li>Keil::STM32NUCLEO_BSP</li><li>ARM::CMSIS</li><li>Keil::MDK-Middleware</li></ul>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-12.png" alt="" class="wp-image-2477" width="600" height="120" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-12.png 949w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-12-300x60.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-12-768x155.png 768w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<p>To allow communication between the Nucleo board and your PC, you need the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Driver</span></strong> Windows ST-LINK/V2 (download from here : <a href="https://bit.ly/3pSGNlM" target="_blank" rel="noreferrer noopener">https://bit.ly/3pSGNlM</a>)</p>



<p>We are going to use several menus. First of all, navigate in the menus below and understand what they are for</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="83" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-17-1024x83.png" alt="" class="wp-image-2484" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-17-1024x83.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-17-300x24.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-17-768x62.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-17.png 1228w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>Now we can create a project by clicking : Project -&gt; New µVision Project. We shall choose the correct <strong><span class="has-inline-color has-luminous-vivid-orange-color">Device</span></strong>, when prompted to (STM32F103RB)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-9.png" alt="" class="wp-image-2474" width="439" height="328" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-9.png 779w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-9-300x225.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-9-768x575.png 768w" sizes="(max-width: 439px) 100vw, 439px" /></figure>



<p>We shall also manage our <strong><span class="has-inline-color has-luminous-vivid-orange-color">run time environment</span></strong>, by selecting the following components</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-13-1024x490.png" alt="" class="wp-image-2478" width="584" height="279" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-13-1024x490.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-13-300x144.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-13-768x368.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-13.png 1224w" sizes="(max-width: 584px) 100vw, 584px" /></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">Flashing the ROM</span></strong></p>



<p>Now let&#8217;s create our program and save it into &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">Blinky.c</span></strong>&#8221; (copy the code into Keil : File -&gt; New -&gt; Blinky.c, and then copy the code) . The code is the following (we will explain it later)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-14.png" alt="" class="wp-image-2481" width="401" height="192" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-14.png 578w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-14-300x144.png 300w" sizes="(max-width: 401px) 100vw, 401px" /></figure>



<p>Going to &#8220;Manage Project Items&#8221;, we can modify the file structure as follows</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-15-1024x554.png" alt="" class="wp-image-2482" width="480" height="259" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-15-1024x554.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-15-300x162.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-15-768x416.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-15.png 1145w" sizes="(max-width: 480px) 100vw, 480px" /></figure>



<p>Now let&#8217;s plug our board (with a Mini USB Type B cable), and <strong><span class="has-inline-color has-luminous-vivid-orange-color">configure the Options</span></strong> for Target &#8220;Blinky&#8221;. The <strong><span class="has-inline-color has-luminous-vivid-orange-color">Debug</span></strong> shall be set to ST-Link Debugger</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-16.png" alt="" class="wp-image-2483" width="485" height="362" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-16.png 780w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-16-300x224.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-16-768x574.png 768w" sizes="(max-width: 485px) 100vw, 485px" /></figure>



<p>Now, let&#8217;s <strong><span class="has-inline-color has-luminous-vivid-orange-color">Flash our program into the Nucleo board</span></strong></p>



<p>This is a fundamental step as this is going to load our program into the embedded device memory <strong><span class="has-inline-color has-luminous-vivid-orange-color">ROM = Read Only Memory</span></strong>. We can see the report confirming that the Flash went ok</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-18.png" alt="" class="wp-image-2485" width="447" height="90" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-18.png 740w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-18-300x61.png 300w" sizes="(max-width: 447px) 100vw, 447px" /></figure>



<p>We can then <strong><span class="has-inline-color has-luminous-vivid-orange-color">Build our program</span></strong>, by clicking on &#8220;build&#8221;. It will be <strong><span class="has-inline-color has-luminous-vivid-orange-color">compiled into a binary code</span></strong> readable by the microprocessor of the Nucleo card</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-19.png" alt="" class="wp-image-2486" width="450" height="87" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-19.png 719w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-19-300x58.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>



<p>We can <strong><span class="has-inline-color has-luminous-vivid-orange-color">Run our program</span></strong>, by clicking on &#8220;Start/Stop debug session&#8221;. This will instantiate our variables and program steps into the <strong><span class="has-inline-color has-luminous-vivid-orange-color">RAM = Random Access Memory</span></strong></p>



<p> We get to this screen (1: Registers; 2: <strong><span class="has-inline-color has-luminous-vivid-orange-color">ARM Assembly</span></strong> code; 3: <strong><span class="has-inline-color has-luminous-vivid-orange-color">C code</span></strong>)</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="550" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-21-1024x550.png" alt="" class="wp-image-2488" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-21-1024x550.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-21-300x161.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-21-768x413.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-21.png 1330w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p> We see our <strong><span class="has-inline-color has-luminous-vivid-orange-color">LED blinking</span></strong> on our Nucleo board. During this process, we can see our General Purpose Input/Output <strong><span class="has-inline-color has-luminous-vivid-orange-color">GPIO A</span></strong> changing status as it blinks</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-22.png" alt="" class="wp-image-2489" width="295" height="288" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-22.png 505w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-22-300x292.png 300w" sizes="(max-width: 295px) 100vw, 295px" /></figure>



<p>Let&#8217;s explain briefly how the program will execute. The code, loaded into the flash memory or ROM, is interpreted by the Processor. The corresponding <strong><span class="has-inline-color has-luminous-vivid-orange-color">Variables</span></strong> will be created into the RAM.  The <strong><span class="has-inline-color has-luminous-vivid-orange-color">ALU &#8211; Arithmetic Logical Unit</span></strong> is performing the necessary calculations, and the program step by step instructions will flow into the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Stack</span></strong></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-23.png" alt="" class="wp-image-2490" width="522" height="328" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-23.png 925w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-23-300x189.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-23-768x484.png 768w" sizes="(max-width: 522px) 100vw, 522px" /></figure>



<p>The <strong><span class="has-inline-color has-luminous-vivid-orange-color">Registers</span></strong> (R1, R2&#8230;SP, LR, PC,&#8230;) are storing the necessary data and execution address</p>



<p>Here is a good <strong><span class="has-inline-color has-luminous-vivid-orange-color">tutorial</span></strong> about ARM Assembly language : <a href="https://bit.ly/33wjUgs" target="_blank" rel="noreferrer noopener">https://bit.ly/33wjUgs</a></p>



<p><strong><span class="has-inline-color has-vivid-red-color">Microcontrollers</span></strong></p>



<p>Microcontrollers are specific Processors :</p>



<ul class="wp-block-list" id="r-4604842"><li>several <strong><span class="has-inline-color has-luminous-vivid-orange-color">peripherals</span></strong> are connected to the <strong><span class="has-inline-color has-luminous-vivid-orange-color">core</span></strong> : input/output digital ports,  analogue-to-digital converters,  timers, serial ports (UART, CAN, I²C, Spi, USB…),</li><li>these Peripherals are connected to the Chip through the <strong><span class="has-inline-color has-luminous-vivid-orange-color">pins</span></strong></li></ul>



<p>Our Microcontroller controls these Peripherals, sending to them electric signals, according to the Program instructions (binary)</p>



<p>On Microcontrollers, the Peripherals are configured and controlled through <strong><span class="has-inline-color has-luminous-vivid-orange-color">Registers</span></strong> with a fixed and <strong><span class="has-inline-color has-luminous-vivid-orange-color">dedicated memory address</span></strong></p>



<p>That means that the configuration of a Peripheral is done directly <strong><span class="has-inline-color has-luminous-vivid-orange-color">into the code</span></strong>, simply by writing or reading into Registers</p>



<p>To Program the Microcontroller, it is therefore essential to read the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Reference Manual</span></strong>, as the association between the Registers and the Peripherals will be described in detail in these manuals</p>



<p>The program installed inside an embedded system, is usually called a <strong><span class="has-inline-color has-luminous-vivid-orange-color">Firmware</span></strong> (=software installed on a physical device)</p>



<p><strong><span class="has-inline-color has-vivid-red-color">Reference Manual</span></strong></p>



<p>First, here is the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Datasheet</span></strong>, which is going to help you make the link between the GPIO and the pins : <a href="https://bit.ly/3sCaYk9" target="_blank" rel="noreferrer noopener">https://bit.ly/3sCaYk9</a></p>



<figure class="wp-block-image size-full"><img decoding="async" width="412" height="538" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-74.png" alt="" class="wp-image-2609" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-74.png 412w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-74-230x300.png 230w" sizes="(max-width: 412px) 100vw, 412px" /><figcaption><a href="https://bit.ly/3sCaYk9" target="_blank" rel="noreferrer noopener">https://bit.ly/3sCaYk9</a></figcaption></figure>



<p>Then, here is the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Reference Manual</span></strong>, which is the most comprehensive document, where you will find all the necessary informations about the Registers : <a href="https://bit.ly/3eqjN8j" target="_blank" rel="noreferrer noopener">https://bit.ly/3eqjN8j</a></p>



<figure class="wp-block-image size-full"><img decoding="async" width="412" height="538" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-75.png" alt="" class="wp-image-2612" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-75.png 412w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-75-230x300.png 230w" sizes="(max-width: 412px) 100vw, 412px" /><figcaption><a href="https://bit.ly/3eqjN8j" target="_blank" rel="noreferrer noopener">https://bit.ly/3eqjN8j</a></figcaption></figure>



<p>Now, let&#8217;s look into our code. We can see that the C code deals with the <strong><span class="has-inline-color has-luminous-vivid-orange-color">GPIO A</span></strong>, which is the I/O for the LED</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-14.png" alt="" class="wp-image-2481" width="401" height="192" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-14.png 578w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-14-300x144.png 300w" sizes="(max-width: 401px) 100vw, 401px" /></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">ST-Microelectronics library</span></strong></p>



<p>First of all, we see the include &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">STM32f10x.h</span></strong>&#8220;. This file, developped by ST-MicroElectronics, is important and helpfull. Inside this file, we find :</p>



<ul class="wp-block-list"><li><strong><span class="has-inline-color has-luminous-vivid-orange-color">C structures</span></strong> defined for a quicker access to the Registers</li><li>Predefined Variables that are storing the <strong><span class="has-inline-color has-luminous-vivid-orange-color">address </span></strong>of the Peripherals</li></ul>



<p>Therefore we can write simple instructions such as GPIOA-&gt;CRL that is pointing the GPIO A to the Register CRL (L for Low, that means pins from 0 to 7)</p>



<p><strong><span class="has-inline-color has-vivid-red-color">C code explained</span></strong></p>



<ul class="wp-block-list"><li>The first instruction in the main is RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPAEN. This code activates the <strong><span class="has-inline-color has-luminous-vivid-orange-color">clock</span></strong> and <strong><span class="has-inline-color has-luminous-vivid-orange-color">timer</span></strong> on the chip (as it is not activated by default for energy savings)</li><li>Then, the two lines GPIOA-&gt;CRL are here to control the output pin n°5 of GPIO A (this is the LED of our board, as per the Reference Manual)</li><li>while(1) is a condition that is always TRUE, so this is an <strong><span class="has-inline-color has-luminous-vivid-orange-color">infinite loop</span></strong></li><li>Finally, the GPIO-&gt;ODR has a XOR that compares bit to bit 1 and 5, this turns either to 0 and 1 and make the LED blink</li></ul>



<p>With this basic example, we see that microcontrollers can be very convenient devices and turn an ECU into a computer that is going to send electric signals to the relevant peripherals</p>



<p>Let&#8217;s wrap-up some of the <strong><span class="has-inline-color has-luminous-vivid-orange-color">skills</span></strong> needed to program a microcontroller and ECU</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-2.png" alt="" class="wp-image-2458" width="430" height="283" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-2.png 752w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-2-300x198.png 300w" sizes="(max-width: 430px) 100vw, 430px" /><figcaption><a href="https://bit.ly/31IGGBr" target="_blank" rel="noreferrer noopener">https://bit.ly/31IGGBr</a></figcaption></figure>



<p>ECU and microcontrollers, together with their embedded software, are obviously very important, as they provide the computing to trigger the electrical signals from/to sensors and actuators</p>



<p>To operate together, the ECU need to be interconnected or <strong><span class="has-inline-color has-luminous-vivid-orange-color">multiplexed</span></strong> with the CAN Bus. Let&#8217;s review this now</p>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">The CAN bus</span></strong></p>



<p>A <strong><span class="has-inline-color has-luminous-vivid-orange-color">Controller Area Network</span></strong> (CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each others without a host computer</p>



<p>It is a message-based protocol, designed for <strong><span class="has-inline-color has-luminous-vivid-orange-color">multiplex</span></strong> electrical wiring.  It simplifies wiring, improves reliability, and facilitates vehicle diagnosis via the On-Board Diagnostics (<strong><span class="has-inline-color has-luminous-vivid-orange-color">OBD</span></strong>)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-37.png" alt="" class="wp-image-2517" width="367" height="179" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-37.png 502w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-37-300x146.png 300w" sizes="(max-width: 367px) 100vw, 367px" /></figure>



<p>In practice, the CAN bus is split into several networks with some specific protocols in use, according to the areas covered (powertrain, body, infotainment,&#8230;) : <strong><span class="has-inline-color has-luminous-vivid-orange-color">CAN, FlexRay, MOST</span></strong>, <strong><span class="has-inline-color has-luminous-vivid-orange-color">Ethernet</span></strong></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-62.png" alt="" class="wp-image-2561" width="462" height="228" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-62.png 981w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-62-300x149.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-62-768x380.png 768w" sizes="(max-width: 462px) 100vw, 462px" /></figure>



<p>The data is transmitted <strong><span class="has-inline-color has-luminous-vivid-orange-color">sequentially</span></strong> in a frame, but in such a way that if more than one device transmits at the same time, the highest <strong><span class="has-inline-color has-luminous-vivid-orange-color">priority device</span></strong> can continue while the others back off</p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">Frames</span></strong> are received by all devices, including by the transmitting device</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-3-1024x582.png" alt="" class="wp-image-2460" width="486" height="276" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-3-1024x582.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-3-300x170.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-3-768x436.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-3.png 1028w" sizes="(max-width: 486px) 100vw, 486px" /><figcaption> <a href="https://bit.ly/31XzGAo" target="_blank" rel="noreferrer noopener">https://bit.ly/31XzGAo</a> </figcaption></figure>



<p>The CAN bus wiring is made of two cables <strong><span class="has-inline-color has-luminous-vivid-orange-color">CAN_High</span></strong> and <strong><span class="has-inline-color has-luminous-vivid-orange-color">CAN_Low</span></strong>. The difference in tension between the two cables forwards the relevant electrical signal to the ECU</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-24.png" alt="" class="wp-image-2497" width="561" height="166" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-24.png 706w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-24-300x89.png 300w" sizes="(max-width: 561px) 100vw, 561px" /><figcaption><a href="https://bit.ly/3GNQBEC" target="_blank" rel="noreferrer noopener">https://bit.ly/3GNQBEC</a></figcaption></figure>



<p>The CAN bus frame is made of eight protocol message fields. Two of them &#8211; CAN ID and Data &#8211; are important when recording CAN bus data</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-25.png" alt="" class="wp-image-2498" width="558" height="141" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-25.png 780w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-25-300x77.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-25-768x196.png 768w" sizes="(max-width: 558px) 100vw, 558px" /><figcaption><a href="https://bit.ly/3EeylCu" target="_blank" rel="noreferrer noopener">https://bit.ly/3EeylCu</a></figcaption></figure>



<ul class="wp-block-list"><li><strong>SOF</strong>&nbsp;(Start of Frame) : marks the beginning of data and remote Frames</li><li><strong>Arbitration Field</strong>&nbsp;: includes the message ID and RTR (Remote Transmission Request) bit, which distinguishes data and remote frames</li><li><strong>Control Field</strong>&nbsp;: used to determine data size and message ID length</li><li><strong>Data Field</strong>&nbsp;: the actual data</li><li><strong>CRC&nbsp;Field</strong>&nbsp;: checksum</li><li><strong>EOF</strong>&nbsp;(End of Frame) : marks the end of data and remote frames</li></ul>



<p>Here is an example of CAN bus record : <a href="https://bit.ly/3Ecly3J" target="_blank" rel="noreferrer noopener">https://bit.ly/3Ecly3J</a></p>



<p><strong><span class="has-inline-color has-vivid-red-color">Simulation of a CAN bus</span></strong></p>



<p>We can simulate a CAN bus network on Linux (I use Kali Linux). First of all, we start-up the kernel for the CAN bus and also the virtual CAN bus, and also set-up the IP address interface</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-26.png" alt="" class="wp-image-2501" width="386" height="160" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-26.png 492w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-26-300x124.png 300w" sizes="(max-width: 386px) 100vw, 386px" /></figure>



<p>We can check that our network interface is up and running</p>



<figure class="wp-block-image size-full"><img decoding="async" width="893" height="140" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-27.png" alt="" class="wp-image-2502" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-27.png 893w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-27-300x47.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-27-768x120.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>We are now ready to send and receive CAN frames. We can simulate CAN messages using the <strong><span class="has-inline-color has-luminous-vivid-orange-color">cangen</span></strong> command on our virtual network (cangen vcan0)</p>



<p>We can see the flow of can frames when launching <strong><span class="has-inline-color has-luminous-vivid-orange-color">Wireshark</span></strong></p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-28-1024x541.png" alt="" class="wp-image-2503" width="720" height="380" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-28-1024x541.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-28-300x159.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-28-768x406.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-28.png 1345w" sizes="(max-width: 720px) 100vw, 720px" /></figure>



<p>We can also get a dump of the CAN frames by using the command <strong><span class="has-inline-color has-luminous-vivid-orange-color">candump</span></strong>, and also log it with <strong><span class="has-inline-color has-luminous-vivid-orange-color">candump -l</span></strong></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-29.png" alt="" class="wp-image-2504" width="304" height="408" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-29.png 479w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-29-223x300.png 223w" sizes="(max-width: 304px) 100vw, 304px" /></figure>



<p>The frames can be replayed using the command <strong><span class="has-inline-color has-luminous-vivid-orange-color">canplayer -I</span></strong></p>



<p>It can be especially usefull when trying to modify frames and replay a sequence into the CAN bus</p>



<p>You can use also <strong><span class="has-inline-color has-luminous-vivid-orange-color">cansniffer -c</span></strong> to check any modifications to the frame between one and another (changes will be highlighted in red)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-30.png" alt="" class="wp-image-2505" width="483" height="307" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-30.png 660w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-30-300x191.png 300w" sizes="(max-width: 483px) 100vw, 483px" /></figure>



<p>Another usefull command is <strong><span class="has-inline-color has-luminous-vivid-orange-color">cansend</span></strong>, we can send a frame from a Linux terminal and receive it in another terminal</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-31.png" alt="" class="wp-image-2506" width="414" height="132" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-31.png 622w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-31-300x95.png 300w" sizes="(max-width: 414px) 100vw, 414px" /></figure>



<p>There are other usefull commands detailed in the <strong><span class="has-inline-color has-luminous-vivid-orange-color">can-utils</span></strong> library : <a href="https://bit.ly/3EnWrLr" target="_blank" rel="noreferrer noopener">https://bit.ly/3EnWrLr</a></p>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">OBD</span></strong></p>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">On-board diagnostics (OBD)</span></strong> help provide specific data related to which system or component failed or caused a failure during run time, and greatly help perform repairs</p>



<figure class="wp-block-gallery columns-2 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img decoding="async" width="670" height="368" src="https://www.forensicxs.com/wp-content/uploads/2021/12/obdii-port.png" alt="" data-id="2509" data-link="https://www.forensicxs.com/?attachment_id=2509" class="wp-image-2509" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/obdii-port.png 670w, https://www.forensicxs.com/wp-content/uploads/2021/12/obdii-port-300x165.png 300w" sizes="(max-width: 670px) 100vw, 670px" /></figure></li><li class="blocks-gallery-item"><figure><img decoding="async" width="592" height="320" src="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-2.png" alt="" data-id="2510" data-full-url="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-2.png" data-link="https://www.forensicxs.com/?attachment_id=2510" class="wp-image-2510" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-2.png 592w, https://www.forensicxs.com/wp-content/uploads/2021/12/Capture1-2-300x162.png 300w" sizes="(max-width: 592px) 100vw, 592px" /></figure></li></ul><figcaption class="blocks-gallery-caption"><a href="https://bit.ly/3qd0JQn" target="_blank" rel="noreferrer noopener">https://bit.ly/3qd0JQn</a></figcaption></figure>



<p>There are many types and brands of diagnostic tools available on the market, either from the OEM or from third parties</p>



<p>The OBD uses an <strong><span class="has-inline-color has-luminous-vivid-orange-color">SAE</span></strong> protocol &#8211; Society of Automotive Engineers -, based upon some <strong><span class="has-inline-color has-luminous-vivid-orange-color">PID</span></strong> &#8211; Process Identifier -, each standard action used in the OBD tools corresponding to a specific PID</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="486" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-32-1024x486.png" alt="" class="wp-image-2512" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-32-1024x486.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-32-300x142.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-32-768x364.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-32.png 1210w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><a href="https://bit.ly/3p8HgB5" target="_blank" rel="noreferrer noopener">https://bit.ly/3p8HgB5</a></figcaption></figure>



<p>The PID are triggering standard CAN bus messages, and in turn, the ECU are sending back the necessary messages to the OBD tool, with a status about their respective situation. The vehicle responds to the PID query on the CAN bus with <strong><span class="has-inline-color has-luminous-vivid-orange-color">message IDs</span></strong> that depend on which module responded</p>



<figure class="wp-block-image size-full"><img decoding="async" width="957" height="431" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-33.png" alt="" class="wp-image-2513" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-33.png 957w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-33-300x135.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-33-768x346.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><a href="https://bit.ly/3p8HgB5" target="_blank" rel="noreferrer noopener">https://bit.ly/3p8HgB5</a></figcaption></figure>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">Simulation of Car Hacking</span></strong></p>



<p>I&#8217;m going to use the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Instrument Cluster Simulator (ICSim)</span></strong> : <a href="https://bit.ly/3pbbkfz" target="_blank" rel="noreferrer noopener">https://bit.ly/3pbbkfz</a></p>



<p>It was developed by Craig Smith at Open Garages. He is the author of &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">The Car Hackers</span></strong> <strong><span class="has-inline-color has-luminous-vivid-orange-color">Handbook</span></strong>&#8221; (No Starch Press) : <a href="https://bit.ly/33C5xap" target="_blank" rel="noreferrer noopener">https://bit.ly/33C5xap</a></p>



<p>First of all, we must install some dependencies, including <strong><span class="has-inline-color has-luminous-vivid-orange-color">can-utils</span></strong> if not yet installed in your Linux version, and <strong><span class="has-inline-color has-luminous-vivid-orange-color">SDL</span></strong> which is a cross-platform development library for computer graphics and audio : <a href="https://www.libsdl.org/" target="_blank" rel="noreferrer noopener">https://www.libsdl.org/</a></p>



<p>Since ISCim draws and animates a virtual dashboard, this is required</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-36.png" alt="" class="wp-image-2516" width="537" height="80" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-36.png 686w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-36-300x45.png 300w" sizes="(max-width: 537px) 100vw, 537px" /></figure>



<p>Then, we clone the <strong><span class="has-inline-color has-luminous-vivid-orange-color">github</span></strong> repository of ICSim</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-34.png" alt="" class="wp-image-2514" width="507" height="126" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-34.png 644w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-34-300x75.png 300w" sizes="(max-width: 507px) 100vw, 507px" /></figure>



<p>Here are the files available in the <strong><span class="has-inline-color has-luminous-vivid-orange-color">ICSim</span></strong> repository</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-35.png" alt="" class="wp-image-2515" width="499" height="222" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-35.png 648w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-35-300x133.png 300w" sizes="(max-width: 499px) 100vw, 499px" /></figure>



<p>We notice that the executable icsim is &#8220;missing&#8221;. We easily fix this with the &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">make</span></strong>&#8221; command</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-38.png" alt="" class="wp-image-2520" width="548" height="314" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-38.png 721w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-38-300x172.png 300w" sizes="(max-width: 548px) 100vw, 548px" /></figure>



<p>Let&#8217;s start the simulator on our <strong><span class="has-inline-color has-luminous-vivid-orange-color">virtual CAN</span></strong> network</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-40.png" alt="" class="wp-image-2522" width="417" height="249" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-40.png 699w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-40-300x179.png 300w" sizes="(max-width: 417px) 100vw, 417px" /></figure>



<p>We also launch the <strong><span class="has-inline-color has-luminous-vivid-orange-color">control panel</span></strong></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-41.png" alt="" class="wp-image-2524" width="375" height="357" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-41.png 626w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-41-300x286.png 300w" sizes="(max-width: 375px) 100vw, 375px" /></figure>



<p>If you don&#8217;t have an XBOX controller, it is possible to apply the controls with the keyboard. All buttons are functional and we can see the vehicle reaction simulated (<strong><span class="has-inline-color has-luminous-vivid-orange-color">acceleration, turns, door lock</span></strong>)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-42.png" alt="" class="wp-image-2525" width="428" height="179" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-42.png 678w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-42-300x126.png 300w" sizes="(max-width: 428px) 100vw, 428px" /><figcaption><a href="https://bit.ly/3p82wHm" target="_blank" rel="noreferrer noopener">https://bit.ly/3p82wHm</a></figcaption></figure>



<p>For example, here is the sim at 70 mph and all doors unlocked</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-43.png" alt="" class="wp-image-2528" width="290" height="210" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-43.png 413w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-43-300x217.png 300w" sizes="(max-width: 290px) 100vw, 290px" /></figure>



<p>We can launch <strong><span class="has-inline-color has-luminous-vivid-orange-color">cansniffer</span></strong> : cansniffer -c vcan0</p>



<p>We see a very fast flow of data in the CAN bus</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-44.png" alt="" class="wp-image-2530" width="456" height="465" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-44.png 634w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-44-294x300.png 294w" sizes="(max-width: 456px) 100vw, 456px" /></figure>



<p>Now we can play with the key strokes and try to identify patterns in the bus data corresponding to our key strokes. It is not easy. So, I used a handy tool called <strong><span class="has-inline-color has-luminous-vivid-orange-color">Kayak</span></strong> : <a href="https://bit.ly/3yST8KQ" target="_blank" rel="noreferrer noopener">https://bit.ly/3yST8KQ</a></p>



<p>We must first install <strong><span class="has-inline-color has-luminous-vivid-orange-color">socketcand</span></strong> : <a href="https://bit.ly/3yQsnH2" target="_blank" rel="noreferrer noopener">https://bit.ly/3yQsnH2</a>, which is a <strong><span class="has-inline-color has-luminous-vivid-orange-color">daemon</span></strong> that provides access to CAN interfaces on a machine via a network interface. The communication protocol uses a TCP/IP connection and a specific protocol to transfer CAN frames and control commands</p>



<p>For this installation, I found out that a file is missing in the repository : <strong><span class="has-inline-color has-luminous-vivid-orange-color">config.h.in</span></strong></p>



<p>You can take it from here : <a href="https://bit.ly/3JgiMOo" target="_blank" rel="noreferrer noopener">https://bit.ly/3JgiMOo</a></p>



<p>Then proceed with the installation of socketcand : <a href="https://bit.ly/3JdszES" target="_blank" rel="noreferrer noopener">https://bit.ly/3JdszES</a></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-49.png" alt="" class="wp-image-2535" width="184" height="90" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-49.png 304w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-49-300x146.png 300w" sizes="(max-width: 184px) 100vw, 184px" /></figure>



<p>Kayak being based upon Java, it needs the <strong><span class="has-inline-color has-luminous-vivid-orange-color">OpenJDK</span></strong> to run (Java Standard Edition which is Open Source). To check if Java SE is installed on your Linux, type java -version</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-45.png" alt="" class="wp-image-2531" width="572" height="82" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-45.png 741w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-45-300x43.png 300w" sizes="(max-width: 572px) 100vw, 572px" /></figure>



<p>If Java is not installed, it will take you several steps : <a href="https://bit.ly/3qjci8L" target="_blank" rel="noreferrer noopener">https://bit.ly/3qjci8L</a></p>



<p>Then, we install <strong><span class="has-inline-color has-luminous-vivid-orange-color">Maven</span></strong> (it&#8217;s a software comparable to the Make command of Linux, it allows to build a Java software from its sources)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-46.png" alt="" class="wp-image-2532" width="429" height="105" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-46.png 923w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-46-300x74.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-46-768x190.png 768w" sizes="(max-width: 429px) 100vw, 429px" /></figure>



<p>With Maven installed, we can <strong><span class="has-inline-color has-luminous-vivid-orange-color">build</span> <span class="has-inline-color has-luminous-vivid-orange-color">Kayak</span></strong> (inside the Kayak source folder). All dependencies are downloaded during the build process (it takes quite a while)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-47.png" alt="" class="wp-image-2533" width="516" height="213" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-47.png 806w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-47-300x124.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-47-768x318.png 768w" sizes="(max-width: 516px) 100vw, 516px" /></figure>



<p>Before launching Kayak, we must <span class="has-inline-color has-luminous-vivid-orange-color"><strong>start socketcand</strong></span></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-50.png" alt="" class="wp-image-2537" width="315" height="30" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-50.png 423w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-50-300x28.png 300w" sizes="(max-width: 315px) 100vw, 315px" /></figure>



<p>Now we can <strong><span class="has-inline-color has-luminous-vivid-orange-color">start Kayak</span></strong></p>



<figure class="wp-block-image size-full"><img decoding="async" width="966" height="157" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-48.png" alt="" class="wp-image-2534" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-48.png 966w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-48-300x49.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-48-768x125.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>We just need to follow the start screen instructions and we are done</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="409" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-52-1024x409.png" alt="" class="wp-image-2540" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-52-1024x409.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-52-300x120.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-52-768x307.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-52.png 1174w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>Then, start the live stream (grey arrow). We see data coming into Kayak</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-53.png" alt="" class="wp-image-2541" width="455" height="88" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-53.png 699w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-53-300x58.png 300w" sizes="(max-width: 455px) 100vw, 455px" /></figure>



<p>From now on, we can check various interactions with the control panel of ICSim and &#8220;<strong><span class="has-inline-color has-luminous-vivid-orange-color">sniff</span></strong>&#8221; the data flow in Kayak. It is much more convenient than checking the flow of data directly into the CAN interface</p>



<p>After some time playing around, we can derive the <strong><span class="has-inline-color has-luminous-vivid-orange-color">ID</span></strong>s associated to each device, in particular the 5 bytes of data from the tachymeter</p>



<p>Here is a summary table of our observations</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-54.png" alt="" class="wp-image-2542" width="332" height="77" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-54.png 666w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-54-300x70.png 300w" sizes="(max-width: 332px) 100vw, 332px" /></figure>



<p>The data highlighted in red, are the hexadecimal numbers that are seen changing for each device ID</p>



<p>For example, the <strong><span class="has-inline-color has-luminous-vivid-orange-color">tachymeter</span></strong> ID244 changes the last two bytes during a driver input on the accelerator. The allowed speed range of 0-100 mph is triggered by hexadecimal data values ranging from 00 00 to 01 5D </p>



<p>It can also be seen that there are four possible values transmitted to operate the <strong><span class="has-inline-color has-luminous-vivid-orange-color">doors</span></strong> ID19b (one per door) and two for the <strong><span class="has-inline-color has-luminous-vivid-orange-color">blinkers</span></strong> ID188</p>



<p>For example, we can <strong><span class="has-inline-color has-luminous-vivid-orange-color">fuzz</span></strong> the tachymeter at a high speed of 240 mph with this simple script</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-55.png" alt="" class="wp-image-2546" width="465" height="256" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-55.png 694w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-55-300x166.png 300w" sizes="(max-width: 465px) 100vw, 465px" /></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">Metasploit</span></strong></p>



<p>Here the Metasploit installation instructions : <a href="https://bit.ly/3JgC1ri" target="_blank" rel="noreferrer noopener">https://bit.ly/3JgC1ri</a>. After installation, we launch it using the <strong><span class="has-inline-color has-luminous-vivid-orange-color">msfconsole</span></strong> command. Then we can look for the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Automotive modules</span></strong></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="213" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-57-1024x213.png" alt="" class="wp-image-2550" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-57-1024x213.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-57-300x62.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-57-768x160.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-57.png 1383w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>There is a good article that shows you how to use these modules : <a href="https://bit.ly/3FBm8Ju" target="_blank" rel="noreferrer noopener">https://bit.ly/3FBm8Ju</a>. First of all, you need to set-up the <strong><span class="has-inline-color has-luminous-vivid-orange-color">hardware connection</span></strong>, then you can use one of the <strong><span class="has-inline-color has-luminous-vivid-orange-color">attack</span></strong> modules</p>



<p>If you want to learn more about these modules, you can look into them. They are written in <strong><span class="has-inline-color has-luminous-vivid-orange-color">Ruby</span></strong>. You can find them in the GitHub repository : <a href="https://bit.ly/33YoVil" target="_blank" rel="noreferrer noopener">https://bit.ly/33YoVil</a></p>



<p>For example, here is what is under the hood for the module <strong><span class="has-inline-color has-luminous-vivid-orange-color">canprobe.rb</span></strong>. It is apparently a simple <strong><span class="has-inline-color has-luminous-vivid-orange-color">blind fuzzer</span></strong></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="119" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-58-1024x119.png" alt="" class="wp-image-2551" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-58-1024x119.png 1024w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-58-300x35.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-58-768x89.png 768w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-58.png 1179w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></figure>



<p>These modules are currently very limited in scope, but any talented hacker could craft attack modules as per the need</p>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">Real world Car Hacking</span></strong></p>



<p>We have seen in this simulator that we can correlate actions from the driver (ex: acceleration), with the bus frame ID number, and the frame data. We could therefore craft specific commands and <strong><span class="has-inline-color has-luminous-vivid-orange-color">&#8220;hack&#8221;</span></strong> the car</p>



<p>In real life, it will be much more difficult. There are several key issues : </p>



<ul class="wp-block-list"><li>OBD ports may not give you a direct access to the CAN bus you are looking for</li><li>The CAN bus quantity of data is <strong><span class="has-inline-color has-luminous-vivid-orange-color">huge</span></strong> and the data are sent very <strong><span class="has-inline-color has-luminous-vivid-orange-color">fast</span></strong></li><li>The bus data may be <strong><span class="has-inline-color has-luminous-vivid-orange-color">obfuscated</span></strong> as arbitration identifiers are often used</li></ul>



<p>Let&#8217;s explore some topics that are relevant for real world car hacking and security, on which researchers and industry practicioners are currently focusing</p>



<p><strong><span class="has-inline-color has-vivid-red-color">Car tuning</span></strong></p>



<p>It is important to know that Flashing off Engine ECU and related stuff is a very well known practice, especially in the USA where there is a high demand for super duty cars/trucks (such as the Ford F550)</p>



<p>The truck community is quite often tuning trucks, for increased engine power and so on. There are software and hardware vendors specialized in this <strong><span class="has-inline-color has-luminous-vivid-orange-color">tuning industry</span></strong>. They rely on security keys <strong><span class="has-inline-color has-luminous-vivid-orange-color">licenced by the OEMs</span></strong></p>



<p>Here is an example in this video, with the hardware/software package from <strong><span class="has-inline-color has-luminous-vivid-orange-color">EFI Live</span></strong>, applied on a Chevrolet Silverado</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="BEST Performance Truck Mod!! How to Tune Truck with EFI Live - Tunes by Black Bear Performance!!" width="525" height="295" src="https://www.youtube.com/embed/Cv3Ki881DEw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>There is going to be a future obvious <strong><span class="has-inline-color has-luminous-vivid-orange-color">contradiction</span></strong> between the need for secure cars and enthusiastic car modding</p>



<p>On one side, we want to secure all this, but we also need to make good tools available to legitimate repairers. But anybody can be a legitimate repairer including malicious people</p>



<p>Here is a good article covering this : <a href="https://bit.ly/3qoqc9V" target="_blank" rel="noreferrer noopener">https://bit.ly/3qoqc9V</a></p>



<p><strong><span class="has-inline-color has-vivid-red-color">Seed to key algorithm</span></strong></p>



<p>These algorithms are in use on cars, to make sure that any diagnostic tool trying the connect to an ECU, is allowed to do it &#8220;by design&#8221;. The protection mechanism is the following :</p>



<ul class="wp-block-list"><li>the diagnostic tool sends a security access request</li><li>the ECU responds with an ID and a <strong><span class="has-inline-color has-luminous-vivid-orange-color">pseudo-random challenge</span></strong></li><li>the diagnostic tool references the ID against a database of ECUs and their security keys</li><li>the diagnostic tool calculates and sends a response back to the ECU (key challenge)</li><li>the ECU compares this to its own <strong><span class="has-inline-color has-luminous-vivid-orange-color">key challenge</span></strong> calculation and enters into the desired run mode if there is a <strong><span class="has-inline-color has-luminous-vivid-orange-color">match</span></strong></li></ul>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-59.png" alt="" class="wp-image-2554" width="436" height="268" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-59.png 549w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-59-300x185.png 300w" sizes="(max-width: 436px) 100vw, 436px" /></figure>



<p>Here is more information about the mechanism : <a href="https://bit.ly/3Je3Dx0" target="_blank" rel="noreferrer noopener">https://bit.ly/3Je3Dx0</a>. An example of a seed algorithm is given here below (based upon some <strong><span class="has-inline-color has-luminous-vivid-orange-color">XOR</span></strong> and bit <strong><span class="has-inline-color has-luminous-vivid-orange-color">offset</span></strong>)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-60.png" alt="" class="wp-image-2555" width="564" height="278" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-60.png 896w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-60-300x148.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-60-768x380.png 768w" sizes="(max-width: 564px) 100vw, 564px" /><figcaption><a href="https://bit.ly/3FFbJgh" target="_blank" rel="noreferrer noopener">https://bit.ly/3FFbJgh</a></figcaption></figure>



<p>In fact, by intensive semi-automatic trials, it could be possible to <strong><span class="has-inline-color has-luminous-vivid-orange-color">retrieve the seed-key</span></strong> algorithm, as is documented in this research study : <a href="https://bit.ly/3HjVlSJ" target="_blank" rel="noreferrer noopener">https://bit.ly/3HjVlSJ</a>. The hashing functions being used are <strong><span class="has-inline-color has-luminous-vivid-orange-color">not cryptographically secure</span></strong></p>



<figure class="wp-block-image size-full"><img decoding="async" width="406" height="584" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-82.png" alt="" class="wp-image-2628" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-82.png 406w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-82-209x300.png 209w" sizes="(max-width: 406px) 100vw, 406px" /><figcaption><a href="https://bit.ly/3HjVlSJ" target="_blank" rel="noreferrer noopener">https://bit.ly/3HjVlSJ</a></figcaption></figure>



<p>Here is further reading on <strong><span class="has-inline-color has-luminous-vivid-orange-color">reversing</span></strong> a seed-key algorithm : <a href="https://bit.ly/3yVJHKF" target="_blank" rel="noreferrer noopener">https://bit.ly/3yVJHKF</a></p>



<p>The <strong><span class="has-inline-color has-luminous-vivid-orange-color">Flashing</span></strong> of the ECUs is also protected with the seed-key algorithm, so potentially lacks security</p>



<p><strong><span class="has-inline-color has-vivid-red-color">Attacks on the CAN bus</span></strong></p>



<p>This report is really comprehensive and provides an in-depth review of CAN protocols applied in many OEM brands : <a href="https://bit.ly/3z5UbYa" target="_blank" rel="noreferrer noopener">https://bit.ly/3z5UbYa</a></p>



<p>First of all, the report explains how to craft <strong><span class="has-inline-color has-luminous-vivid-orange-color">CAN frames</span></strong> for :</p>



<ul class="wp-block-list"><li>diagnostic session control</li><li>security access</li><li>request download and upload</li></ul>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-69.png" alt="" class="wp-image-2587" width="527" height="124" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-69.png 774w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-69-300x71.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-69-768x182.png 768w" sizes="(max-width: 527px) 100vw, 527px" /><figcaption>Example : Security Access</figcaption></figure>



<p>Second, it shows the <strong><span class="has-inline-color has-luminous-vivid-orange-color">complexity</span></strong> to craft fake frames to the CAN bus :</p>



<ul class="wp-block-list"><li>most ECU include protections and are not going to accept values beyond some security limits</li><li>frames that actually control some functions of the vehicle, are quite hard to identify as related to the exchange of data between some specific ECUs, or sent through another CAN bus</li><li>the car is still sending legit frames while you try to send faked frames, and the ECU may not be able to follow your frames for priority reasons</li><li>the security seed will change after a limited number of invalid challenge responses, so brute forcing in real-time is extremely impractical</li></ul>



<figure class="wp-block-image size-full"><img decoding="async" width="420" height="582" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-77.png" alt="" class="wp-image-2618" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-77.png 420w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-77-216x300.png 216w" sizes="(max-width: 420px) 100vw, 420px" /><figcaption><a href="https://bit.ly/3z5UbYa" target="_blank" rel="noreferrer noopener">https://bit.ly/3z5UbYa</a></figcaption></figure>



<p>Nevertheless, the report provides, for some specific vehicles, <strong><span class="has-inline-color has-luminous-vivid-orange-color">examples of</span></strong> <strong><span class="has-inline-color has-luminous-vivid-orange-color">faked messages</span></strong> and the reaction onto the car. The technical aspects are quite advanced :</p>



<ul class="wp-block-list"><li>finding a way to download instructions on the ECU</li><li>writing code, translating it into machine code for execution on the CAN</li><li>reprogramming the ECU in some way through calibration update</li></ul>



<p>It also proposes a process for <strong><span class="has-inline-color has-luminous-vivid-orange-color">detecting attacks</span></strong> based on <strong><span class="has-inline-color has-luminous-vivid-orange-color">frequency</span></strong> :</p>



<ul class="wp-block-list"><li>unusual CAN frames are going to be exceptional or flooding the CAN bus, contrary to common packets which tend to reproduce at a regular and predictable frequency</li><li>attacks stand out greatly from normal CAN traffic and could easily be detected</li><li>a system can detect CAN anomalies based on the known frequency of certain traffic and can alert a system or user if frequency levels vary drastically from what is well known</li></ul>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-70.png" alt="" class="wp-image-2588" width="261" height="161" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-70.png 486w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-70-300x185.png 300w" sizes="(max-width: 261px) 100vw, 261px" /></figure>



<p>Here is an <strong><span class="has-inline-color has-luminous-vivid-orange-color">Intrusion Detection System (IDS)</span></strong> proposed as a commercial solution, helping to protect the CAN network from potential intrusions, and avoid faked messages to be spread over the CAN network</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-68.png" alt="" class="wp-image-2582" width="559" height="181" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-68.png 912w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-68-300x97.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-68-768x248.png 768w" sizes="(max-width: 559px) 100vw, 559px" /><figcaption><a href="https://bit.ly/3FnoM5H" target="_blank" rel="noreferrer noopener">https://bit.ly/3FnoM5H</a></figcaption></figure>



<p>The IDS enables to define factory settings for each microcontroller, and create a <strong><span class="has-inline-color has-luminous-vivid-orange-color">whitelist</span></strong> of permitted binaries, processes, scripts and network behavior</p>



<p>The IDS would <strong><span class="has-inline-color has-luminous-vivid-orange-color">detect and block</span></strong> attempts to download and run unauthorized code on the ECU, allowing the execution of only specified code and applications</p>



<p>Finally, the IDS can be <strong><span class="has-inline-color has-luminous-vivid-orange-color">embedded</span></strong> into controllers during the development process, and it can also be installed on existing vehicles during regular maintenance</p>



<p><strong><span class="has-inline-color has-vivid-red-color">CAN Security Authentication</span></strong></p>



<p>Further security measures are expected in CAN, but they shall meet the requirements of real time and cost constraint for in-vehicle control network</p>



<p>Also, the CAN has a <strong><span class="has-inline-color has-luminous-vivid-orange-color">small frame payload size</span></strong>, and this is a natural limit for strong cryptography</p>



<p>But, we definitely want to avoid the situation where a <strong><span class="has-inline-color has-luminous-vivid-orange-color">malicious program</span></strong> is injected into an ECU and this ECU could operate undetected</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-64.png" alt="" class="wp-image-2574" width="338" height="154" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-64.png 397w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-64-300x136.png 300w" sizes="(max-width: 338px) 100vw, 338px" /></figure>



<p>As a potential solution, in the paper below, is proposed a centralized authentication system in CAN, based upon a <strong><span class="has-inline-color has-luminous-vivid-orange-color">HMAC</span></strong> cryptographic protocol : <a href="https://bit.ly/3qzEULo" target="_blank" rel="noreferrer noopener">https://bit.ly/3qzEULo</a></p>



<figure class="wp-block-image size-full"><img decoding="async" width="420" height="582" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-78.png" alt="" class="wp-image-2620" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-78.png 420w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-78-216x300.png 216w" sizes="(max-width: 420px) 100vw, 420px" /><figcaption><a href="https://bit.ly/3qzEULo" target="_blank" rel="noreferrer noopener">https://bit.ly/3qzEULo</a></figcaption></figure>



<p>In the event that an ECU has been corrupted, the encryption system shall block the exchange of CAN messages with this ECU</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-65.png" alt="" class="wp-image-2575" width="522" height="224" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-65.png 814w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-65-300x129.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-65-768x330.png 768w" sizes="(max-width: 522px) 100vw, 522px" /></figure>



<p>The use of this algorithm provides a significant improvement, but we are still far away from a very strong encryption, as this would be very <strong><span class="has-inline-color has-luminous-vivid-orange-color">costly in terms of speed</span></strong> of the network, and impact the &#8220;real time&#8221; performance of the CAN bus</p>



<p>A further step could be to use a <strong><span class="has-inline-color has-luminous-vivid-orange-color">Certificate Authority</span></strong>, combined with an Access Control List (<strong><span class="has-inline-color has-luminous-vivid-orange-color">ACL</span></strong>), and a secured connection to the OBD</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-66.png" alt="" class="wp-image-2577" width="533" height="219" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-66.png 1004w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-66-300x124.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-66-768x317.png 768w" sizes="(max-width: 533px) 100vw, 533px" /><figcaption><a href="https://bit.ly/3Fv12fQ" target="_blank" rel="noreferrer noopener">https://bit.ly/3Fv12fQ</a></figcaption></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">Remote firmware updates</span></strong></p>



<p>It is quite obvious that a compromised ECUs can have a severe impact on vehicle operational safety. Therefore, the way that firmware updates are distributed shall be secured</p>



<p>Especially, Over-The-Air (<strong><span class="has-inline-color has-luminous-vivid-orange-color">OTA</span></strong>) updates are the most prone to cyberattacks</p>



<p>The paper below explores the general concepts behind safe remote firmware updates : <a href="https://bit.ly/3Fzim3o" target="_blank" rel="noreferrer noopener">https://bit.ly/3Fzim3o</a></p>



<figure class="wp-block-image size-full"><img decoding="async" width="420" height="522" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-81.png" alt="" class="wp-image-2626" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-81.png 420w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-81-241x300.png 241w" sizes="(max-width: 420px) 100vw, 420px" /><figcaption><a href="https://bit.ly/3Fzim3o" target="_blank" rel="noreferrer noopener">https://bit.ly/3Fzim3o</a></figcaption></figure>



<p>Here are in summary, the recommendations from this report :</p>



<p><strong><span class="has-inline-color has-luminous-vivid-amber-color">SoC architecture</span></strong></p>



<ul class="wp-block-list"><li>the ECU embedding a SoC &#8211; system on chip-, shall <strong><span class="has-inline-color has-luminous-vivid-orange-color">partition</span></strong> the bootloader from the firmware OS and the application data</li><li>the hardware should include a physical security module or <strong><span class="has-inline-color has-luminous-vivid-orange-color">HSM</span></strong> &#8211; Hardware Security Module -, for secure <strong><span class="has-inline-color has-luminous-vivid-orange-color">private key</span></strong> storage and accelerated cryptographic operations</li><li>the bootloader should be using the more secured <strong><span class="has-inline-color has-luminous-vivid-orange-color">UEFI</span></strong> mode &#8211; Unified Extensible Firmware Interface &#8211; instead of BIOS</li><li>the OS should include a secure boot mechanism</li></ul>



<p><strong><span class="has-inline-color has-luminous-vivid-amber-color">Secure boot</span></strong></p>



<ul class="wp-block-list"><li>enables a <strong><span class="has-inline-color has-luminous-vivid-orange-color">chain of trust</span></strong> to dispatch the update</li><li>safeguards the boot chain, ensuring that only original firmware is loaded</li><li>based upon a secure channel relying upon <strong><span class="has-inline-color has-luminous-vivid-orange-color">authentication</span></strong> and <strong><span class="has-inline-color has-luminous-vivid-orange-color">encryption</span></strong></li></ul>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-72.png" alt="" class="wp-image-2593" width="368" height="207" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-72.png 809w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-72-300x169.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-72-768x434.png 768w" sizes="(max-width: 368px) 100vw, 368px" /><figcaption>Secure boot</figcaption></figure>



<p>Here is an example of a commercial solution</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-67.png" alt="" class="wp-image-2578" width="573" height="342" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-67.png 907w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-67-300x179.png 300w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-67-768x459.png 768w" sizes="(max-width: 573px) 100vw, 573px" /><figcaption><a href="https://bit.ly/3enRS97" target="_blank" rel="noreferrer noopener">https://bit.ly/3enRS97</a></figcaption></figure>



<p><strong><span class="has-inline-color has-vivid-red-color">Remote car hacking</span></strong></p>



<p>There was a comprehensive research study in 2015, looking into the systems of the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Jeep Cherokee</span></strong> : <a href="https://bit.ly/3zfRtiV" target="_blank" rel="noreferrer noopener">https://bit.ly/3zfRtiV</a></p>



<p>The researchers made a detailed reversing of the <strong><span class="has-inline-color has-luminous-vivid-orange-color">Uconnect</span></strong> infotainment system from Harman (Samsung). This system is embedded in many modern cars</p>



<figure class="wp-block-image size-full"><img decoding="async" width="406" height="496" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-83.png" alt="" class="wp-image-2632" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-83.png 406w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-83-246x300.png 246w" sizes="(max-width: 406px) 100vw, 406px" /><figcaption><a href="http://bit.ly/3zfRtiV" target="_blank" rel="noreferrer noopener">http://bit.ly/3zfRtiV</a></figcaption></figure>



<p>Uconnect is based on the UNIX like <strong><span class="has-inline-color has-luminous-vivid-orange-color">QNX</span></strong> OS from Blackberry. The Cherokee also has a cellular connection from Sierra Wireless 3G through the Sprint network. The researchers performed a set of complex actions, to take control of the vehicle (to some extent) :</p>



<p> <strong><span class="has-inline-color has-luminous-vivid-amber-color">Access over the cellular network</span></strong></p>



<ul class="wp-block-list"><li>implementation of a femtocell</li><li> scanning port and IP range for vulnerable vehicle</li><li>discovery of network settings and open ports</li><li>discovery of vulnerable D-bus services (<a href="https://bit.ly/3sMEB2z)" target="_blank" rel="noreferrer noopener">https://bit.ly/3sMEB2z)</a></li><li>connection through SSH</li></ul>



<p><strong><span class="has-inline-color has-luminous-vivid-amber-color">Jailbreak of Uconnect</span></strong><span class="has-inline-color has-vivid-cyan-blue-color"> </span></p>



<ul class="wp-block-list"><li>reverse engineering of the firmware and CAN functions (this usually implies bypassing an anti debugging safety)</li><li>identification of vulnerabilities (memory corruption, stack overflow)</li><li>hand editing the ISO file in a HEX editor</li><li>altered integrity check byte</li><li>putting the ISO on a USB stick and flashing the modified software</li><li>bypassing the validation checks</li><li>gaining code execution</li></ul>



<p><span class="has-inline-color has-luminous-vivid-amber-color"><strong>Shell commands</strong> <strong>into D-bus</strong></span></p>



<ul class="wp-block-list"><li> crafting attack scripts </li><li>input of arbitrary commands in the inter-process services</li><li>exploitation of the D-bus</li><li>dispatch of arbitrary CAN data</li><li>taking control of ECUs</li></ul>



<p>The researchers disclosed the vulnerabilities to Chrysler. The car manufacturer decided to <strong><span class="has-inline-color has-luminous-vivid-orange-color">recall</span> <span class="has-inline-color has-luminous-vivid-orange-color">1.4 million vehicles</span></strong> for safety reasons, although the risk to reproduce such attacks were minimal</p>



<p>Among the countermeasures, some ports were blocked and modifications on the Sprint network were made, to deter potential attacks</p>



<p>There is a good report exploring similar topics, but on a <strong><span class="has-inline-color has-luminous-vivid-orange-color">Mercedes</span></strong> : <a href="https://bit.ly/30YZwnt" target="_blank" rel="noreferrer noopener">https://bit.ly/30YZwnt</a></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-73.png" alt="" class="wp-image-2595" width="260" height="368" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-73.png 537w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-73-212x300.png 212w" sizes="(max-width: 260px) 100vw, 260px" /></figure>



<hr class="wp-block-separator"/>



<p><strong><span class="has-inline-color has-vivid-cyan-blue-color">Conclusion</span></strong></p>



<p>We started this article by covering the basics of cars <strong><span class="has-inline-color has-luminous-vivid-orange-color">embedded softwares</span></strong> and networking through the <strong><span class="has-inline-color has-luminous-vivid-orange-color">CAN</span></strong>. For a better understanting, we have played with some tools :</p>



<ul class="wp-block-list"><li>an ARM Nucleo board on which we flashed a first program</li><li>the CAN-utils library and the ICSim simulator</li></ul>



<p>Therefore we could gain a deeper <strong><span class="has-inline-color has-luminous-vivid-orange-color">knowledge</span></strong> about microcontrollers, ECU, CAN bus, OBD plug and more</p>



<p>We then covered some key <strong><span class="has-inline-color has-luminous-vivid-orange-color">security topics</span></strong> in the real car market :</p>



<ul class="wp-block-list"><li>seed to key algorithm</li><li>attacks on the CAN bus</li><li>CAN security authentication</li><li>remote firmware updates</li><li>remote car hacking</li></ul>



<p>Due to the continuous growth of telematics and infotainment on-board our cars, the safety countermeasures will be even more necessary. The OEMS are putting a <strong><span class="has-inline-color has-luminous-vivid-orange-color">priority</span></strong> on this, as more stringent cybersecurity norms, the risk of costly recall campaigns and potential accidents, are putting pressure on them</p>



<p>The <strong><span class="has-inline-color has-luminous-vivid-orange-color">contradiction</span></strong> between the need for protection, but at the same time allowing car maintenance and troubleshooting with tools available to the population, will be a hot topic</p>



<p>Last but not least, we will see the emergence of <strong><span class="has-inline-color has-luminous-vivid-orange-color">Ethernet</span></strong> based networks on-board our cars</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.forensicxs.com/wp-content/uploads/2021/12/image-71.png" alt="" class="wp-image-2591" width="384" height="468" srcset="https://www.forensicxs.com/wp-content/uploads/2021/12/image-71.png 551w, https://www.forensicxs.com/wp-content/uploads/2021/12/image-71-246x300.png 246w" sizes="(max-width: 384px) 100vw, 384px" /><figcaption><a href="https://bit.ly/3yZDuO3" target="_blank" rel="noreferrer noopener">https://bit.ly/3yZDuO3</a></figcaption></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.forensicxs.com/car-hacking/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Database Caching 10/50 queries in 0.043 seconds using Disk

Served from: www.forensicxs.com @ 2026-01-03 20:27:27 by W3 Total Cache
-->