canTot - A CAN Bus Hacking Framework to Compile Fun Hacks and Vulnerabilities

Jay Turla (Principal Security Consultant · VikingCloud)

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

Overview

Jay Turla, a Principal Security Consultant at VikingCloud, introduced canTot, an open-source Python-based framework designed for CAN bus hacking. The talk, delivered at the Car Hacking Village at DEF CON 30, detailed the framework's inception, functionality, and future roadmap. canTot aims to compile known CAN bus hacks and vulnerabilities into a user-friendly, Metasploit-like interface, serving as a centralized resource for automotive security researchers and enthusiasts.

Watch on YouTube

Visual summary for canTot - A CAN Bus Hacking Framework to Compile Fun Hacks and Vulnerabilities by Jay Turla
Visual summary for canTot - A CAN Bus Hacking Framework to Compile Fun Hacks and Vulnerabilities by Jay Turla

Key moments

  1. 0:00 Introducing canTot: A CAN Bus Hacking Framework
  2. 2:04 canTot's inspiration: Metasploit Hardware Bridge and automotive modules
  3. 5:38 Why canTot? Metasploit module rejection experience
  4. 8:00 canTot is born: Compiling known CAN Bus hacks
  5. 13:30 Live demo: Exploring canTot modules and functionality
  6. 19:00 Visual demo: canTot fuzzing a Peugeot 207 instrument cluster
  7. 20:10 Download and installation guide for the canTot framework
  8. 22:00 canTot's future roadmap: More modules, fuzzers, and features

canTot - A CAN Bus Hacking Framework to Compile Fun Hacks and Vulnerabilities

Speakers: Jay Turla (Principal Security Consultant, VikingCloud)

Conference: Car Hacking Village @ DEF CON 30

YouTube: https://www.youtube.com/watch?v=LRBjGJEBs9I

Overview

Jay Turla, a Principal Security Consultant at VikingCloud, introduced canTot, an open-source Python-based framework designed for CAN bus hacking. The talk, delivered at the Car Hacking Village at DEF CON 30, detailed the framework's inception, functionality, and future roadmap. canTot aims to compile known CAN bus hacks and vulnerabilities into a user-friendly, Metasploit-like interface, serving as a centralized resource for automotive security researchers and enthusiasts.

The framework addresses a perceived gap in the automotive security landscape, particularly after the Metasploit Project's shift away from hardware-focused modules. By providing a platform for developing and sharing CAN bus exploits, canTot seeks to lower the barrier to entry for car hacking, encourage community contributions, and ultimately foster a deeper understanding of vehicle security vulnerabilities. Turla envisions canTot evolving into a comprehensive vulnerability database for CAN bus attacks, empowering both offensive researchers and defensive practitioners.

Background

▶ Watch: Introducing canTot: A CAN Bus Hacking Framework (0:00)

The inspiration for canTot traces back to the Metasploit Hardware Bridge and its associated automotive post-modules. These modules, contributed by notable researchers like Craig Smith, allowed security professionals to interact with and exploit vulnerabilities on vehicle CAN networks. Turla highlighted modules such as automotive_pdt, which could interact with pyrotechnic devices like airbags, and his own contributions, including modules for ECU hard resets and diagnostic state manipulation. The Metasploit framework offered a powerful, unified interface for these hardware-level interactions.

However, the Metasploit Project's strategic direction began to diverge from extensive hardware bridge development. Turla noted that the last automotive-related Metasploit module for CAN bus hacking was his own contribution in October 2021. A critical turning point was the rejection of his module implementing the "kill brakes" vulnerability on a 2014 Jeep Cherokee, a well-known finding by Charlie Miller and Chris Valasek. The Metasploit team, citing concerns about potential misuse and a desire to move away from hardware bridge development, closed the pull request. This decision, while understandable from Metasploit's perspective, signaled a need for an alternative platform for compiling and sharing such hardware-centric automotive exploits.

Recognizing this gap, and observing the proliferation of excellent but often specialized open-source CAN tools like can-utils, Caring Caribou (a favorite for UDS diagnostics fuzzing), SavvyCAN, C-MAP, Canalizator, and Kayak, Turla decided to create a framework that would specifically compile known CAN bus hacks and attacks in a structured, Metasploit-like manner. This initiative was driven not only by the practical need for such a tool but also by a desire for personal learning and to cultivate a community of Python-savvy car hacking contributors. Leveraging an existing project, the exploit-kit-development-kit, Turla laid the foundation for canTot, a Python-based framework designed for automating car hacking vulnerabilities.

Key Findings

