CANalyse 2.0: A Vehicle Network Analysis and Attack Tool

Kartheek Lade (IoT Security Researcher), Rahul J (Digital Specialist Engineer · Infosys)

Car Hacking Village @ DEF CON 30 · Day 1 · Car Hacking Village

Overview

The "CANalyse 2.0" presentation at DEF CON 30's Car Hacking Village introduced an open-source tool designed to streamline and automate the process of analyzing and interacting with Controller Area Network (CAN) bus traffic in vehicles. Developed by Kartheek Lade and Rahul J, CANalyse addresses the significant challenges faced by researchers and security professionals in manually dissecting the vast amounts of data flowing across modern automotive networks. The tool aims to simplify the identification of specific CAN packets responsible for controlling vehicle functions, moving beyond tedious manual analysis to an automated, session-based approach.

Watch on YouTube

Visual summary for CANalyse 2.0: A Vehicle Network Analysis and Attack Tool by Kartheek Lade, Rahul J
Visual summary for CANalyse 2.0: A Vehicle Network Analysis and Attack Tool by Kartheek Lade, Rahul J

Key moments

  1. 0:00 Introduction and project overview
  2. 2:20 CAN bus: Its purpose and inherent flaws
  3. 5:00 Motivation: Automating CAN analysis, remote access, session logging
  4. 10:30 CANalyse's core filtering logic: Noise vs. Action files
  5. 18:00 Smart Scan Demo: Automated turn signal packet filtering
  6. 21:00 IDE Demo: Advanced packet filtering using SQL queries
  7. 38:30 Telegram Bot Integration: Remote vehicle network control demo
  8. 44:00 Future plans, Scapy integration, and community contributions

CANalyse 2.0: A Vehicle Network Analysis and Attack Tool

Speakers: Kartheek Lade (IoT Security Researcher); Rahul J (Digital Specialist Engineer, Infosys)

Conference: Car Hacking Village @ DEF CON 30

YouTube: https://www.youtube.com/watch?v=Py_1I-GtUxw

Overview

The "CANalyse 2.0" presentation at DEF CON 30's Car Hacking Village introduced an open-source tool designed to streamline and automate the process of analyzing and interacting with Controller Area Network (CAN) bus traffic in vehicles. Developed by Kartheek Lade and Rahul J, CANalyse addresses the significant challenges faced by researchers and security professionals in manually dissecting the vast amounts of data flowing across modern automotive networks. The tool aims to simplify the identification of specific CAN packets responsible for controlling vehicle functions, moving beyond tedious manual analysis to an automated, session-based approach.

This talk highlighted the inherent security vulnerabilities of the CAN bus, primarily its lack of native encryption and authentication, which makes it susceptible to various frame and protocol-level attacks. CANalyse 2.0 offers a practical solution by enabling rapid filtering of relevant packets from general network noise, facilitating the creation of targeted attack payloads, and even supporting remote interaction with vehicle systems via Telegram bots. The speakers emphasized that while the tool can be used for offensive purposes, its core design also empowers defenders to better understand and secure vehicle communication by identifying anomalous or malicious traffic patterns.

The significance of CANalyse 2.0 lies in its ability to democratize car hacking research by providing an intuitive yet powerful platform for exploring vehicle networks. By integrating features such as automated packet comparison using hash maps, SQL-powered data filtering on pandas dataframes, and seamless project management, the tool significantly lowers the barrier to entry for analyzing complex CAN communications. This not only aids in discovering new vulnerabilities but also helps in developing more robust defensive strategies against potential automotive cyber threats, making it a valuable addition to the car hacking community's toolkit.

Background

▶ Watch: Introduction and project overview (0:00)

The evolution of automotive technology has led to an exponential increase in the number of electronic components, sensors, and actuators within modern vehicles. Early designs, which relied on point-to-point wiring for each component, quickly became unwieldy, leading to excessive wiring, increased weight (drag), and reduced fuel efficiency. To overcome these limitations, engineers at Bosch developed the Controller Area Network (CAN) bus protocol in the 1980s. The CAN bus provides a centralized, feedback-based network where all Electronic Control Units (ECUs) can communicate with each other over a simple twisted pair of wires (CAN high and CAN low), drastically reducing wiring complexity. It employs Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) to ensure data integrity and prevent packet loss, allowing for efficient and reliable communication critical for safety-related functions like braking.

