SlideShare a Scribd company logo
1 of 18
How to
Straighten up a
Car's "Brains"
Kirill Ermakov, Dmitry Sklyarov
Department for Advanced Developments
Positive Technologies
Positive Hack Days III, May 23-24, 2013
Engine Control Units
(ECUs)
Factory Engine Control Units (ECUs)
How they operates:
― Reads values from a multitude of sensors
― Interprets the data using multidimensional performance
maps (called Look-up tables)
― Electronically controls a series of actuators on an internal
combustion engine to ensure the optimum running
Features:
― Installed by car manufacturers
― Calibrated during factoring
― Tuning parameters are usually not available for adjustment
Programmable ECUs
Features:
― Engine tuner can connect the ECU to a PC
― Adjustments can be made with tuning software
― On-board data logging
Also allows control:
― Traction
― Boost
― Other equipment
(servo motors,
pumps, fans, …)
Ref & Sync trigger
Temperature inputs
Voltage inputs
Lambda sensor inputs
Digital inputs
Fuel injector drivers
Ignition drivers
Auxiliary outputs
Sensor power supply
Power
Communications
Inputs Outputs
Sample ECU wiring
Experimental ECU Features
― Controller Area Network (CAN) bus interface
― USB to CAN adapter
― ECU Manager software for Windows
― Upgradable firmware in “Intel HEX”-like format
― Motorola 68xxx-compatible CPU
― Some useful features are disabled in basic version of ECU
• Fortunately “Enable ECU Options…” menu item exists :-)
• But it asks for a password :-(
― Full-featured ECU near 3 times more expensive rather than
Basic one
Digging into the problem
Analyzing ECU Manager software
― ECU Manager software is C++ Builder application with
sophisticated classes hierarchy (static analysis is difficult)
― Client-side ECU Access Password verification (easy to bypass
with kiddie bit-hack)
― Passwords that needed for enabling ECU features are sent
to ECU and verified in firmware
Sniffing and logging USB traffic
― Simple protocol, no encryption
― Packet layout is recoverable by visual log analysis
prefix len cmd dir argsseq CRC payload
Header
length
Command
ID
Direction
2:snd,3:rcv
Sequential
packet No
Cmd args
(e.g. offs/len
of payload)
Packet
header
CRC-16 of
packet header
Analyzing USB traffic
― “Enable Feature” password is transferred as “Write” request
― Wrong passwords not written (error returned)
― ECU switched between “Firmware” and “Loader” states
during firmware update
ID Command action Command arguments
0x0 Initialize 00
0x3 Write memory <offset> <length> <region ID>
0x4 Read memory <offset> <length> <region ID>
0x6 ??? 4B 00 00 00 48 80 00 00 01 00 00 00
0xA Switch state 40 00 00 00 <state name>
0xF Reset -
ECU memory layout
Reading data from region 0x3E00-0x4000 returns only 0xFF’s
(both through Loader and Firmware)
Address, length Content Memory type
0x00000000, 0x23B4 Loader ROM
0x00003E00, 0x200 Secret constants ROM, read prohibited
0x00004000, 0x200 Feature-enable passwords Flash, verified before write
0x00060000, 0xFDEA All 0x00 Flash, FW-upgradeable
0x00070000, 0x7914 Default configuraion data Flash, FW-upgradeable
0x00400000, 0x3E036 Main firmware Flash, FW-upgradeable
Analyzing and hacking ECU firmware
― Writing DWORDs into 0x4000-0x4200 requires verification
based on Secret constants (stored in 0x3E00-0x4000)
― Verification algorithm is identifiable by lot or EOR (exclusive
OR) instructions that rare used in automotive functions ;-)
― We could modify firmware and upload it to ECU to allow
reading Secret table!
― After obtaining Secret table it is easy to reproduce the
verification algorithm to calculate password for any feature
Beware of the Dead End
― Any feature of ECU could be enabled just by providing
calculated password through ECU Manager software
― Some feature MUST NOT be enabled simultaneously!
― If so, ECU locks in Loader state and seems totally “bricked”
― It is still possible to upload Firmware Update, but that
makes no help
― We have several nasty hours
after putting out ECU in this state…
Life is beautiful [again] ;-)
Accessing password cell:
― Can’t write wrong DWORD (due to verification in Loader)
― Can write 8 bytes (verification performed only for DWORDs)
Writing to Flash memory:
― It is easy to change
arbitrary bit from ‘1’ to ‘0’
― But not vice versa
― It is possible to set bits to ‘1’
by erasing flash block
― After that just enable all
necessary features
0
2
4
6
8
10
Value of device ($K)
Conclusion
General thoughts:
― XOR is not needed in table look-ups. Using it in protection
algorithm is not a smart approach
― Ability to run crafted code on device makes all protection
useless
― It is a good idea to digitally sign Firmware updates and
check signature in Loader
But, anyway:
― Nobody cares about such things in automotive industry! ;-)
That’s all
Thanks for your attention
Kirill Ermakov, Dmitry Sklyarov
KErmakov@ptsecurity.ru
DSklyarov@ptsecurity.ru
Department for Advanced Developments
Positive Technologies
And special thanks to
A.Raspopov and A.Tlyapov
Как «вправить» автомобилю «мозги»

