CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/hardware/automotive/diagnostic_state.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Post
7
def initialize(info = {})
8
super(
9
update_info(
10
info,
11
'Name' => 'Diagnostic State',
12
'Description' => ' This module will keep the vehicle in a diagnostic state on rounds by sending tester present packet',
13
'License' => MSF_LICENSE,
14
'Author' => ['Jay Turla'],
15
'Platform' => ['hardware'],
16
'SessionTypes' => ['hwbridge'],
17
'Notes' => {
18
'Stability' => [CRASH_SAFE],
19
'SideEffects' => [PHYSICAL_EFFECTS],
20
'Reliability' => []
21
}
22
)
23
)
24
register_options([
25
OptString.new('ARBID', [false, 'CAN ID to perform Diagnostic State', '0x7DF']),
26
OptString.new('CANBUS', [false, 'CAN Bus to perform scan on, defaults to connected bus', nil]),
27
OptInt.new('ROUNDS', [true, 'Number of executed rounds', 500])
28
])
29
end
30
31
def run
32
unless client.automotive
33
print_error('The hwbridge requires a functional automotive extention')
34
return
35
end
36
print_status('Putting the vehicle in a diagnostic state...')
37
print_status('In order to keep the vehicle in this state, you need to continuously send a packet to let the vehicle know that a diagnostic technician is present.')
38
datastore['ROUNDS'].times do
39
client.automotive.cansend(datastore['CANBUS'], datastore['ARBID'], '013E')
40
end
41
end
42
43
end
44
45