lib/metasploit/credential/exporter/core.rb in metasploit-credential-1.0.0.pre.rails.pre.4.0 vs lib/metasploit/credential/exporter/core.rb in metasploit-credential-1.0.0
- old
+ new
@@ -1,11 +1,11 @@
# This class is used to export {Metasploit::Credential::Core} information, optionally scoped to associated
# {Metasploit::Credential::Login} objects. In the case of exporting Login objects, the associated `Mdm::Host`
# and `Mdm::Server` information is exported as well. Exported data can be optionally scoped to include only
# a certain whitelist of database IDs.
#
-# The {#export!} method creates a zip file on disk containing a CSV with the data. If the {#workspace} contains
+# The {#export!} method creates a zip file on disk containing a CSV with the data. If the `workspace` contains
# {Metasploit::Credential::SSHKey} objects on the exported {Metasploit::Credential::Core} objects, the keys are
# exported to files inside a subdirectory of the zip file.
# @example Exporting all Cores
# core_exporter = Metasploit::Credential::Exporter::Core.new(workspace: workspace, mode: :core)
# core_exporter.export!
@@ -39,22 +39,22 @@
ALLOWED_MODES = [LOGIN_MODE, CORE_MODE]
# The downcased and Symbolized name of the default object type to export
DEFAULT_MODE = LOGIN_MODE
- # An argument to {Dir::mktmpdir}
+ # An argument to `Dir::mktmpdir`
TEMP_ZIP_PATH_PREFIX = "metasploit-exports"
#
# Attributes
#
- # @!attribute export_data
+ # @!attribute [rw] export_data
# Holds the raw information from the database before it is formatted into the {#data} attribute
# @return [Array]
- attr_accessor :export_data
+ attr_writer :export_data
# @!attribute finalized_zip_file
# The final output artifacts, zipped
# @return [Zip::File]
attr_accessor :finalized_zip_file
@@ -107,10 +107,10 @@
fail "Invalid mode" unless ALLOWED_MODES.include?(mode)
super args
end
# Returns a platform-agnostic filesystem path where the key data will be saved as a file
- # @param line [Hash] the result of {#line_for_login} or #{line_for_core}
+ # @param line [Hash] the result of {#line_for_login} or {#line_for_core}
# @return [String]
def path_for_key(datum)
core = datum.is_a?(Metasploit::Credential::Core) ? datum : datum.core
dir_path = File.join(output_final_directory_path, Metasploit::Credential::Importer::Zip::KEYS_SUBDIRECTORY_NAME)
FileUtils.mkdir_p(dir_path)
\ No newline at end of file