More Related Content

What's hot

ARM® Cortex M Boot & CMSIS Part 1-3
ARM® Cortex M Boot & CMSIS Part 1-3ARM® Cortex M Boot & CMSIS Part 1-3
ARM® Cortex M Boot & CMSIS Part 1-3
Raahul Raghavan
 
03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnection
Sher Shah Merkhel
 
Input Output Operations
Input Output OperationsInput Output Operations
Input Output Operations
kdisthere
 
EtherCAT Training
EtherCAT TrainingEtherCAT Training
EtherCAT Training
ICP DAS USA, Inc.
 

What's hot (20)

Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed ClocksAccurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
 
ARM® Cortex M Boot & CMSIS Part 1-3
ARM® Cortex M Boot & CMSIS Part 1-3ARM® Cortex M Boot & CMSIS Part 1-3
ARM® Cortex M Boot & CMSIS Part 1-3
 
ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3
 
03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc03 top level view of computer function and interconnection.ppt.enc
03 top level view of computer function and interconnection.ppt.enc
 
CPU Arcthitecture
CPU ArcthitectureCPU Arcthitecture
CPU Arcthitecture
 
03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnection
 
Counit2 2
Counit2 2Counit2 2
Counit2 2
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
 
15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA15 control-computer organization and archietecture-CO-COA
15 control-computer organization and archietecture-CO-COA
 
Input Output Operations
Input Output OperationsInput Output Operations
Input Output Operations
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Embedded systems 101 final
Embedded systems 101 finalEmbedded systems 101 final
Embedded systems 101 final
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
 
EtherCAT Training
EtherCAT TrainingEtherCAT Training
EtherCAT Training
 
Bus aribration
Bus aribrationBus aribration
Bus aribration
 
Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1
 
Microprocessor applications
Microprocessor applicationsMicroprocessor applications
Microprocessor applications
 
Frequently Asked Questions on AUTOSAR Services
Frequently Asked Questions on AUTOSAR ServicesFrequently Asked Questions on AUTOSAR Services
Frequently Asked Questions on AUTOSAR Services
 

Viewers also liked

Viewers also liked (20)

Защищенность GSM
Защищенность GSMЗащищенность GSM
Защищенность GSM
 
Современные DDoS-атаки: тенденции, опасность, подходы к защите
Современные DDoS-атаки: тенденции, опасность, подходы к защитеСовременные DDoS-атаки: тенденции, опасность, подходы к защите
Современные DDoS-атаки: тенденции, опасность, подходы к защите
 
200 open source проектов спустя: опыт статического анализа исходного кода
200 open source проектов спустя:опыт статического анализа исходного кода200 open source проектов спустя:опыт статического анализа исходного кода
200 open source проектов спустя: опыт статического анализа исходного кода
 
Exploiting Redundancy Properties of Malicious Infrastructure for Incident Det...
Exploiting Redundancy Properties of Malicious Infrastructure for Incident Det...Exploiting Redundancy Properties of Malicious Infrastructure for Incident Det...
Exploiting Redundancy Properties of Malicious Infrastructure for Incident Det...
 
Attacks on SAP Mobile
Attacks on SAP MobileAttacks on SAP Mobile
Attacks on SAP Mobile
 
Waf.js: как защищать веб-приложения с использованием JavaScript
Waf.js: как защищать веб-приложения с использованием JavaScriptWaf.js: как защищать веб-приложения с использованием JavaScript
Waf.js: как защищать веб-приложения с использованием JavaScript
 
Критически опасные уязвимости в популярных 3G- и 4G-модемах или как построить...
Критически опасные уязвимости в популярных 3G- и 4G-модемах или как построить...Критически опасные уязвимости в популярных 3G- и 4G-модемах или как построить...
Критически опасные уязвимости в популярных 3G- и 4G-модемах или как построить...
 
Современные DDoS-атаки: тенденции, опасность, подходы к защите
Современные DDoS-атаки: тенденции, опасность, подходы к защитеСовременные DDoS-атаки: тенденции, опасность, подходы к защите
Современные DDoS-атаки: тенденции, опасность, подходы к защите
 
