Extract Msf::Module::UUID

MSP-11126
bug/bundler_fix
Luke Imhoff 2014-10-17 11:31:56 -05:00
parent d86eda5f1d
commit cbae9be5b5
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
3 changed files with 31 additions and 10 deletions

View File

@ -33,6 +33,7 @@ class Module
autoload :Target, 'msf/core/module/target' autoload :Target, 'msf/core/module/target'
autoload :Type, 'msf/core/module/type' autoload :Type, 'msf/core/module/type'
autoload :UI, 'msf/core/module/ui' autoload :UI, 'msf/core/module/ui'
autoload :UUID, 'msf/core/module/uuid'
include Msf::Module::Arch include Msf::Module::Arch
include Msf::Module::Author include Msf::Module::Author
@ -47,6 +48,7 @@ class Module
include Msf::Module::Search include Msf::Module::Search
include Msf::Module::Type include Msf::Module::Type
include Msf::Module::UI include Msf::Module::UI
include Msf::Module::UUID
# Make include public so we can runtime extend # Make include public so we can runtime extend
public_class_method :include public_class_method :include
@ -293,16 +295,7 @@ class Module
# #
attr_accessor :error attr_accessor :error
# protected
# A unique identifier for this module instance
#
attr_reader :uuid
protected
attr_writer :uuid
def generate_uuid
self.uuid = Rex::Text.rand_text_alphanumeric(8).downcase
end
# #
# Sets the modules unsupplied info fields to their default values. # Sets the modules unsupplied info fields to their default values.

View File

@ -0,0 +1,27 @@
module Msf::Module::UUID
#
# Attributes
#
# @!attribute [r] uuid
# A unique identifier for this module instance
attr_reader :uuid
protected
#
# Attributes
#
# @!attribute [w] uuid
attr_writer :uuid
#
# Instance Methods
#
def generate_uuid
self.uuid = Rex::Text.rand_text_alphanumeric(8).downcase
end
end

View File

@ -18,6 +18,7 @@ describe Msf::Module do
it { is_expected.to respond_to :register_parent } it { is_expected.to respond_to :register_parent }
it { is_expected.to respond_to :replicant } it { is_expected.to respond_to :replicant }
it { is_expected.to respond_to :set_defaults } it { is_expected.to respond_to :set_defaults }
it { is_expected.to respond_to :uuid }
it { is_expected.to respond_to :workspace } it { is_expected.to respond_to :workspace }
it_should_behave_like 'Msf::Module::Arch' it_should_behave_like 'Msf::Module::Arch'