better handling of hosts with no USB History

git-svn-id: file:///home/svn/framework3/trunk@14153 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Carlos Perez 2011-11-03 22:59:39 +00:00
parent 86a7807b97
commit f23389390b
1 changed files with 36 additions and 35 deletions

View File

@ -51,8 +51,7 @@ class Metasploit3 < Msf::Post
usb_drive_classes = enum_subkeys('HKLM\\SYSTEM\\CurrentControlSet\\Enum\\USBSTOR') usb_drive_classes = enum_subkeys('HKLM\\SYSTEM\\CurrentControlSet\\Enum\\USBSTOR')
usb_uids_to_info = {} usb_uids_to_info = {}
usb_drive_uids = [] if not usb_drive_classes.nil?
usb_drive_classes.each do |x| usb_drive_classes.each do |x|
enum_subkeys(x).each do |y| enum_subkeys(x).each do |y|
begin begin
@ -93,7 +92,9 @@ class Metasploit3 < Msf::Post
end end
print_status(info_hash_to_str(out, v)) print_status(info_hash_to_str(out, v))
end end
else
print_error("No USB devices appear to have been connected to theis host.")
end
end end
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------