Class: Mdm::Module::Detail
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mdm::Module::Detail
- Defined in:
- app/models/mdm/module/detail.rb
Overview
Details about an Msf::Module. Metadata that can be an array is stored in associations in modules under the Mdm::Module namespace.
Constant Summary collapse
- DIRECTORY_BY_TYPE =
{ 'auxiliary' => 'auxiliary', 'encoder' => 'encoders', 'exploit' => 'exploits', 'nop' => 'nops', 'payload' => 'payloads', 'post' => 'post' }
- PRIVILEGES =
#privileged is Boolean so, valid values are just
true
andfalse
, but since both the validation and factory need an array of valid values, this constant exists. [ false, true ]
- RANK_BY_NAME =
Converts #rank, which is an Integer, to the name used for that rank.
{ 'Manual' => 0, 'Low' => 100, 'Average' => 200, 'Normal' => 300, 'Good' => 400, 'Great' => 500, 'Excellent' => 600 }
- STANCES =
Valid values for #stance.
[ 'aggressive', 'passive' ]
Instance Attribute Summary collapse
-
#actions ⇒ Array<Mdm::Module::Action>
Auxiliary actions to perform when this running this module.
-
#archs ⇒ Array<Mdm::Module::Arch>
Architectures supported by this module.
-
#authors ⇒ Array<Mdm::Module::Mixin>
Authors (and their emails) of this module.
-
#default_action ⇒ String
Name of the default action in #actions.
-
#default_target ⇒ String
Name of the default target in #targets.
-
#description ⇒ String
A long, paragraph description of what the module does.
-
#disclosure_date ⇒ DateTime
The date the vulnerability exploited by this module was disclosed to the public.
-
#file ⇒ String
The full path to the module file on-disk.
-
#fullname ⇒ String
The full name of the module.
-
#license ⇒ String
The name of the software license for the module's code.
-
#mixins ⇒ Array<Mdm::Module::Mixin>
Mixins used by this module.
-
#mtime ⇒ DateTime
The modification time of the module file on-disk.
-
#mtype ⇒ String
The type of the module.
-
#name ⇒ String
The human readable name of the module.
-
#platforms ⇒ Array<Mdm::Module::Platform>
Platforms supported by this module.
-
#privileged ⇒ Boolean
Whether this module requires priveleged access to run.
-
#rank ⇒ Integer
The reliability of the module and likelyhood that the module won't knock over the service or host being exploited.
-
#ready ⇒ false, true
Boolean indicating whether the metadata for the module has been updated from the on-disk module.
-
#refname ⇒ String
The reference name of the module.
-
#refs ⇒ Array<Mdm::Module::Ref>
External references to the vulnerabilities this module exploits.
-
#stance ⇒ 'active', ...
Whether the module is active or passive.
-
#targets ⇒ Array<Mdm::Module::Target>
Names of targets with different configurations that can be exploited by this module.
Instance Method Summary collapse
- #add_action(name) ⇒ true, false
- #add_arch(name) ⇒ true, false
- #add_author(name, email = nil) ⇒ true, false
- #add_mixin(name) ⇒ true, false
-
#add_platform(name) ⇒ true, false
Adds an Platform with the given Platform#name to #platforms and immediately saves it to the database.
- #add_ref(name) ⇒ true, false
- #add_target(index, name) ⇒ true, false
-
#supports_stance? ⇒ true, false
Returns whether this module supports a #stance.
Instance Attribute Details
#actions ⇒ Array<Mdm::Module::Action>
Auxiliary actions to perform when this running this module.
53 |
# File 'app/models/mdm/module/detail.rb', line 53 has_many :actions, :class_name => 'Mdm::Module::Action', :dependent => :destroy |
#archs ⇒ Array<Mdm::Module::Arch>
Architectures supported by this module.
59 |
# File 'app/models/mdm/module/detail.rb', line 59 has_many :archs, :class_name => 'Mdm::Module::Arch', :dependent => :destroy |
#authors ⇒ Array<Mdm::Module::Mixin>
Authors (and their emails) of this module. Usually includes the original discoverer who wrote the proof-of-concept and then the people that ported the proof-of-concept to metasploit-framework.
66 |
# File 'app/models/mdm/module/detail.rb', line 66 has_many :authors, :class_name => 'Mdm::Module::Author', :dependent => :destroy |
#default_action ⇒ String
Name of the default action in #actions.
|
# File 'app/models/mdm/module/detail.rb', line 96
|
#default_target ⇒ String
Name of the default target in #targets.
|
# File 'app/models/mdm/module/detail.rb', line 101
|
#description ⇒ String
A long, paragraph description of what the module does.
|
# File 'app/models/mdm/module/detail.rb', line 106
|
#disclosure_date ⇒ DateTime
The date the vulnerability exploited by this module was disclosed to the public.
|
# File 'app/models/mdm/module/detail.rb', line 111
|
#file ⇒ String
The full path to the module file on-disk.
|
# File 'app/models/mdm/module/detail.rb', line 116
|
#fullname ⇒ String
|
# File 'app/models/mdm/module/detail.rb', line 121
|
#license ⇒ String
The name of the software license for the module's code.
|
# File 'app/models/mdm/module/detail.rb', line 126
|
#mixins ⇒ Array<Mdm::Module::Mixin>
Mixins used by this module.
72 |
# File 'app/models/mdm/module/detail.rb', line 72 has_many :mixins, :class_name => 'Mdm::Module::Mixin', :dependent => :destroy |
#mtime ⇒ DateTime
The modification time of the module file on-disk.
|
# File 'app/models/mdm/module/detail.rb', line 131
|
#mtype ⇒ String
The type of the module.
|
# File 'app/models/mdm/module/detail.rb', line 136
|
#name ⇒ String
The human readable name of the module. It is unrelated to #fullname or #refname and is better thought of as a short summary of the #description.
|
# File 'app/models/mdm/module/detail.rb', line 141
|
#platforms ⇒ Array<Mdm::Module::Platform>
Platforms supported by this module.
78 |
# File 'app/models/mdm/module/detail.rb', line 78 has_many :platforms, :class_name => 'Mdm::Module::Platform', :dependent => :destroy |
#privileged ⇒ Boolean
Whether this module requires priveleged access to run.
|
# File 'app/models/mdm/module/detail.rb', line 147
|
#rank ⇒ Integer
The reliability of the module and likelyhood that the module won't knock over the service or host being exploited. Bigger values is better.
|
# File 'app/models/mdm/module/detail.rb', line 152
|
#ready ⇒ false, true
Boolean indicating whether the metadata for the module has been updated from the on-disk module.
|
# File 'app/models/mdm/module/detail.rb', line 158
|
#refname ⇒ String
The reference name of the module.
|
# File 'app/models/mdm/module/detail.rb', line 164
|
#refs ⇒ Array<Mdm::Module::Ref>
External references to the vulnerabilities this module exploits.
84 |
# File 'app/models/mdm/module/detail.rb', line 84 has_many :refs, :class_name => 'Mdm::Module::Ref', :dependent => :destroy |
#stance ⇒ 'active', ...
Whether the module is active or passive. nil
if the module type does not
support stances.
|
# File 'app/models/mdm/module/detail.rb', line 169
|
#targets ⇒ Array<Mdm::Module::Target>
Names of targets with different configurations that can be exploited by this module.
90 |
# File 'app/models/mdm/module/detail.rb', line 90 has_many :targets, :class_name => 'Mdm::Module::Target', :dependent => :destroy |
Instance Method Details
#add_action(name) ⇒ true, false
215 216 217 |
# File 'app/models/mdm/module/detail.rb', line 215 def add_action(name) self.actions.build(:name => name).save end |
#add_arch(name) ⇒ true, false
225 226 227 |
# File 'app/models/mdm/module/detail.rb', line 225 def add_arch(name) self.archs.build(:name => name).save end |
#add_author(name, email = nil) ⇒ true, false
236 237 238 |
# File 'app/models/mdm/module/detail.rb', line 236 def (name, email=nil) self..build(:name => name, :email => email).save end |
#add_mixin(name) ⇒ true, false
246 247 248 |
# File 'app/models/mdm/module/detail.rb', line 246 def add_mixin(name) self.mixins.build(:name => name).save end |
#add_platform(name) ⇒ true, false
Adds an Platform with the given Platform#name to #platforms and immediately saves it to the database.
256 257 258 |
# File 'app/models/mdm/module/detail.rb', line 256 def add_platform(name) self.platforms.build(:name => name).save end |
#add_ref(name) ⇒ true, false
266 267 268 |
# File 'app/models/mdm/module/detail.rb', line 266 def add_ref(name) self.refs.build(:name => name).save end |
#add_target(index, name) ⇒ true, false
277 278 279 |
# File 'app/models/mdm/module/detail.rb', line 277 def add_target(index, name) self.targets.build(:index => index, :name => name).save end |
#supports_stance? ⇒ true, false
288 289 290 291 292 293 294 295 296 |
# File 'app/models/mdm/module/detail.rb', line 288 def supports_stance? supports_stance = false if ['auxiliary', 'exploit'].include? mtype supports_stance = true end supports_stance end |