Despite its efficiency and widespread adoption, the CAN bus protocol was not designed with security in mind. A fundamental flaw is its lack of encryption and authentication for messages transmitted across the network. This means that every packet flowing on the bus is implicitly trusted by all connected ECUs. This "trust-by-default" architecture opens the door to various frame attacks and protocol attacks, where an attacker with physical access to the CAN bus can inject malicious messages, spoof legitimate commands, or manipulate vehicle functions. For instance, knowing the specific arbitration ID and data payload for a function like turning the steering wheel or activating turn signals allows an attacker to replicate or alter that behavior.

The primary challenge for security researchers attempting to exploit or defend CAN bus systems is the sheer volume and complexity of the data. A standard CAN network operates at 500 kbps, while high-speed CAN can reach 1 Mbps, generating thousands of packets per second. Manually reversing these packets to identify which specific messages control particular vehicle functions is an extremely time-consuming and arduous process. Traditional methods often involve "halving" a captured log, replaying segments, and observing vehicle behavior to narrow down potential packets, but this remains largely a manual, iterative process. This labor-intensive nature of CAN analysis motivated the development of tools like CANalyse, aiming to automate the identification of relevant packets and provide a more efficient workflow for both offensive and defensive security operations in the automotive domain.

Key Findings

▶ Watch: Motivation: Automating CAN analysis, remote access, session logging (5:00)

CANalyse 2.0 introduces several key findings and contributions that significantly enhance the efficiency and capabilities of CAN bus analysis and interaction:

  1. Automated Packet Filtering via Hash Maps: The core innovation of CANalyse is its automated filtering mechanism. By capturing two distinct logs – a "source file" representing general vehicle traffic (noise) and an "action file" containing traffic during a specific intended action (action + noise) – the tool can automatically identify the unique packets associated with that action. This is achieved through the use of hash maps, which allow for rapid comparison of packet IDs and their data payloads. The assumption is that packets present in both the noise and action logs are general traffic, while those unique to the action log (or changing within it) are the intended control packets. This dramatically reduces the manual effort traditionally required to isolate relevant messages.
  1. Session-Based Logging and Project Management: Drawing inspiration from tools like Burp Suite, CANalyse 2.0 provides a "session-based" approach to managing CAN bus data. Users can collect multiple logs, perform various filtering operations, and store the results (payloads, filtered data) within a defined project structure. This allows for organized research, easy revisiting of previous analyses, and the ability to work on multiple functions or attack vectors concurrently without losing context.
  1. Remote Operation and Hardware Implant Capabilities: A significant advancement is the integration of Telegram bots for remote interaction. By deploying CANalyse on a Raspberry Pi (or similar embedded hardware) connected to a vehicle's CAN bus, researchers can establish a hardware implant back door. Commands can be sent via Telegram, and the tool can execute scans, filter packets, and even replay payloads remotely. This functionality enables covert analysis, persistent access, and the execution of attacks from a distance, highlighting a critical attack vector for automotive systems.
  1. SQL-Powered Advanced Filtering: For more granular and flexible analysis, CANalyse's IDE mode leverages pandas dataframes to store captured CAN messages. Crucially, it allows users to run standard SQL commands directly on these dataframes. This empowers users to perform complex queries, joins, and exclusions (e.g., SELECT id, data FROM action EXCEPT SELECT id, data FROM noise) to precisely refine their packet sets, identify specific sequences, or remove unwanted "noise star" packets (additional packets generated during an action that might not be directly relevant).
  1. Seamless Data Transfer and Project Export: The tool facilitates the easy transfer of analysis data between different sessions or projects. Users can export an entire session, including all collected logs, filtered payloads, and even the command history, into a structured directory. This exported data can then be seamlessly imported into another CANalyse session, enabling collaborative research, sharing of findings, and continuity of work without tedious manual copying or re-analysis.

Technical Deep Dive

▶ Watch: Smart Scan Demo: Automated turn signal packet filtering (18:00)

