Location Research Breakthrough Possible @S-Logix pro@slogix.in

Executing CAN Bus Injection Attacks Against SocketCAN-Based Industrial IoT Gateways Through CAN Identifier Allowlisting and Message-Rate Anomaly Monitoring

Description

Modern Industrial IoT, automotive, robotics, and Industry 4.0 environments use Controller Area Network (CAN) communication to exchange messages between controllers, sensors, actuators, gateways, and embedded devices.

CAN communication is designed for efficient and reliable message exchange between connected devices. However, traditional CAN communication does not inherently provide strong source authentication for individual messages. An unauthorized device or compromised gateway with access to the CAN network may therefore attempt to inject unauthorized CAN frames.

A CAN Bus Injection Attack can introduce unauthorized messages into the communication channel. Depending on the affected message identifier and system architecture, injected frames may interfere with legitimate device communication or cause unauthorized control actions.

In this use case, a controlled CAN-based Industrial IoT environment is created using Linux SocketCAN and a virtual CAN interface. The virtual CAN environment represents communication between industrial controllers, sensors, actuators, and an IoT gateway without requiring physical CAN hardware.

A legitimate CAN communication baseline is established by identifying approved CAN identifiers and normal message rates.

A controlled CAN Bus Injection Attack is then simulated by generating unauthorized CAN frames using the laboratory environment. No physical industrial equipment or real vehicle-control system is affected.

can-utils and python-can are used to generate and analyze controlled CAN traffic. SavvyCAN provides additional CAN traffic visualization and analysis.

The monitoring mechanism validates CAN message identifiers against an approved allowlist and analyzes message frequency to identify abnormal injection activity.

When unauthorized CAN identifiers or abnormal message rates are detected, a security alert is generated and the affected laboratory CAN interface or source is isolated according to the containment policy.

The legitimate CAN communication is then validated to confirm that authorized industrial messages continue to operate normally.

The complete defensive workflow is: Industrial IoT CAN Network → Trusted CAN Message Baseline → CAN Bus Injection → CAN Identifier Validation → Message-Rate Anomaly Detection → Security Alert → Unauthorized Source Containment → Trusted CAN Communication Validation.

Existing Security Problem

Application: Controller Area Network (CAN)

Controller Area Network (CAN) is a communication protocol used by embedded and industrial systems to exchange messages between connected controllers and devices. CAN frames contain message identifiers and data fields that are interpreted by participating devices according to the system's communication design.

Existing Problem:

An unauthorized device or compromised gateway connected to a CAN network may attempt to transmit additional CAN frames. Because CAN communication does not inherently authenticate the physical sender of every message, a receiving device may process an injected frame if its identifier and message structure appear valid. If CAN traffic is not continuously monitored, unauthorized frames may be difficult to distinguish from legitimate industrial communication.

The security problem is therefore:

Unauthorized / Compromised CAN Participant → CAN Network Access → Unauthorized CAN Frame Injection → Unexpected CAN Identifier / Message Rate → Industrial Communication Anomaly → Potential Control-System Impact → OT / IoT Security Risk

The proposed solution introduces CAN message allowlisting, message-rate baseline monitoring, CAN traffic analysis, anomaly detection, security alerting, and unauthorized-source containment.

Attack

Specific Attack: CAN Bus Injection

The controlled attack scenario simulates unauthorized CAN frames being introduced into a laboratory CAN network. A legitimate CAN communication baseline is first established using approved message identifiers and normal message frequencies. A controlled laboratory source then generates additional CAN frames that do not belong to the trusted communication baseline. The objective is to determine whether the security controls can identify unauthorized CAN identifiers or abnormal message transmission rates.

Attack Behavior:
Controlled Unauthorized CAN Source
→
CAN Network Access
→
Injected CAN Frames
→
Unexpected CAN Identifier
→
Abnormal Message Frequency
→
CAN Traffic Monitoring
→
Injection Anomaly Detected
→
Security Alert
→
Unauthorized Source Containment
→
Legitimate CAN Communication Validation

Security Concept

CAN Message Integrity and Behavioral Monitoring:

The primary security concept is CAN Message Integrity and Behavioral Monitoring.

A trusted baseline is established containing approved CAN message identifiers and their expected communication behavior. CAN traffic is continuously analyzed to determine whether observed frames conform to the established communication policy. A legitimate CAN message should match an approved identifier and remain within the expected communication behavior. An unknown CAN identifier or significant deviation from the normal message-rate baseline should be treated as suspicious and investigated.

The secure processing flow is:

