parent
d86eda5f1d
commit
cbae9be5b5
|
@ -33,6 +33,7 @@ class Module
|
|||
autoload :Target, 'msf/core/module/target'
|
||||
autoload :Type, 'msf/core/module/type'
|
||||
autoload :UI, 'msf/core/module/ui'
|
||||
autoload :UUID, 'msf/core/module/uuid'
|
||||
|
||||
include Msf::Module::Arch
|
||||
include Msf::Module::Author
|
||||
|
@ -47,6 +48,7 @@ class Module
|
|||
include Msf::Module::Search
|
||||
include Msf::Module::Type
|
||||
include Msf::Module::UI
|
||||
include Msf::Module::UUID
|
||||
|
||||
# Make include public so we can runtime extend
|
||||
public_class_method :include
|
||||
|
@ -293,16 +295,7 @@ class Module
|
|||
#
|
||||
attr_accessor :error
|
||||
|
||||
#
|
||||
# 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.
|
||||
|
|
|
@ -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
|
|
@ -18,6 +18,7 @@ describe Msf::Module do
|
|||
it { is_expected.to respond_to :register_parent }
|
||||
it { is_expected.to respond_to :replicant }
|
||||
it { is_expected.to respond_to :set_defaults }
|
||||
it { is_expected.to respond_to :uuid }
|
||||
it { is_expected.to respond_to :workspace }
|
||||
|
||||
it_should_behave_like 'Msf::Module::Arch'
|
||||
|
|
Loading…
Reference in New Issue