Перехват беспроводных гаджетов — от квадрокоптеров до мышек
Перехват беспроводных гаджетов — от квадрокоптеров до мышекПерехват беспроводных гаджетов — от квадрокоптеров до мышек
Перехват беспроводных гаджетов — от квадрокоптеров до мышек
 
Выживший
ВыжившийВыживший
Выживший
 
Damn Vulnerable Chemical Process
Damn Vulnerable Chemical ProcessDamn Vulnerable Chemical Process
Damn Vulnerable Chemical Process
 
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security AssessmentPositive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
 
SSDL: один день из жизни разработчика
SSDL: один день из жизни разработчикаSSDL: один день из жизни разработчика
SSDL: один день из жизни разработчика
 
Как увидеть невидимые инциденты
Как увидеть невидимые инцидентыКак увидеть невидимые инциденты
Как увидеть невидимые инциденты
 
Why IT Security Is Fucked Up
Why IT Security Is Fucked UpWhy IT Security Is Fucked Up
Why IT Security Is Fucked Up
 
Восток — дело тонкое, или Уязвимости медицинского и индустриального ПО
Восток — дело тонкое, или Уязвимости медицинского и индустриального ПОВосток — дело тонкое, или Уязвимости медицинского и индустриального ПО
Восток — дело тонкое, или Уязвимости медицинского и индустриального ПО
 
Fingerprinting and Attacking a Healthcare Infrastructure
Fingerprinting and Attacking a Healthcare InfrastructureFingerprinting and Attacking a Healthcare Infrastructure
Fingerprinting and Attacking a Healthcare Infrastructure
 
Аспекты деятельности инсайдеров на предприятии
Аспекты деятельности инсайдеров на предприятииАспекты деятельности инсайдеров на предприятии
Аспекты деятельности инсайдеров на предприятии
 
Janitor to CISO in 360 Seconds: Exploiting Mechanical Privilege Escalation
Janitor to CISO in 360 Seconds: Exploiting Mechanical Privilege EscalationJanitor to CISO in 360 Seconds: Exploiting Mechanical Privilege Escalation
Janitor to CISO in 360 Seconds: Exploiting Mechanical Privilege Escalation
 
Эксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAPЭксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAP
 

Similar to Как «вправить» автомобилю «мозги»

NXP_SDV_RealTime software development organisation
NXP_SDV_RealTime software development organisationNXP_SDV_RealTime software development organisation
NXP_SDV_RealTime software development organisation
ssuser57b3e5
 

Similar to Как «вправить» автомобилю «мозги» (20)

I2c drivers
I2c driversI2c drivers
I2c drivers
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
Electronic Control Unit(ECU)
Electronic Control Unit(ECU)Electronic Control Unit(ECU)
Electronic Control Unit(ECU)
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
C C N A Day2
C C N A  Day2C C N A  Day2
C C N A Day2
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
 
A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...
 
PROGRAMMABLE LOGIC CONTROLLER
PROGRAMMABLE LOGIC CONTROLLERPROGRAMMABLE LOGIC CONTROLLER
PROGRAMMABLE LOGIC CONTROLLER
 
NXP_SDV_RealTime software development organisation
NXP_SDV_RealTime software development organisationNXP_SDV_RealTime software development organisation
NXP_SDV_RealTime software development organisation
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Assembler4
Assembler4Assembler4
Assembler4
 
UNIT-III ES.ppt
UNIT-III ES.pptUNIT-III ES.ppt
UNIT-III ES.ppt
 
Fundamentals
FundamentalsFundamentals
Fundamentals
 
PLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh ShekhawatPLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
PLC, DCS and PLC vs DCS Presentation by Jitender Singh Shekhawat
 
Fg a
Fg aFg a
Fg a
 
operating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS deviceoperating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS device
 
conrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptxconrol_Unit_part_of_computer_architecture.pptx
conrol_Unit_part_of_computer_architecture.pptx
 

More from Positive Hack Days

Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
Positive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
Positive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Positive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
Positive Hack Days
 