Trusted CAN Message Inventory
→
CAN Traffic Monitoring
→
CAN Identifier Validation
→
Message-Rate Analysis
→
Behavior Comparison
→
Expected / Unexpected Traffic
→
Security Alert
→
Source / Interface Containment
→
CAN Communication Validation

Defensive Mechanism

Trusted CAN Identifier Inventory

An inventory of approved CAN message identifiers is established.

Purpose

Define which CAN message types are authorized within the industrial communication environment.

CAN Identifier Allowlisting

Observed CAN identifiers are compared against the approved identifier list.

Purpose

Detect unauthorized CAN message types.

Message-Rate Baseline

Normal message frequencies are established for approved CAN identifiers.

Purpose

Determine expected communication behavior.

Message-Rate Anomaly Detection

Observed CAN message frequency is compared against the established baseline.

Purpose

Detect abnormal bursts or excessive CAN frame transmission.

CAN Traffic Monitoring

CAN frames are continuously observed on the laboratory interface.

Purpose

Provide visibility into industrial CAN communication.

Message-Timing Analysis

The timing relationship between CAN frames is analyzed.

Purpose

Identify unexpected changes in normal CAN communication behavior.

Unknown Device / Source Detection

Unexpected CAN traffic sources or interfaces are identified where the laboratory architecture provides source information.

Purpose

Detect unauthorized participants in the controlled CAN environment.

Security Alerting

A security alert is generated when the configured CAN injection-detection condition is satisfied.

Purpose

Provide immediate visibility into suspicious CAN communication.

Unauthorized Source Containment

The identified laboratory CAN source or interface can be restricted according to the containment policy.

Purpose

Prevent continued unauthorized CAN traffic.

Trusted CAN Communication Validation

Legitimate CAN traffic is revalidated after containment.

Purpose

Ensure that authorized industrial communication remains operational.

Security Tools

Primary CAN Communication Framework: SocketCAN

SocketCAN is the Linux kernel CAN networking framework used to create and manage the controlled CAN communication environment.

Purpose
  • Create CAN interfaces.
  • Provide CAN communication between laboratory components.
  • Support virtual CAN interfaces.
  • Capture CAN traffic.
  • Provide the foundation for CAN security testing.

CAN Traffic Testing and Analysis Tool: can-utils

can-utils is an open-source collection of Linux CAN utilities used to generate, capture, inspect, and analyze CAN frames.

Purpose
  • Generate controlled CAN frames.
  • Capture CAN traffic.
  • Monitor CAN communication.
  • Inspect CAN identifiers.
  • Validate message-rate behavior.

CAN Programming and Simulation Tool: python-can

python-can is used to programmatically generate and monitor CAN messages.

Purpose
  • Generate controlled CAN traffic.
  • Implement repeatable CAN-message simulations.
  • Monitor CAN communication.
  • Calculate message frequencies.
  • Support automated anomaly-detection testing.

CAN Visualization and Analysis Tool: SavvyCAN

SavvyCAN is used to visualize and analyze CAN communication.

Purpose
  • Observe CAN traffic.
  • Analyze CAN identifiers.
  • Visualize message activity.
  • Investigate communication patterns.
  • Support post-attack analysis.

Network Interface Management Tool: iproute2

iproute2 is used to configure and inspect the Linux CAN networking environment.

Purpose
  • Create and configure virtual CAN interfaces.
  • Inspect CAN interface status.
  • Validate network configuration.
  • Disable or restore laboratory CAN interfaces.
  • Support containment validation.

Target Platform: Ubuntu Linux

Ubuntu provides the controlled Industrial IoT security environment.

Purpose
  • Host SocketCAN.
  • Run the virtual CAN environment.
  • Execute CAN monitoring tools.
  • Generate and analyze CAN traffic.
  • Apply the containment mechanism.

Security Testing Platform: Kali Linux

Kali Linux provides the controlled security-assessment environment.

Purpose
  • Perform authorized CAN security testing.
  • Generate controlled CAN injection traffic.
  • Analyze the CAN communication environment.
  • Validate detection and containment.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated laboratory infrastructure.

Purpose
  • Host Ubuntu industrial systems.
  • Host Kali Linux.
  • Maintain isolated CAN-security test environments.
  • Provide a reproducible assessment platform.

Process

STEP 01

Prepare the Virtualized Industrial IoT Environment

  • Create an isolated Industrial IoT security laboratory using VirtualBox.
  • Configure Ubuntu as the CAN communication environment.
  • Configure Kali Linux as the controlled security-testing system.
  • Establish controlled communication between the virtual machines.
  • Verify that the environment is isolated from physical CAN networks.
  • Confirm that only laboratory interfaces and test data are used.
  • Record the initial laboratory configuration.
Tools: VirtualBox + Ubuntu + Kali Linux
STEP 02