CANalyse 2.0 is built upon the python-can library, leveraging its capabilities for interacting with CAN bus interfaces. The tool operates in two primary modes: Smart Scan for automated, quick filtering, and IDE for more advanced, command-line driven analysis. Both modes fundamentally rely on the principle of isolating intended action packets from general bus traffic, often summarized as action_traffic - noise_traffic = intended_payload.

The Smart Scan mode is designed for rapid identification of packets associated with a specific, discrete action. When activated, it continuously monitors the specified CAN interface (e.g., vcan0 for a virtual CAN bus or a physical interface). The core logic resides in a function similar to collect_signal. This function continuously captures all incoming CAN messages and converts them into hash maps, where each entry typically contains the arbitration ID and the data payload. While the user is performing the intended action (e.g., pressing a turn signal), Smart Scan concurrently records this "action traffic." By constantly comparing the hash map of the general "noise" traffic with the hash map of the "action traffic," it quickly identifies and displays only those packets that appeared or changed during the action period. The assumption here is that if a packet (ID and data) is present in both the general noise and the action recording, it's considered background traffic. If it's new or unique to the action period, it's flagged as potentially relevant. This automated, real-time comparison allows for near-instantaneous identification of critical control messages, such as the 244 arbitration ID associated with turn signals in the IC simulator demo.

The IDE (Integrated Development Environment) mode offers a more powerful and flexible command-line interface, akin to a Python interpreter but specialized for CAN analysis. It uses python-can for low-level bus interaction and captures all messages into pandas dataframes. Pandas is a crucial component, as it provides high-performance, easy-to-use data structures and data analysis tools, making it ideal for handling large volumes of CAN data.

Within the IDE, users can execute predefined functions like scan(channel, duration) to record traffic for a specified time. For example, noise = scan('vcan0', 60) will capture 60 seconds of traffic from vcan0 and store it in a pandas dataframe named noise. Similarly, action = scan('vcan0', 60) would capture traffic during an action. The real power of the IDE emerges with its SQL integration. Since the CAN messages are stored in pandas dataframes, CANalyse provides a mechanism to treat these dataframes as SQL tables. Users can then run standard SQL queries to filter and manipulate the data. A common operation is to identify unique packets in the action log that are not present in the noise log, using the EXCEPT clause:

sql("SELECT id, data FROM action EXCEPT SELECT id, data FROM noise")

This query effectively removes all common "noise" packets, leaving behind only the unique id and data pairs that changed during the intended action.

To reconstruct a full payload suitable for replay, including timestamp and channel information, the IDE supports JOIN operations:

payload = sql("SELECT a.timestamp, a.channel, a.id, a.data FROM action AS a JOIN (SELECT id, data FROM action EXCEPT SELECT id, data FROM noise) AS b ON a.id = b.id AND a.data = b.data")

This command creates a new dataframe, payload, containing all the necessary fields for replaying the identified action. The tool also accounts for "noise star" packets—additional packets generated during an action that might not be directly part of the core control but are correlated. The SQL filtering capabilities allow users to further refine these payloads, for example, by adding WHERE id != '19b' to exclude specific unwanted IDs.

Seamless data transfer is another technical highlight. The export("project_name") command serializes all current session data, including raw logs, filtered payloads, and the command history (stored as a .class file), into a structured directory. This directory can then be imported into another CANalyse session using import("project_name"), making project sharing and continuity straightforward. The remote capabilities via Telegram bots function by mapping user commands received through the bot's HTTP API to the corresponding CANalyse IDE functions, effectively providing a remote shell for CAN bus interaction. This setup requires the hardware implant (e.g., Raspberry Pi) to have remote connectivity and a stable power supply.

Demo / Proof of Concept

▶ Watch: IDE Demo: Advanced packet filtering using SQL queries (21:00)

The demonstration of CANalyse 2.0 was conducted using an IC simulator running on a virtual machine, effectively simulating a vehicle's CAN bus environment. This approach allowed the speakers to showcase the tool's capabilities without risking damage to a physical vehicle and ensured a consistent, reproducible environment. The simulator utilized vcan0 as the virtual CAN interface.