▶ Watch: Why canTot? Metasploit module rejection experience (5:38)

The central finding and contribution presented in the talk is the canTot framework itself. canTot emerges as a dedicated, open-source platform for cataloging and executing known CAN bus vulnerabilities, addressing the need for a consolidated resource in automotive security research. Its design philosophy is heavily influenced by Metasploit, providing a familiar and intuitive interface for users.

Key findings related to canTot's functionality and purpose include:

  • A Unified Repository for Known Hacks: canTot's primary contribution is its role as a compilation of previously discovered and publicly known CAN bus attacks. This includes historical vulnerabilities like the Tesla Model S disable ESP/ABS and open trunk exploits (discovered in 2016 and subsequently patched), as well as the infamous 2014 Jeep Cherokee "kill brakes" vulnerability. By centralizing these, canTot creates a valuable reference point and testing ground.
  • Metasploit-like Usability: The framework adopts a command-line interface reminiscent of Metasploit, featuring commands like help, use <module_name>, show options, set <option_name> <value>, and run. This familiarity significantly lowers the learning curve for security researchers already accustomed to exploit frameworks.
  • Growing Module Base: As of the talk, canTot already contains 29 uncategorized modules, demonstrating a substantial initial offering. These modules cover a range of attack vectors, from ECU manipulation to instrument cluster fuzzing and denial-of-service attacks.
  • Community-Driven Development: A core objective of canTot is to foster a collaborative environment. Turla explicitly invites other car hackers and automotive security enthusiasts to contribute their own modules and research findings, aiming to expand canTot into a comprehensive, community-maintained vulnerability database. This collaborative approach is crucial for keeping the framework updated with new discoveries and diverse attack scenarios.
  • Educational Tool: Beyond its utility as an exploitation framework, canTot also serves as an educational resource. By providing documented modules and an accessible Python codebase, it allows aspiring car hackers to understand the technical intricacies of various CAN bus attacks. The framework's modular nature encourages users to dissect existing exploits and develop new ones, enhancing their Python programming and automotive security skills.

Technical Deep Dive

▶ Watch: Live demo: Exploring canTot modules and functionality (13:30)

canTot is architecturally built on Python, leveraging the exploit-kit-development-kit as its foundational framework. This choice provides a robust and extensible base for managing modules, options, and execution flows, while allowing for easy community contributions due to Python's widespread adoption in security research.

The framework's core operations revolve around a simple, command-line interface (CLI) that mimics the intuitive structure of Metasploit. Users interact with canTot through commands such as:

  • help: Displays available commands.
  • show modules: Lists all available modules, which were initially uncategorized but are slated for better organization.
  • search <keyword>: Filters modules based on keywords (e.g., search tesla or search mazda).
  • use <module_name>: Loads a specific module into the current context.
  • show options: Displays configurable parameters for the loaded module, such as arb_id (arbitration ID) for CAN messages or interface for specifying the CAN device (e.g., can0).
  • set <option_name> <value>: Configures a module option.
  • run: Executes the loaded module with the specified options.

Modules within canTot are structured to define options and implement a main function that encapsulates the attack logic. For example, a module might define arb_id and interface as options. The main function would then construct and send specific CAN frames based on these options. The framework uses underlying Python libraries like python-can for interacting with CAN devices and pyvit for specific functionalities, demonstrating flexibility in incorporating existing tools.