Configure the Virtual CAN Environment

  • Verify that SocketCAN is available on Ubuntu.
  • Create the required virtual CAN interface.
  • Configure the CAN interface parameters.
  • Bring the virtual CAN interface into an operational state.
  • Verify the interface configuration.
  • Confirm that CAN frames can be exchanged within the laboratory.
  • Record the initial CAN interface configuration.
Tools: SocketCAN + iproute2 + Ubuntu
STEP 03

Establish the Legitimate CAN Communication Environment

  • Create controlled laboratory CAN communication participants.
  • Assign the approved CAN message identifiers.
  • Define the expected message types.
  • Configure legitimate CAN message transmission.
  • Verify that the laboratory participants communicate normally.
  • Record the expected CAN communication behavior.
  • Preserve the configuration as the trusted communication baseline.
Tools: SocketCAN + python-can + Ubuntu
STEP 04

Establish the Trusted CAN Identifier Inventory

  • Identify the CAN message identifiers used by legitimate laboratory devices.
  • Record each approved CAN identifier.
  • Associate identifiers with their expected device or function.
  • Record the expected communication direction where applicable.
  • Define the approved message types.
  • Store the identifier information as the trusted CAN inventory.
  • Protect the inventory from unauthorized modification.
Tools: python-can + can-utils
STEP 05

Establish the Normal CAN Message-Rate Baseline

  • Monitor legitimate CAN traffic.
  • Record the frequency of each approved CAN identifier.
  • Record normal message timing.
  • Identify normal communication bursts.
  • Determine the expected message-rate range for each identifier.
  • Preserve the normal traffic statistics.
  • Establish the baseline for anomaly detection.
Tools: can-utils + python-can
STEP 06

Configure CAN Identifier Allowlisting

  • Configure the monitoring mechanism with the trusted CAN identifier inventory.
  • Define which CAN identifiers are authorized.
  • Configure detection for unknown identifiers.
  • Associate each approved identifier with its expected function.
  • Test the allowlisting mechanism using legitimate CAN traffic.
  • Verify that approved identifiers are accepted.
  • Record the CAN security policy.
Tools: python-can + can-utils
STEP 07

Configure Message-Rate Anomaly Detection

  • Configure the expected message-rate thresholds.
  • Monitor the frequency of approved CAN identifiers.
  • Define conditions representing abnormal transmission rates.
  • Configure detection for unexpected message bursts.
  • Configure the appropriate alert severity.
  • Test the detection mechanism using normal CAN traffic.
  • Verify that legitimate traffic does not unnecessarily trigger the anomaly condition.
Tools: python-can + can-utils
STEP 08

Establish the Normal CAN Security Baseline

  • Monitor the complete laboratory CAN communication.
  • Verify that only approved CAN identifiers are present.
  • Verify that message frequencies remain within the expected baseline.
  • Confirm that no unexpected CAN traffic exists.
  • Record the normal CAN traffic state.
  • Preserve packet and message-analysis evidence.
  • Confirm that the security monitoring process is operational.
Tools: SocketCAN + can-utils + SavvyCAN
STEP 09

Prepare the Controlled CAN Bus Injection Simulation

  • Create the controlled unauthorized CAN traffic source.
  • Connect the test source only to the isolated laboratory CAN environment.
  • Select an unauthorized CAN identifier for the simulation.
  • Configure the test source to generate controlled CAN frames.
  • Preserve the legitimate CAN communication.
  • Prepare the monitoring mechanism before starting the injection.
  • Record the test configuration.
Tools: python-can + SocketCAN + Kali Linux
STEP 10

Generate the Controlled CAN Bus Injection

  • Start the controlled CAN injection activity.
  • Generate CAN frames using the unauthorized identifier.
  • Introduce the frames into the isolated laboratory CAN environment.
  • Maintain the legitimate CAN communication during the assessment.
  • Monitor the CAN interface while the injection is active.
  • Record the injected message identifiers.
  • Record the injection timing and message frequency.
Tools: can-utils + python-can + Kali Linux
STEP 11

Detect the Unauthorized CAN Identifier

  • Monitor the incoming CAN frames.
  • Identify the injected CAN identifier.
  • Compare the identifier with the trusted CAN allowlist.
  • Determine whether the identifier is authorized.
  • Record the first detection timestamp.
  • Associate the traffic with the laboratory CAN interface.
  • Confirm that the identifier satisfies the unauthorized-message detection condition.
Tools: python-can + can-utils
STEP 12

