We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

How to Hack Your Mini Cooper: Reverse Engineering Controller Area Network (CAN) Messages on Passenger Automobiles

00:00

Formal Metadata

Title
How to Hack Your Mini Cooper: Reverse Engineering Controller Area Network (CAN) Messages on Passenger Automobiles
Title of Series
Number of Parts
112
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
This presentation introduces the underlying protocols on automobile communication system networks of passenger vehicles and evaluates their security. Although reliable for communication, vehicle protocols lack inherit security measures. This work focuses strongly on controller area networks (CANs) and the lack of authentication and validation of CAN messages. Current data security methods for CAN networks rely on the use of proprietary CAN message IDs along with physical boundaries between the CAN bus and the outside world. As we all know, security through obscurity is not true security. These message IDs can be reverse engineered and spoofed to yield a variety of results. This talk discusses methods for reverse engineering proprietary CAN messages. These reverse engineered messages are then injected onto the CAN bus of a 2003 Mini Cooper with the help of cheap Arduino hardware hacking. Additionally, a proof of concept will be demonstrated on how to build your own rogue CAN node to take over a CAN network and potentially manipulate critical components of a vehicle. The proof of concept demonstrates taking full control of the instrument cluster using the reverse engineering methods presented. Jason Staggs is currently a graduate student in computer science and a security research assistant at the Institute for Information Security (iSec) at The University of Tulsa. He also is involved with The University of Tulsa's Crash Reconstruction Research Consortium (TU-CRRC) where he occasionally gets to hack and wreck a variety of vehicles. Before attending graduate school, Jason worked as a cyber-security analyst for a leading information security firm, True Digital Security in Tulsa, OK. Jason holds a Bachelors degree in Information Assurance and Forensics from Oklahoma State University along with several industry certifications. His research interests include network intrusion detection systems, digital forensics, critical infrastructure protection, and reverse engineering.
23
65
108
CAN busReverse engineeringMessage passingCAN busMultiplication signReverse engineeringBitMessage passing
Personal digital assistantDigital signalInformation securityInformationCrash (computing)CybersexCrash (computing)Student's t-testComputer networkDigitizingCybersexHypothesisInformation securityBitFundamental theorem of algebraCollisionIntrusion detection systemComputer scienceComputer forensicsComputer animation
Information securityMathematical analysisCommunications protocolComponent-based software engineeringCAN busComputer networkSurfaceMessage passingAuthenticationSystem programmingComputerPoint (geometry)Vector potentialVulnerability (computing)Computer networkComputerType theoryComputer forensicsLevel (video gaming)Event horizonControl systemData loggerGoodness of fitBlack boxFlow separationDemosceneQuicksortBuildingTouchscreenPhysical systemInterface (computing)Crash (computing)InfotainmentMetropolitan area networkObservational studyPoint (geometry)Vector potentialInterior (topology)Bus (computing)Vulnerability (computing)RingnetzConnectivity (graph theory)InterprozesskommunikationInformation securityGame controllerComputer animation
CAN busComputer networkReverse engineeringMessage passingProof theoryProof theoryMessage passingTable (information)Reverse engineeringBus (computing)Social classFunctional (mathematics)DampingComputer scienceProjective planePhysical systemNatural numberComputer networkCAN busInterprozesskommunikationComputer animationLecture/Conference
CAN busCommunications protocolComputer networkMessage passingMultiplicationPhysical systemStandard deviationFile formatIntrusion detection systemAreaGame controllerFrame problemCyclic redundancy checkUniqueness quantificationData transmissionPlug-in (computing)Integrated development environmentCodeMessage passingRight angleDiagramBus (computing)Functional (mathematics)Gateway (telecommunications)Communications protocolPhysical systemFile formatInterprozesskommunikationStandard deviationFrame problemQuicksortGame controllerRingnetzMultiplicationComputer wormRing (mathematics)MicrocontrollerSource codeVermaschtes NetzService (economics)Point (geometry)Workstation <Musikinstrument>Operator (mathematics)View (database)Spektrum <Mathematik>Integrated development environmentBroadcasting (networking)Filter <Stochastik>SubsetProcess (computing)CAN busAddress spaceBitComputer networkInformationConditional-access moduleType theoryCollisionMultiplication signPhysical lawPlastikkarteIdentifiabilityVery-high-bit-rate digital subscriber linePersonal identification numberCartesian coordinate systemMultimediaSet (mathematics)AreaComputerIntrusion detection systemComputer animation
System programmingControl flowPhysical systemAbsolute valueMaß <Mathematik>TelecommunicationPhysical systemMereologyView (database)Vulnerability (computing)Point (geometry)ComputerPatch (Unix)Computer networkFirmwareGame controllerOrder (biology)SoftwareExecution unitTelecommunicationVariety (linguistics)CAN busAverageComputer animation
Component-based software engineeringCAN busMessage passingInformationPhysical systemLatent heatIdentifiabilityComputer wormReverse engineeringWebsiteMotion captureVideoconferencingLatent heatGraph (mathematics)IdentifiabilityFuzzy logicComputer worm1 (number)Motion captureCollisionIntrusion detection systemPhysical systemDemo (music)Level (video gaming)InformationOrder (biology)MeasurementMessage passingInteractive televisionFunctional (mathematics)Bus (computing)Pattern languageCAN bus2 (number)Right angleComputer animation
Reverse engineeringMessage passingCAN busWebsiteVideoconferencingCrash (computing)CAN busData loggerComputer animationLecture/Conference
E-learningReverse engineeringMessage passingCAN busWebsiteVideoconferencingFrame problemCyclic redundancy checkUniqueness quantificationData transmissionStandard deviationPlug-in (computing)Integrated development environmentCodeMotion captureBus (computing)Message passingTrailComputer animationLecture/Conference
CAN busUniqueness quantificationRippingMessage passingIntrusion detection systemFunction (mathematics)Moving averageComputer wormMessage passingIntrusion detection systemInformationRaw image formatFrequencyMultiplication signCounting1 (number)Bus (computing)Motion captureCAN busComputer animation
Message passingCAN busComputer wormMessage passingIntrusion detection systemRight angleGraph (mathematics)Computer animation
Message passingCAN busGUI widgetPlot (narrative)Field (computer science)TouchscreenReverse engineeringPhysical systemVideoconferencingState of matterField (computer science)CollisionFuzzy logicMultiplication signMessage passingGame controllerIntrusion detection systemComputer animation
ComputerGauge theorySource codeMicrocontrollerCAN busModul <Software>Asynchronous Transfer ModeReal numberGame controllerBuildingComputer networkDemosceneProcedural programmingWebsiteComputer wormGame controllerGauge theoryVoltmeterModul <Software>Conditional-access moduleSource codeReal-time operating systemBus (computing)Message passingFunctional (mathematics)CAN busPower (physics)Computer animation
CAN busGame controllerAsynchronous Transfer ModeDemo (music)Military operationLevel (video gaming)Medical imagingCAN busAsynchronous Transfer ModeDemo (music)Bus (computing)Library (computing)Frame problemWater vaporOperator (mathematics)Game controllerComputer animation
CAN busAuto mechanicTape driveComponent-based software engineeringContext awarenessMessage passingComputer networkZugriffskontrolleFirewall (computing)RippingSoftware testingCrash (computing)InformationDemo (music)CodeCASE <Informatik>Source codePressureWebsiteLink (knot theory)Computer networkInformation securityMessage passingFamilyService (economics)Bus (computing)Row (database)1 (number)Mechanism designQuicksortVector potentialExistenceFirewall (computing)Multiplication signPhysical systemContext awarenessGame controllerCAN busComputer animation
Computer animationLecture/Conference
Transcript: English(auto-generated)
My name is Jason Staggs. This is my second time here at DEF CON. I was here last year at DEF CON 20. I had a great time. There are a lot of really cool people doing some really interesting stuff. And I'm just glad to be back again here this year to really have the experience. So the title of my talk is how to hack your Mini Cooper reverse engineering controller area network messages on passenger automobiles.
So a little bit about me. First and foremost, I am a graduate student of computer science at the Institute for Information Security at TU. I'm also currently finishing up my master's
thesis related to drive by download attack mitigation. I also have very strong research interests in network intrusion detection systems and critical infrastructure protection, digital forensics, and most recently, vehicle network security, which I carry out through TU's crash reconstruction research consortium, which is directed by Dr. Jeremy Daley. He was actually
a professor of mechanical engineering who quite literally wrote the book on automotive collision reconstruction fundamentals. So we're very fortunate to have somebody with his caliber of expertise leading those efforts. And then before I came to TU, I was actually
a cyber security analyst for an information security firm in Tulsa, Oklahoma called True Digital Security. So who here in the audience remembers Tim Burton's Batman Returns from like the early 90s? Okay. Several of you. Good, good. There's a scene actually in the
movie where Batman parks his Batmobile behind a building in a back alley somewhere. He then leaves it and takes off to, you know, attend to his crime fighting business. And then all of a sudden the penguin and his gangster thugs sort of stumble across the Batmobile
and they start playing ‑‑ they start taking things apart and then all of a sudden they attach a little wireless gizmo to the Batmobile designed to interface with the actual computer systems on the car. They basically reassemble everything they take off. Batman comes back later on that night, hops in his Batmobile and goes off and leaves.
And then all of a sudden the penguin kind of appears on the infotainment screen and says, gentlemen, start your engines. And then from that point forward Batman is frantically trying to stomp on the brake pedal and as the penguin is basically wreaking havoc on the citizens of Gotham City. A scenario such as that back then was somewhat near
impossible considering all the mechanical devices that were used to control the various components of the vehicle. But today a scenario such as that is actually fairly realistic. So what originally got me interested in vehicle network security was some research that was
put out by the University of Washington and the University of California San Diego back in 2010 and 2011. What they did originally was they actually did an empirical study to see how resilient the computer systems on vehicles were to digital attacks. And
the short answer to that is they're not too resilient whatsoever. Surprise, surprise. So in their first paper they actually were able to compromise various systems on the automobile. Assuming the attacker had physical access to the bus, you know, what all could they do? They were able to take full control of, like I said, the brakes, the accelerator
pedal, body control mechanisms such as the locks, interior and exterior lighting, basically everything. They later received some criticism from automotive manufacturers saying, yeah, well, you were able to do that but you had physical access to the car anyways, why not just cut the brake lines? Well, okay. So the following year they put out some
more research. Basically they were able to carry out the same types of attacks basically by taking advantage of some vulnerabilities and some shortwave radio communication such
as Bluetooth and a telemetry device. So at TU we're interested in doing this type of research as well. We also do chip‑level forensics on ECUs, so the actual systems on the actual vehicle networks themselves. We also assess the accuracy of the actual
pre‑crash and crash data stored on event data recorder, so the little black boxes that automobiles contain. And then we want to be able to understand these systems and networks at a very low level and be able to understand the potential points of vulnerability on these systems and networks. But most importantly we want to be able to prevent something
like this from turning into this because of this. So what you guys are looking at right here on the table, I'm sure a lot of you can't see it in the back, what we're calling
it is the CAN clock. It was actually a project that was the outcome of a research‑driven class that I was involved with last semester called vehicle communication systems. That was co‑taught by Dr. Daley and Dr. Mauricio Papa, who is a computer scientist and who specializes in computer networks. It was designed originally as a proof of concept
to demonstrate what a rogue ECU device could do if it was attached to a CAN bus. And the overall goal was to actually transform the instrument cluster from the Mini Cooper into a functional clock. So there was literally two problems. Actually
I know I had no prior knowledge to how these systems work beforehand, so I had to build a CAN bus from scratch and then also with passenger automobiles the actual message IDs themselves that are responsible for controlling the various devices and functionality of the systems on the vehicle are proprietary in nature. So some reverse engineering methods were used
to identify the message IDs themselves. So it's actually quite common for vehicles to have multiple types of networks in place on these vehicles. If you have a car that
was manufactured on or after 2008, then by law you actually have CAN, whether you know it or not, on your vehicle. If you're curious to see whether or not you have a CAN enabled vehicle, you can do a voltage check on pin 6 and 14 on your diagnostic connector underneath your steering wheel. Network protocols such as flex ray, LIN, MOST,
MOST being more of a high speed solution for multimedia applications within vehicles. J1850, J1939 is actually the protocol used for the heavy trucking industry that sort of sits on top of CAN. And then what we're looking at right here is actually the
data bus diagram of the Mini Cooper itself. As you can see, there's actually four different networks here that are all interconnected with the actual instrument cluster, believe it or not, acting as the gateway. And these systems are actually kind of segmented
based on common functionality and information that they share between one another. So when we're talking about CAN, controller area networks, it was actually developed by Robert Bosch back in the 80s to actually as a method for basically communication between
embedded systems with a bus style topology within vehicles. Prior to CAN, a lot of the solutions for networking embedded systems on vehicles sort of called for more of the ring style mesh topology where nodes were sort of interconnected
and dependent upon one another. So if one node were to fail, that could potentially affect the other node on the vehicle. And this was somewhat of a nightmare from a service technician's point of view trying to troubleshoot these networks. So CAN was actually designed to be a very resilient networking protocol and standard
designed to withstand harsh operating environments such as the heats and the colds, electromagnetic interference, those sorts of things. And then automotive manufacturers from like European automotive manufacturers were early adopters of the standard. So your BMW, Mercedes,
Volkswagen, Volvo, those guys were early adopters of the standard. And CAN is actually a multi‑master broadcast bus system. So the idea obviously being that if one node were to transmit a message, then all other nodes on the bus would actually receive that message. Whether or not a node actually processes that message is dependent
upon something called access filters ‑‑ I'm sorry, acceptance filters on the actual CAN controller itself. So if a message matches up with the actual acceptance filter, it then gets passed on to the microcontroller for further processing. Otherwise it's disregarded.
And with CAN, there's no notion of source addresses. So it's nearly impossible to identify where a message actually came from, which is sort of a problem. And CAN actually comes in two flavors. So there's the standard format which is used on the passenger automobiles. And then there's the extended format. With the standard format that uses
11‑bit message ID. And then like I said, in the automotive, the passenger automobile world, these message IDs are actually proprietary. But when we're talking about something like J1939, which is the protocol for the heavy trucking industry, it uses
a 29‑bit message ID. And actually this whole standard is fully documented. So if somebody was wanting to create a message designed to maybe override a brake controller, all they would have to do is refer to the Society of Automotive Engineers documentation
for J1939 to construct such a message. Here's what a CAN frame looks like. So with a CAN frame, the actual payload portion of it is limited to up to 8 bytes, which I thought was somewhat limited compared to like stuff like Ethernet, which can be up to
1,500 bytes. And so the way ‑‑ one of the cool things about CAN is the way it handles arbitration. So if two nodes attempting to transmit at the same time, obviously perform a collision, the way it handles arbitration is based on the identifier, the message ID
itself. So the idea being a node trying to transmit a message with a lower message ID has higher precedence than another node trying to transmit a message with a higher message ID. And then the actual computer systems on CAN networks or vehicle systems for that
matter, we call ECUs, electronic control units. And these are designed to control a variety of features on the vehicle, everything from vehicle safety critical systems to non‑safety critical systems. And these devices are for the most part programmable, which is nice from the automotive manufacturer point of view because if there's a flaw or
vulnerability discovered within one of these devices, they can just push out new firmware updates or patches or whatever software updates as opposed to physically removing these devices. And then the average modern day luxury vehicle has somewhere on the order
of 70 or so ECUs. All right. So let's get back to the actual CAN clock instrument cluster thing that I built here. So what we want to do is we want to be able to manipulate the tachometer and the speedometer. The problem with that is manufacturers don't publish the actual CAN IDs or specific payload information in order to
manipulate these accordingly. So we actually used several methods to actually figure out what's, you know, how we control the various functionality. The first one was we developed a method for visually correlating physical system interactions with identifiable patterns. You'll see what I'm saying here in a minute. But humans are
inherently good at this. We're inherently good at seeing, you know, patterns that we recognize on a graph. Maybe something that's indicative of vehicle speed or engine speed. And then for the ones that we weren't able to use this method on, we used some simple fuzzing techniques to identify the various functionality that we're interested in. In my
demo right now, the lighting is causing some issues, but afterwards, if you guys want to see this, I'll be out in the hallway or the chill out lounge and I'll be happy to demonstrate it for you guys. And then so the actual instrument cluster from the Mini Cooper was salvaged from a rec Mini Cooper that was involved in a stage automotive
collision with a GMC envoy. Before these cars were actually involved in the automotive collision, they were outfitted with external like instruments to measure such things as vehicle speed and then we would correlate that data with the data on the CAN bus itself to verify its accuracy. And this capture lasted for roughly 90 seconds. And over the course
of that capture, it gave us around 106,000 actual messages on the CAN bus. I'll show you guys the crash. As you can see, the Mini Cooper didn't really stand much of a
chance whatsoever. So we also actually hooked up a data logger to the actual CAN bus
itself to record all the messages obviously on the bus. And here's kind of the raw output of that. So message IDs and raw payload information. And then we did like a
unique basically on all the message IDs to see, you know, which IDs actually occurred. And then a frequency count to see actually how many times a message was transmitted on the bus during that capture. And then we started to play with the ones that were most occurring first. So back to the method of the visually identifying CAN messages of
interest based on plotting the data on a graph. If we're interested in vehicle speed, we basically started to play with suspect message IDs and then for each byte offset in the payload, we would plot the data until we saw something that was indicative of vehicle speed such as the third one right here. And then for the tachometer, so if you
notice in the video I just showed you, both of the cars were actually being pulled together like with a pulley system for the collision. So the actual engine speed itself was at an idle state the entire time. So we basically had to use some simple
fuzzing techniques on the data fields of the suspect message IDs until the tachometer basically started flipping out of control and the needle starts spinning like crazy. So that was kind of interesting. So up until now, we've actually identified, you know,
the message IDs responsible for the speedometer and the tachometer, as well as the payload and the data offsets for those. So then we just built a simple CAN bus. We used some 18‑gauge wire, 220‑ohm terminating resistors, a 12‑volt power source, an Arduino with a CAN bus shield that had an MCP2515 CAN controller and an
MCP2551 CAN transceiver, the instrument cluster obviously, and then a realtime clock module for implementing the clock functionality. All this is available on our site, a full step‑by‑step tutorial and procedure, as well as the source code for this. And here's
an image of what it looked like early on in the prototyping stages. It's kind of a mess. And as far as talking CAN with the Arduino, we just used basically a CAN controller library that was designed to communicate with MCP2515 that allowed us to construct basically CAN frames and then inject them onto the bus. And then so basically
there's two modes of operation. There's the clock mode and then there's the demo mode. So demo mode means just like incrementing the speedometer and the tachometer. Like I said, I'll show you guys a demo afterwards if you're
interested. So, you know, one might think, okay, so if you have physical access to a car anyways, you know, oh, well. But, you know, there's a bunch of possible scenarios in which case like potential conspirators like service technicians and mechanics, car rental companies, co‑workers, family, friends, ex‑girlfriends could
potentially have momentarily access to your CAN bus or car and they could attach a road ECU kind of like the one I built here for less than $100. So that's kind of a problem. And they could attach whether that be to the OBD 2 port underneath the
steering wheel or tapping the CAN bus via vampire tap style either under the hood or by some other means. So what's surprising to me is that the actual access control, I
guess, between ECU and ECU or network to network on vehicles is somewhat nonexistent or the ones that are in existence aren't very good and have easily bypassed. So maybe applying conventional network security techniques such as like maybe network intrusion prevention systems of some kind or some firewall methods to
these networks might provide a better solution. And then maybe some sort of like message anomaly prevention depending on the context of other messages present on the CAN bus at the time. So maybe there should be a message that says, okay,
someone's trying to apply full throttle to the accelerator but at the same time they're trying to, you know, apply full pressure to the brakes. And then if you're ‑‑ in case you're interested in some of the research that we're doing,
here's some links to our sites and some of the stuff that we're working on. Like I said, a full tutorial and source code is available on our site. So feel free to check out our stuff. And I'll be out roaming around. So if you see me around here, feel free to come out and ask me questions. If you have some questions or ideas or concerns, feel free to e‑mail me. Thank you very much.