Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

Penetration Test Scope Definition

ElementContentDerived From
Attack surfaceOBD-II (CAN + Ethernet), Bluetooth, LTE, V2XTCU system boundary diagram
Threat actor profilesOpportunistic (commodity tools) vs nation-state (custom hardware)TARA threat actor assumptions
ObjectivesVerify or refute countermeasure effectiveness per threat scenarioTARA countermeasures requiring pentest as verification method
Rules of engagementNo safety-critical disruption; vehicle on test bench onlyPrevents endangerment during testing
Sign-offOEM CS Manager approval before testing beginsPrevents scope creep; establishes legal framework

Reconnaissance and Interface Mapping

Pythonvehicle_recon.py
#!/usr/bin/env python3
import can, time

def enumerate_ecus(iface="vcan0") -> dict:
    # Broadcast UDS 0x22/0xF18B to enumerate responding ECUs on bus
    bus = can.interface.Bus(iface, bustype="socketcan")
    ecus = {}

    # Functional address 0x7DF → all ECUs respond with physical address 0x7E8+
    frame = can.Message(arbitration_id=0x7DF,
                        data=[0x03,0x22,0xF1,0x8B,0,0,0,0],
                        is_extended_id=False)
    bus.send(frame)

    deadline = time.time() + 0.2
    while time.time() < deadline:
        msg = bus.recv(timeout=0.01)
        if msg and 0x700 <= msg.arbitration_id <= 0x7FF and msg.data[1] == 0x62:
            addr = msg.arbitration_id - 0x40
            ecus[hex(addr)] = {"response_id": hex(msg.arbitration_id),
                               "mfg_date": msg.data[3:9].hex()}
            print(f"  ECU at {hex(addr)}: DID F18B = {msg.data[3:9].hex()}")
    bus.shutdown()
    return ecus

# After ECU enumeration: document each interface, protocol, observed services,
# and authentication state → input to exploitation phase

Exploitation Phase: Hardware Tools

ToolInterfaceSeverity If Successful
OpenOCD + FTDI FT232HJTAG/SWD debug pads on PCBCRITICAL: full firmware extraction; arbitrary code execution via debugger
ChipWhispererPower analysis during HSM AES computationHIGH: AES key recovery via Correlation Power Analysis (10k traces)
Saleae logic analyserSPI/UART/I2C flash bus during bootHIGH: plaintext key material visible if flash not encrypted
Fault injector (glitcher)Clock/voltage glitching during secure bootCRITICAL: bypass CMAC verification; load unsigned firmware
HackRF SDRRKE/TPMS RF (433/868 MHz)HIGH: relay attack; TPMS pressure data spoofing

Penetration Test Finding Tracker

Pythonpentest_tracker.py
#!/usr/bin/env python3
findings = [
    {"id":"PT-001",
     "title":"DoIP RoutingActivation without mTLS",
     "severity":"Critical","cvss":9.8,
     "cwe":"CWE-306 Missing Authentication",
     "tara_ref":"TS-09","status":"Open","fixed":False,
     "fix":"Enforce TLS 1.3 + mandatory OEM client certificate for RoutingActivation"},

    {"id":"PT-002",
     "title":"SecOC 24-bit truncated MAC on ASIL C powertrain PDU",
     "severity":"High","cvss":7.4,
     "cwe":"CWE-327 Weak Cryptographic Algorithm",
     "tara_ref":"TS-11","status":"Fixed v3.3.0","fixed":True,
     "fix":"SecOCAuthInfoTruncLength increased from 24 to 48 bits"},

    {"id":"PT-003",
     "title":"JTAG debug port active on production ECU",
     "severity":"Critical","cvss":9.0,
     "cwe":"CWE-1191 On-Chip Debug/Test Interface With Improper Access Control",
     "tara_ref":"Physical access threat","status":"Open","fixed":False,
     "fix":"Disable JTAG in production via fuse; verify with JTAG probe rejection test"},
]

for f in findings:
    icon = "✓" if f["fixed"] else "⚠️"
    print(f"[{icon}] {f['id']} [{f['severity']}] CVSS {f['cvss']}: {f['title']}")
    print(f"    Fix: {f['fix']}")
    print(f"    TARA: {f['tara_ref']} | {f['status']}")
    print()

open_critical = [f for f in findings if not f["fixed"] and f["severity"]=="Critical"]
print(f"{len(open_critical)} open Critical finding(s) -- block SOP until resolved")

Summary

ECU penetration testing is most valuable when it is TARA-driven: every test maps to a specific threat scenario and either confirms the countermeasure works (residual risk accepted) or reveals it does not (residual risk reassessed). Hardware attack tools -- JTAG extraction, power analysis, fault injection -- address physical-access attack paths that software-only testing cannot exercise. Open Critical findings block SOP; re-tests of fixed findings update the cybersecurity case with evidence of effective countermeasure deployment.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousVulnerability Scanning & FuzzingNext →Hands-On: Security Testing Pipeline