The demo began with the Smart Scan mode. After launching CANalyse, the speaker initiated the Smart Scan, which silently began recording all general traffic on vcan0. The speaker then pressed the spacebar to initiate the "action" recording phase and activated the right and left turn signals on the IC simulator. Almost immediately, CANalyse displayed the filtered packets, prominently showing the arbitration ID 244 along with its associated data, confirming that these were the specific packets responsible for controlling the turn signals. This real-time filtering highlighted the efficiency of the hash map-based comparison. The filtered logs could then be saved to a file, demonstrating the tool's ability to quickly isolate and store relevant packets.

Next, the IDE mode was showcased for more complex analysis. The speaker first recorded a "noise" file for 60 seconds by running noise = scan('vcan0', 60). This captured a baseline of general bus traffic. Following this, an "action" file was recorded for another 60 seconds using action = scan('vcan0', 60). During this action recording, the speaker performed a sequence of actions on the simulator: opening the right door, activating the right turn signal, opening the left door, activating the left turn signal, and closing all doors.

Once both logs were collected, the speaker demonstrated the SQL filtering capabilities. By treating the noise and action dataframes as tables, a SQL EXCEPT query was executed to identify packets present in the action log but not in the noise log: sql("SELECT id, data FROM action EXCEPT SELECT id, data FROM noise"). This query successfully reduced thousands of packets to a concise set of around six unique ID and data pairs, representing the intended actions. To fully reconstruct these actions for replay, a more complex SQL JOIN query was used to pull the timestamp, channel, id, and data from the original action dataframe for the filtered packets. This resulted in a payload dataframe that accurately contained the sequence of actions.

The payload was then replayed using play('vcan0', payload), and the IC simulator visibly responded by opening and closing doors and activating turn signals in the exact sequence and timing as originally recorded, confirming the precision of the filtering and payload reconstruction. The demo further illustrated how to refine payloads by filtering out specific unwanted IDs (e.g., WHERE id != '19b').

Finally, the Telegram bot integration was demonstrated. After setting up a Telegram bot token in CANalyse's settings and initializing the bot, the speaker showed how to execute commands remotely. Similar scan and filter operations were performed via Telegram messages, with the bot providing feedback (e.g., "message received," "output is good," and a thumbs-up emoji upon completion). The ability to remotely export the entire project folder, containing all logs, commands, and filtered payloads, was also showcased, emphasizing the tool's utility for remote hardware implants and covert operations. The demonstration concluded by highlighting the seamless import feature, allowing previously exported project data to be loaded into a new CANalyse session with a single command.

Defensive Implications

▶ Watch: Future plans, Scapy integration, and community contributions (44:00)

The capabilities demonstrated by CANalyse 2.0, while powerful for offensive security research, also carry significant defensive implications for automotive cybersecurity. The tool serves as a stark reminder of the inherent insecurities within the CAN bus protocol and provides defenders with a mechanism to understand, monitor, and potentially mitigate these vulnerabilities.

Firstly, CANalyse underscores the fundamental problem of lack of authentication and encryption on the CAN bus. Since any ECU can inject messages that are implicitly trusted, defenders must assume that an attacker with physical access can manipulate critical vehicle functions. This necessitates a shift in security strategies from purely network-based defenses to a more holistic approach that includes physical security and anomaly detection at the CAN bus level.

For security teams and OEMs, CANalyse can be invaluable for baseline analysis and anomaly detection. By using the Smart Scan or IDE mode, defenders can capture "normal" operational traffic for various vehicle states and functions. This baseline can then be used to compare against real-time traffic to identify any unusual or unauthorized messages. For example, if a CANalyse-like tool is deployed on a vehicle and detects a packet sequence that corresponds to an "open doors" command without a corresponding user action, it could flag a potential intrusion or spoofing attempt. The SQL-powered filtering is particularly useful here, allowing defenders to craft highly specific queries to identify known malicious patterns or deviations from expected behavior.