Several notable modules are already integrated into canTot, showcasing its diverse capabilities:

  • reset_mileage: This diagnostic module clears DTCs (Diagnostic Trouble Codes) and resets the odometer. Its code snippet reveals the structure for defining arb_id and interface options, and the main function sends specific CAN frames (e.g., frame_data 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01) to perform the reset.
  • cherokee_kill_breaks: Credited to Charlie Miller and Chris Valasek's research, this module targets the 2014 Jeep Cherokee. It injects UDS (Unified Diagnostic Services) data frames into the CAN bus to command the bleeding of all brakes while the vehicle is in motion. This module highlights the potential for critical safety implications through CAN bus manipulation.
  • tesla_disable_esp_abs / tesla_open_trunk: These modules demonstrate attacks against the Tesla Model S (specifically the 85 model, discovered in 2016). The disable_esp_abs module injects UDS data frames through the gateway to disable the ESP (Electronic Stability Program) or ABS (Anti-lock Braking System) ECU at low speeds. The open_trunk module simply opens the trunk. While these vulnerabilities have been patched, their inclusion in canTot serves as a valuable historical reference and a test case for understanding past attack vectors.
  • prev_spark_kill_engine: This module is designed to send a specific packet that kills fuel to all cylinders, effectively stopping the engine. This demonstrates a direct denial-of-service attack on critical vehicle functions.
  • malibu_overheat: Targeting a 2006 Malibu, this module floods temperature data onto the CAN bus, potentially causing the vehicle's systems to react to false overheating conditions.
  • kill_bus: Implements the "firehouse attack," a known CAN bus denial-of-service (DoS) technique. It continuously sends CAN frames with arbitration ID 0 and 8 bytes of zero data. This high-volume traffic can overwhelm the CAN bus, causing legitimate messages to be dropped and potentially leading to system instability or crashes. The attack can be stopped by pressing Ctrl+C.
  • Instrument Cluster Fuzzers: Modules like pg207_ic_mover (for a Peugeot 207) and rx8_rpm_fuzzer (for a Mazda RX-8) demonstrate the ability to manipulate vehicle instrument clusters. These modules can send spoofed messages to alter speedometer readings, RPM displays, or other dashboard indicators, showcasing how an attacker could feed false information to the driver or other ECUs.
  • UDS Fuzzers: canTot includes uds_fuzzer and uds_access_fuzzer, designed to test the robustness and security of UDS implementations. These fuzzers can help discover vulnerabilities in diagnostic services, which are often used for vehicle maintenance but can be exploited if not properly secured.

Installation of canTot is straightforward: users clone the GitHub repository, navigate to the directory, install dependencies via pip install -r requirements.txt, and then run python3 main.py. The framework is primarily tested and confirmed to work on Kali Linux and Ubuntu, with ongoing efforts to ensure compatibility with other Debian-based distributions. The roadmap includes further improvements to error handling, module information display, and the addition of more fuzzers, ECU unlock modules, and CAN analyzer capabilities.

Demo / Proof of Concept

▶ Watch: Visual demo: canTot fuzzing a Peugeot 207 instrument cluster (19:00)

Jay Turla provided a live demonstration of canTot running on a Kali Linux virtual machine, along with a pre-recorded video showcasing a physical instrument cluster attack.

In the live terminal demonstration, Turla initiated canTot by running python3 main.py. He first used show modules to display the current list of 29 uncategorized modules. To illustrate the search functionality, he demonstrated search tesla, which successfully returned modules like tesla_disable_esp_abs and tesla_open_trunk. Similarly, search mazda revealed modules related to Mazda vehicles.

For a practical example, Turla selected the prev_spark_kill_engine module. He used the command use prev_spark_kill_engine to load it. Upon typing show options, he noted that the primary configurable option was interface, which he set to can0 to target a virtual CAN device he had previously set up for testing purposes. Executing the module with run displayed output confirming the action: "sending a packet that will kill fuel to all cylinders to the [ECU]". He then showed how the candump utility (run separately) would capture the CAN messages sent by canTot, demonstrating the actual data frames being injected onto the virtual bus.

The pre-recorded video segment provided a more compelling proof of concept, showing canTot interacting with physical hardware. Turla demonstrated the pg207_ic_mover module on a Peugeot 207 instrument cluster. Using a CANDooPro device as the CAN interface, he executed the module, which is designed to fuzz the speedometer and accelerometer. The video clearly showed the physical instrument cluster reacting dynamically, with the speedometer and tachometer needles rapidly sweeping to their maximum values, confirming that the spoofed CAN messages sent by canTot successfully manipulated the cluster's readings. This visual demonstration underscored the framework's ability to execute real-world attacks on automotive components.

Defensive Implications

▶ Watch: canTot's future roadmap: More modules, fuzzers, and features (22:00)

The canTot framework, while designed for offensive security research, provides invaluable insights for defenders in the automotive industry. By compiling and demonstrating known CAN bus attacks, it highlights critical areas where vehicle systems are vulnerable and offers a practical toolset for testing and improving automotive cybersecurity.