Detect the CAN Message-Rate Anomaly

  • Measure the frequency of the injected CAN frames.
  • Compare the observed rate with the established baseline.
  • Identify abnormal message bursts or excessive transmission.
  • Compare the behavior with legitimate CAN communication.
  • Determine whether the observed rate exceeds the configured threshold.
  • Record the anomaly information.
  • Preserve the relevant CAN traffic evidence.
Tools: python-can + SavvyCAN + can-utils
STEP 13

Generate the CAN Injection Security Alert

  • Configure the monitoring mechanism to generate a security alert when unauthorized identifiers or abnormal message rates are detected.
  • Include the affected CAN interface.
  • Include the unauthorized CAN identifier.
  • Include the observed message frequency.
  • Include the detection timestamp.
  • Include the baseline comparison.
  • Assign an appropriate alert severity.
  • Verify that the CAN Bus Injection condition is recorded.
Tools: python-can + can-utils
STEP 14

Investigate the CAN Bus Injection Activity

  • Review the generated security event.
  • Identify the unauthorized CAN identifier.
  • Review the message transmission frequency.
  • Compare the injected traffic with the trusted baseline.
  • Review the CAN traffic using SavvyCAN.
  • Determine whether the traffic represents legitimate or unauthorized activity.
  • Confirm the CAN Bus Injection condition.
Tools: SavvyCAN + can-utils + python-can
STEP 15

Configure the CAN Containment Mechanism

  • Define the response policy for confirmed CAN Bus Injection activity.
  • Identify the affected laboratory CAN interface or test source.
  • Configure the laboratory environment to restrict the unauthorized CAN source.
  • Ensure that legitimate CAN communication is preserved where possible.
  • Test the containment mechanism before the final assessment.
  • Record the containment policy.
Tools: SocketCAN + iproute2 + Ubuntu
STEP 16

Contain the Unauthorized CAN Traffic

  • Trigger the configured containment mechanism.
  • Restrict the unauthorized laboratory CAN source or interface.
  • Prevent continued injection of unauthorized CAN frames.
  • Verify that the unauthorized traffic has stopped.
  • Confirm that the legitimate CAN communication remains available where applicable.
  • Record the containment event.
Tools: SocketCAN + iproute2 + Ubuntu
STEP 17

Validate Legitimate CAN Communication

  • Monitor the CAN interface after containment.
  • Verify that approved CAN identifiers remain active.
  • Confirm that legitimate message rates remain within the expected baseline.
  • Verify that unauthorized identifiers are no longer observed.
  • Compare the final CAN traffic with the trusted baseline.
  • Confirm that the industrial IoT communication environment remains operational.
  • Record the post-containment validation results.
Tools: can-utils + python-can + SavvyCAN
STEP 18

Perform Final CAN Bus Injection Detection and Response Validation

  • Repeat the controlled CAN Bus Injection assessment.
  • Verify that the unauthorized CAN identifier is detected.
  • Verify that abnormal message-rate behavior is identified.
  • Verify that the CAN security alert is generated.
  • Verify that the suspicious CAN source or interface is identified.
  • Verify that the configured containment mechanism is triggered.
  • Confirm that unauthorized CAN traffic is restricted.
  • Confirm that legitimate CAN communication remains operational.
  • Review the complete CAN traffic and security-event timeline.
  • Document the final Industrial IoT CAN security assessment results.
Tools: SocketCAN + can-utils + python-can + SavvyCAN + iproute2 + Ubuntu + Kali Linux

Outcome

  1. A CAN Bus Injection Attack is successfully simulated within the isolated Industrial IoT security laboratory.
  2. A software-based CAN communication environment is successfully established using SocketCAN, eliminating the requirement for physical CAN hardware.
  3. A trusted CAN identifier inventory is established, defining the approved message types used by legitimate laboratory devices.
  4. A normal CAN message-rate baseline is established, providing expected communication behavior for anomaly detection.
  5. Unauthorized CAN identifiers are detected through CAN message allowlisting, identifying injected traffic that does not belong to the trusted communication environment.
  6. Abnormal CAN message-rate behavior is detected through behavioral monitoring, identifying excessive or unexpected CAN frame transmission.
  7. Security alerts are generated when the configured CAN Bus Injection conditions are satisfied, providing visibility into suspicious industrial communication.
  8. The unauthorized laboratory CAN source or interface is contained according to the response policy, preventing continued injection activity.
  9. Legitimate CAN communication remains operational after containment, confirming that authorized industrial IoT communication is not unnecessarily disrupted.
  10. The complete CAN Bus Injection detection, CAN identifier allowlisting, message-rate baseline creation, traffic monitoring, anomaly detection, security alerting, unauthorized-source containment, legitimate communication validation, and post-containment security verification workflow is successfully demonstrated.
Project 1 of 7
Next Project →