-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ECU Hard Reset for hwbridge #15707
Conversation
Hmm, I am not sure why msftidy keeps on failing here despite not getting errors from my end. |
Thanks for your pull request! Before this pull request can be merged, it must pass the checks of our automated linting tools. We use Rubocop and msftidy to ensure the quality of our code. This can be ran from the root directory of Metasploit:
You can automate most of these changes with the
Please update your branch after these have been made, and reach out if you have any problems. |
The bot should hopefully shed some light on how to fix the linting issues 👍 |
I guess it is failing because of this error:
|
No that's informational only, this is the relevant error |
I see, I am getting these errors when I run
rubocop then indents a lot of spaces in the info and register_options. I fixed it with 2 indentations and then make changes here and it still fails. |
This is the output I get after running Rubocop locally, with the same command you posted: ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
def initialize(info = {})
super(
update_info(
info,
'Name' => 'ECU Hard Reset',
'Description' => ' This module performs hard reset in the ECU Reset Service Identifier (0x11)',
'License' => MSF_LICENSE,
'Author' => ['Jay Turla'],
'Platform' => ['hardware'],
'SessionTypes' => ['hwbridge']
)
)
register_options([
OptString.new('ARBID', [false, 'CAN ID to perform ECU Hard Reset', '0x7DF']),
OptString.new('CANBUS', [false, 'CAN Bus to perform scan on, defaults to connected bus', nil])
])
end
def run
unless client.automotive
print_error('The hwbridge requires a functional automotive extention')
return
end
print_status('Performing ECU Hard Reset...')
client.automotive.cansend(datastore['CANBUS'], datastore['ARBID'], '0211010000000000')
end
end After that, it's still missing the stability notes in the metadata section:
Documentation for that is here: https://github.com/rapid7/metasploit-framework/wiki/Definition-of-Module-Reliability,-Side-Effects,-and-Stability 👍 |
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
Finally! I have also added the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Will land this shortly
Release NotesAdds a new |
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:
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:
You can use candump to verify the CAN messages being sent:
UDS Server Output