Defensive implications include:

  • Understanding Attack Vectors: canTot's modules directly illustrate common CAN bus attack patterns, such as UDS injection (e.g., cherokee_kill_breaks, tesla_disable_esp_abs), denial-of-service (DoS) via bus flooding (e.g., kill_bus implementing the firehouse attack), and spoofing of critical sensor data (e.g., malibu_overheat, instrument cluster fuzzers). Defenders can use this knowledge to anticipate and detect similar attacks on their own vehicle platforms.
  • Vulnerability Assessment and Penetration Testing: Automotive OEMs and Tier 1 suppliers can utilize canTot as an internal tool for vulnerability assessment and penetration testing. By running the framework's modules against their own ECUs and vehicle networks (in controlled environments), they can identify whether their systems are susceptible to these known attacks. This proactive testing is crucial for discovering weaknesses before they are exploited in the wild.
  • Secure UDS Implementation: The presence of UDS-related modules (e.g., uds_fuzzer, uds_access_fuzzer, and modules that leverage UDS for specific actions) underscores the importance of robust security around Unified Diagnostic Services. Defenders must ensure proper access control, strong authentication mechanisms, and strict session management for UDS. Any diagnostic services that can alter critical vehicle behavior should be protected with cryptographic authentication and only accessible under specific, secure conditions.
  • Intrusion Detection and Prevention Systems (IDPS) for CAN: The attacks demonstrated by canTot emphasize the need for effective CAN bus IDPS solutions. These systems should be capable of detecting anomalous traffic patterns, such as an unusually high volume of messages with a specific arbitration ID (like in a firehouse attack), unexpected UDS requests, or conflicting sensor data. Implementing signature-based detection for known malicious CAN frames and anomaly-based detection for unusual bus behavior is paramount.
  • Network Segmentation and Isolation: The ability to impact critical vehicle functions highlights the importance of network segmentation. Critical ECUs (e.g., engine, brakes, steering) should ideally be isolated on separate CAN segments or protected by gateways that filter and validate messages, preventing direct attacks from less critical segments (e.g., infotainment).
  • Firmware and Software Updates: Many of the vulnerabilities compiled in canTot (e.g., Tesla exploits) were eventually patched. This reinforces the necessity of secure over-the-air (OTA) update mechanisms to rapidly deploy fixes for discovered vulnerabilities in vehicle software and firmware.
  • Training and Awareness: canTot can serve as an excellent training tool for automotive engineers, security teams, and incident responders. By engaging with the framework, personnel can gain hands-on experience with car hacking techniques, improving their ability to design secure systems, respond to incidents, and understand the adversary's perspective.

In essence, canTot translates academic research and past exploits into a tangible, executable form, enabling defenders to move beyond theoretical understanding to practical verification of their security posture against real-world automotive threats.

Key Takeaways

  • canTot is a Python-based framework designed to compile and execute known CAN bus hacking techniques and vulnerabilities, providing a centralized resource for automotive security research.
  • It offers a Metasploit-like user experience, making it accessible for security professionals familiar with exploit frameworks through commands like use, set, and run.
  • The framework addresses a gap in the automotive security toolchain, particularly after the Metasploit Project's shift away from extensive hardware bridge development and rejection of certain car hacking modules.
  • canTot includes a diverse set of modules for various attacks, such as ECU hard resets, diagnostic trouble code (DTC) clearing, instrument cluster manipulation (fuzzing speedometer/RPM), UDS fuzzing, and denial-of-service attacks like the firehouse attack.
  • It serves as a valuable tool for both offensive and defensive security, enabling researchers to test vulnerabilities and allowing automotive industry defenders to assess and strengthen their vehicle systems against known threats.
  • The project is open-source and community-driven, actively inviting contributions from car hackers and automotive security enthusiasts to expand its module base and evolve into a comprehensive vulnerability database for CAN bus hacks.

About the Speaker(s)

Jay Turla, known by his Twitter handle "shipcode," is a Principal Security Consultant at VikingCloud. In his professional role, he specializes in network, web application, and IoT penetration testing. Beyond his consulting work, Jay is a recognized figure in the cybersecurity community, serving on the review boards for RootCon and various Call for Papers (CFP) events.

His contributions to the security landscape are notable, including developing auxiliary and exploit modules for Metasploit, particularly those related to the Hardware Bridge. He is also the organizer of the Car Hacking Village at RootCon in the Philippines, demonstrating his deep commitment to fostering automotive security research. Jay is passionate about hacking botnets and has developed modules and exploits in that domain as well. He openly credits his work on canTot as a continuous learning experience and an effort to contribute back to the car hacking community.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

Rapid7 got squeamish about liability and gutted the Metasploit hardware bridge, so Turla built his own. canTot is a Python-based aggregator for known CAN bus attacks, stepping into the void left by corporate sanitization. It doesn't drop anything new, but it's a necessary workflow tool for the community.

Heather Calloway (CISO) — SOLID

This talk introduces canTot, an open-source framework that commoditizes known CAN bus exploits into a Metasploit-style interface. For automotive OEMs, it is an urgent wake-up call because it lowers the barrier to entry for vehicle attacks. For enterprise CISOs, it is a stark reminder that our executive and logistics fleets run on highly exploitable, unsegmented networks.

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

All talks from Car Hacking Village @ DEF CON 30