More from Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Как «вправить» автомобилю «мозги»

  • 1.
  • 2. How to Straighten up a Car's "Brains" Kirill Ermakov, Dmitry Sklyarov Department for Advanced Developments Positive Technologies Positive Hack Days III, May 23-24, 2013
  • 4. Factory Engine Control Units (ECUs) How they operates: ― Reads values from a multitude of sensors ― Interprets the data using multidimensional performance maps (called Look-up tables) ― Electronically controls a series of actuators on an internal combustion engine to ensure the optimum running Features: ― Installed by car manufacturers ― Calibrated during factoring ― Tuning parameters are usually not available for adjustment
  • 5. Programmable ECUs Features: ― Engine tuner can connect the ECU to a PC ― Adjustments can be made with tuning software ― On-board data logging Also allows control: ― Traction ― Boost ― Other equipment (servo motors, pumps, fans, …) Ref & Sync trigger Temperature inputs Voltage inputs Lambda sensor inputs Digital inputs Fuel injector drivers Ignition drivers Auxiliary outputs Sensor power supply Power Communications Inputs Outputs
  • 7. Experimental ECU Features ― Controller Area Network (CAN) bus interface ― USB to CAN adapter ― ECU Manager software for Windows ― Upgradable firmware in “Intel HEX”-like format ― Motorola 68xxx-compatible CPU ― Some useful features are disabled in basic version of ECU • Fortunately “Enable ECU Options…” menu item exists :-) • But it asks for a password :-( ― Full-featured ECU near 3 times more expensive rather than Basic one
  • 9. Analyzing ECU Manager software ― ECU Manager software is C++ Builder application with sophisticated classes hierarchy (static analysis is difficult) ― Client-side ECU Access Password verification (easy to bypass with kiddie bit-hack) ― Passwords that needed for enabling ECU features are sent to ECU and verified in firmware
  • 10. Sniffing and logging USB traffic ― Simple protocol, no encryption ― Packet layout is recoverable by visual log analysis prefix len cmd dir argsseq CRC payload Header length Command ID Direction 2:snd,3:rcv Sequential packet No Cmd args (e.g. offs/len of payload) Packet header CRC-16 of packet header
  • 11. Analyzing USB traffic ― “Enable Feature” password is transferred as “Write” request ― Wrong passwords not written (error returned) ― ECU switched between “Firmware” and “Loader” states during firmware update ID Command action Command arguments 0x0 Initialize 00 0x3 Write memory <offset> <length> <region ID> 0x4 Read memory <offset> <length> <region ID> 0x6 ??? 4B 00 00 00 48 80 00 00 01 00 00 00 0xA Switch state 40 00 00 00 <state name> 0xF Reset -
  • 12. ECU memory layout Reading data from region 0x3E00-0x4000 returns only 0xFF’s (both through Loader and Firmware) Address, length Content Memory type 0x00000000, 0x23B4 Loader ROM 0x00003E00, 0x200 Secret constants ROM, read prohibited 0x00004000, 0x200 Feature-enable passwords Flash, verified before write 0x00060000, 0xFDEA All 0x00 Flash, FW-upgradeable 0x00070000, 0x7914 Default configuraion data Flash, FW-upgradeable 0x00400000, 0x3E036 Main firmware Flash, FW-upgradeable
  • 13. Analyzing and hacking ECU firmware ― Writing DWORDs into 0x4000-0x4200 requires verification based on Secret constants (stored in 0x3E00-0x4000) ― Verification algorithm is identifiable by lot or EOR (exclusive OR) instructions that rare used in automotive functions ;-) ― We could modify firmware and upload it to ECU to allow reading Secret table! ― After obtaining Secret table it is easy to reproduce the verification algorithm to calculate password for any feature
  • 14. Beware of the Dead End ― Any feature of ECU could be enabled just by providing calculated password through ECU Manager software ― Some feature MUST NOT be enabled simultaneously! ― If so, ECU locks in Loader state and seems totally “bricked” ― It is still possible to upload Firmware Update, but that makes no help ― We have several nasty hours after putting out ECU in this state…
  • 15. Life is beautiful [again] ;-) Accessing password cell: ― Can’t write wrong DWORD (due to verification in Loader) ― Can write 8 bytes (verification performed only for DWORDs) Writing to Flash memory: ― It is easy to change arbitrary bit from ‘1’ to ‘0’ ― But not vice versa ― It is possible to set bits to ‘1’ by erasing flash block ― After that just enable all necessary features 0 2 4 6 8 10 Value of device ($K)
  • 16. Conclusion General thoughts: ― XOR is not needed in table look-ups. Using it in protection algorithm is not a smart approach ― Ability to run crafted code on device makes all protection useless ― It is a good idea to digitally sign Firmware updates and check signature in Loader But, anyway: ― Nobody cares about such things in automotive industry! ;-)
  • 17. That’s all Thanks for your attention Kirill Ermakov, Dmitry Sklyarov KErmakov@ptsecurity.ru DSklyarov@ptsecurity.ru Department for Advanced Developments Positive Technologies And special thanks to A.Raspopov and A.Tlyapov