The demonstration of remote hardware implants via Raspberry Pi and Telegram bots highlights a critical threat vector. Defenders need to be aware that once a physical backdoor is established, an attacker can maintain persistent, covert access to the vehicle's internal networks. This implies the need for enhanced physical security measures around diagnostic ports (like OBD-II) and other easily accessible CAN bus connections. Furthermore, intrusion detection systems (IDS) tailored for CAN bus traffic that can detect abnormal message frequencies, invalid data payloads, or out-of-sequence commands become crucial.

CANalyse also provides a practical platform for vulnerability assessment and penetration testing from a defensive perspective. Security engineers can use the tool to simulate various attacks (e.g., replay attacks, spoofing specific commands) against their own ECUs or vehicle architectures to identify weaknesses before they are exploited by malicious actors. This proactive testing can help in developing more resilient software and hardware.

Finally, the tool's ability to export and import entire project sessions fosters knowledge sharing within defensive teams. Security researchers can analyze vulnerabilities, create specific detection rules, and share these findings with other team members or even industry peers, accelerating the development of robust countermeasures. Ultimately, CANalyse 2.0 empowers defenders to move beyond theoretical understanding of CAN bus vulnerabilities to practical, hands-on analysis and real-world threat intelligence.

Key Takeaways

  • Automated CAN Bus Analysis: CANalyse 2.0 significantly automates the process of identifying specific CAN packets related to vehicle functions by comparing "noise" (general traffic) with "action" (intended function + noise) logs using hash maps and SQL queries.
  • Remote Control Capabilities: The tool supports remote interaction with vehicle CAN networks via Telegram bots, enabling scenarios like hardware implant backdoors on embedded devices (e.g., Raspberry Pi) for covert analysis and attack execution.
  • SQL-Powered Data Filtering: Leveraging pandas dataframes, CANalyse's IDE mode allows users to perform advanced, precise filtering of CAN messages using standard SQL commands, greatly enhancing the flexibility and power of data analysis.
  • Session-Based Project Management: CANalyse provides a structured, session-based approach for collecting, managing, and exporting CAN logs, filtered payloads, and command histories, facilitating organized research and collaboration.
  • Inherent CAN Bus Insecurity: The tool implicitly highlights the fundamental security weaknesses of the CAN bus, particularly its lack of native encryption and authentication, making all messages inherently trusted and susceptible to frame-level manipulation.
  • Defensive Utility: Beyond offensive applications, CANalyse serves as a valuable asset for defenders to understand baseline vehicle network behavior, identify anomalous traffic, test for vulnerabilities, and develop more effective intrusion detection and prevention strategies for automotive systems.

About the Speaker(s)

Kartheek Lade is an IoT Security Researcher, where he focuses on breaking and securing various Internet of Things (IoT) and automotive systems. He is passionate about automotive and IoT security and has been a speaker at several prominent security conferences, including Black Hat Asia Arsenal, DEF CON Car Hacking Village 2022, and BSides. Kartheek is a strong advocate for community involvement and open-source contributions, actively participating in and volunteering for communities like BSides, and open-sourcing his tools and blog content. He also loves watching anime, particularly Doraemon.

Rahul J is a Digital Specialist Engineer at Infosys and a key collaborator in the development of CANalyse 2.0, primarily responsible for the tool's codebase. He is described by Kartheek as the "code guy" who cleans up and refines their projects. Like Kartheek, Rahul is an ardent open-source contributor and has worked on various libraries, including those related to integrating ESP8266 (NodeMCU) into IoT projects. His passion lies in robotics and mechatronics, and he is known for his deep analytical thinking.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

This isn't breaking new ground in automotive exploitation, but it's a massive quality-of-life upgrade for anyone who actually stares at CAN traffic. Lade and Rahul took the most tedious part of car hacking—staring at scrolling hex to find the one arbitration ID that pops the trunk—and automated it with pandas and SQL. It's a highly pragmatic tool drop that belongs in every vehicle researcher's repo.

Heather Calloway (CISO) — SOLID

If your organization manufactures embedded systems or operates a connected fleet, this is worth noting. The speakers demonstrate a tool that drops the technical barrier for reversing and exploiting automotive networks to near zero. For everyone else, it’s an interesting but out-of-scope technical demo.

→ Top-rated talks at Car Hacking Village @ DEF CON 30

All talks from Car Hacking Village @ DEF CON 30