Method: Metasploit::Credential::Importer::Zip#import!

Defined in:
lib/metasploit/credential/importer/zip.rb

#import!void

This method returns an undefined value.

Extract the zip file and pass the CSV file contained therein to a CSV::Core, which is in charge of creating new Core objects, creating new Public objects or linking existing ones, and associating them with extracted SSHKey objects read from the files indicated in the manifest.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/metasploit/credential/importer/zip.rb', line 57

def import!
  ::Zip::File.open(input.path) do |zip_file|
    zip_file.each do |entry|
      entry.extract(File.join(extracted_zip_directory, entry.name))
    end
  end

  csv_path = Dir.glob(File.join(extracted_zip_directory,'**', MANIFEST_FILE_NAME)).first
  csv_input = File.open(csv_path)
  Metasploit::Credential::Importer::Core.new(input: csv_input, origin: origin, workspace: workspace).import!
end